|
-
Jun 30th, 2005, 10:06 AM
#1
Thread Starter
Frenzied Member
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.
-
Jun 30th, 2005, 10:11 AM
#2
Thread Starter
Frenzied Member
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.
-
Jul 1st, 2005, 04:29 PM
#3
Thread Starter
Frenzied Member
Re: Search Speed Tuning[ASAP Responses Requested]
um.... anybody...? comments..? ***...?
Magiaus
If I helped give me some points.
-
Jul 5th, 2005, 12:49 AM
#4
Re: Search Speed Tuning[ASAP Responses Requested]
I can only advice, provide the users with the data they only need...
-
Jul 5th, 2005, 08:25 AM
#5
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|