database sql,with vb coding,first time running not fast

pts.
Tags:
SQL Database
Visual Basic 6
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BrentSheets
    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,925 pointsBadges:
    report
  • Denny Cherry
    Was this information useful in resolving your issue? Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,140 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following