0 pts.
 database sql,with vb coding,first time running not fast
we have an accounting package written in visual basic 6.0 and sql database,the problem is when we open the database the first time,it takes lot of time,but when we open it after, it will be very fast and remain fast ,even when we quit the application and restart it.

Software/Hardware used:
ASKED: October 2, 2007  8:40 AM
UPDATED: February 22, 2008  4:58 AM

Answer Wiki:
This will be because the first time you connect the database has to be opened and the information that you are looking for loaded from disk into memory. This is called caching the data. SQL caches as much data as possible into it's buffer. The more often the data is needed the longer it will stay in the buffer. Let used data is eventually flushed from the buffer as more recently used data is cached. Also make sure that your database does not have the auto-close option enabled. With this option enabled when all users leave for the data, SQL will close the file and flush the cache which removes all the cached data from memory writting it back to disk. You may need to look at your indexs on the tables which you are using, as incorrectly indexed tables can force SQL Server to load more data than is actually needed into memory which then takes longer than expected.
Last Wiki Answer Submitted:  October 5, 2007  7:52 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Micus2005, I’m not a SQL guru but I did come across the thread below on Microsoft Forums. Although the post was about storing images in SQL, the dialog is about how to mitigate slow loads.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1540589&SiteID=1

Hopefully, a real SQL guru will come along and hit the “Create Answer” button. Good luck.

 6,565 pts.

 

Was this information useful in resolving your issue?

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 64,520 pts.