Results 1 to 5 of 5

Thread: Search Speed Tuning[ASAP Responses Requested]

  1. #1

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Angry Search Speed Tuning[ASAP Responses Requested]

    Indexs are not paert of the equation at this point.....

    If I have a query:

    Code:
    @Param... 1-20,
    @Page int,
    @NumberOfResults int,
    @MaxSearchResults int
    AS
    
    SET ROWCOUNT @MaxSearchResults
    
    DECLARE @Results TABLE
    (
        CountID int IDENTITY NOT NULL,
        tblAID int,
        tblBID int
    )
    INSERT INTO @Results (tblAID, tblBID)
    SELECT tblA.ID, tblB.ID FROM tblA INNER JOIN tbl ON tblA.BID = tblB.ID WHERE @Param...1-20
    ORDER BY tblA.SomeColumn, tblB.SomeColumn
    
    SELECT tblA.*, tbl.* FROM @Results AS tblRet 
    WHERE --page index is 1 based
    tblRet.CountID > @NumberOfResults * (@PageNumber - 1) 
    AND 
    tblRet.CountID <= @NumberOfResults * (@PageNumber)	
    
    SET ROWCOUNT 0
    Will the fact that the number of search results that are being returned speed up the query given that because of the order by clause all possible results are pulled and sorted initialy before the ROWCOUNT limit is applied?

    Also won't setting this limit cause some results to never be avaliable?
    Magiaus

    If I helped give me some points.

  2. #2

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Search Speed Tuning[ASAP Responses Requested]

    I am thinking it is a waste of effort to try to speed up the searches by doing this.

    1) All posssible results are going to be pulled and touched.
    2) Some results may never be avaliable.
    3)The paging is already limiting the amount of network traffic caused by the query and reducing the Asp.Net page weight.

    Does this sound correct?

    Info on using SELECT TOP: http://msdn.microsoft.com/library/de...qd_04_13ec.asp

    Info on using SET ROWCOUNT n: http://msdn.microsoft.com/library/de...t-set_0bjo.asp
    Magiaus

    If I helped give me some points.

  3. #3

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Search Speed Tuning[ASAP Responses Requested]

    um.... anybody...? comments..? ***...?
    Magiaus

    If I helped give me some points.

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Search Speed Tuning[ASAP Responses Requested]

    I can only advice, provide the users with the data they only need...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Search Speed Tuning[ASAP Responses Requested]

    Well, I basicly convinced them to let me setup a configurable/dynamic limit for each search, and to let me start off with 0(get all) and limit as need be. We also setup indexing and rewrote a few of the really slow queries. Right now the queries are completing in under a second with around 1000 - 3000 records to work with... So for now the limit seems pointless and if they ever want to use the thing they can....
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width