Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Performance with two or more queries


Using MSSQL, or Sybase for that matter, why does a second simple select query run more slowly than a preceding query.   

    MS SQL has a "pending result sets" behavior where the st query will only retrieve a small set of records (usually enough to fill a grid or any other data aware controls), and there will be a pending result set. The second query causes that pending result set to be retrieved. This can be tested by closing the first query before running the second or connecting each query to a TDatabase. The BDE uses a "special" connection type that is restricted to one per database connection. When a second query is run within the same database connection, the BDE must fetch and cache the previous query's records before starting the next query. Suggestions: Close the first query before opening the second Use multiple databases, one per query Use a more restrictive where clause to limit the number of records Use a more restrictive domain result to retrieve only the fields you need

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use