> I think it applies because the whole discussion was about > what's a 'faster' way to do this...
> My point is that the second query is getting the data to > display on the page in question (say records 51 - 100), so > why does the first query need to return all rows of the > data? If the first query is purely to get a count (so you > know what to divide by to split up your pages) then it > seems to me to be unnecessary to return the additional > data that won't even be accessed. The second query (of > the 2 query approach) gets the actual data to display and > (in this scenario) would only contain 50 records. > The example I gave would of course need to have a WHERE > clause limiting to whatever the particular criteria is for > this page display...it wasn't just to get an arbitrary > count of all the records IN ADDITION to the 2 queries in > your approach. > The whole point was to say that using Count(ID) is faster > than using Count(*) or SELECT ID (getting all rows). Okay... Well... I was commenting specifically on the example where an ID column is fetched to filter the results being returned in the 2nd query, but I guess you're right, if you used another method like Oracle's MINUS clause to limit the records in the 2nd query, then you would need another method of getting the total number of records... however... I'm less inclined to think that approach would be faster because then you need all your where clause filters both in the data query and again in the count() query. My suspicion is that the execution plan for the query that uses just the primary key column (which you wouldn't have in this case) would be much more efficient than the execution plan for a query containing multiple references to non-primary columns in the where clause... I could be wrong, it's happened before. :) s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217036 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

