Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
TOP xxx of little benefit? |
Wed, May 2 2007 6:29 PM | Permanent Link |
Kerry Neighbour | I have read your thread on the discussion of this, and a recent post made
to the effect that TOP would probably not speed up a slow query. In my experience, this is certainly not the case. I have found that TOP 1000 speeds up my queries no end. For example, one big query on 100,000 records goes from 76 seconds to 0.687 seconds! A vast improvement. For this reason, on all of my user screens I have a spinbox so the user can set the TOP amount (normally 1000). I agree that if the result set does not contain 1000 records, then the speed will be the same. It seems to me, and I could be wrong, that the query is run UNTIL the 1,000 records are found, then it stops. It cerainly seems that way as a user running the query. While I am happy with the way TOP works, it would be interesting to see why it maybe should not work the way it seems to. |
Thu, May 3 2007 3:58 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Kerry,
<< I have read your thread on the discussion of this, and a recent post made to the effect that TOP would probably not speed up a slow query. >> No, what I said is that it doesn't necessarily speed up a query in a lot of cases. The only time that it does is if there is an index on the column in the ORDER BY that you're using, or if you're not using an ORDER BY at all. If DBISAM has to use a temporary index to perform the ordering, then it has to run the entire query before it can provide the TOP processing, negating any performance benefits. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |