I'll check that out, I am not using them now. Jeremy
-----Original Message----- From: Mark A Kruger [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 11:09 AM To: CF-Talk Subject: RE: Large count query > caching If you cannot cache on the web server - make sure and bind the data using CFQUERYPARAM. This will enable the RDMBS to use a cached execution plan on it's end. I have a blog on why this is important. http://mkruger.cfwebtools.com/index.cfm?mode=alias&alias=cfqueryparam Secondly, change the " * " to the PK field of the table. This is largely for the same reason. Why make the DB server look up all your columns? It's an unecessary step and it will cost you in execution time - maybe not a lot, but when you are dealing with 25 million rows ever millisecond counts :) -Mark -----Original Message----- From: Jeremy Bunton [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 8:28 AM To: CF-Talk Subject: Large count query > caching I have a query counting records in a 25 million plus database. Even with indexing and what not it takes about 25 seconds to run this query. (count * from table where date > 19000101) Is there a way I could cache the query so that if it is ran in that same way it very quickly returns the full count. I.E. this is a dynamically build query so sometimes it will have a long where clause that I may be different than the straight just count everything thing like above. It seems to me that if that query has been ran one time in the same way that query should not have to recount the next time, and should just output the count. Jeremy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235634 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

