Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Load database into memory

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-03-28 : 09:04:56
Guys,

I am trying to set up demo on a laptop. The application requires sql 2000 database to pull/update records, but since it on laptop the application runs slow when it interacts with database. This is understandable since when laptop is shutdown it flushs all the sql cache from memory. Is there any way that I can load my 100mb database into memory, If so how can it be done.

Any suggestions/inputs would help

Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-28 : 09:19:25
I don't think the slowness is due some caching problem.

Try to:
1. optimize your queries
2.add proper indexes
3.defragment existing indexes if necessary
4.update table statistics

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-03-28 : 14:39:48
besides how would load the database in memory
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-28 : 14:46:09
You can cause a minimum amount of memory to use for an instance database, though via sp_configure. Note that this is for the entire instance and not for a specific database.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

MohammedU
Posting Yak Master

145 Posts

Posted - 2007-03-28 : 14:49:24
You can't load database into memory... In 6.5 days it was possible... not anymore....

Follow the instrunctions of Tkizer...
Change the memory setting min and max to 500 MB to sql and restart your LP...


MohammedU
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-03-28 : 15:30:48
You might get most of the database pages into memory by running some process against at all the tables that accesses all the data for each table:

UPDATE STATISTICS with full scan for each table might work.
or
DBCC DBREINDEX against all tables. This can be done with a maintenance plan.

You would have to do this when you started SQL Server.


CODO ERGO SUM
Go to Top of Page

rlaubert
Yak Posting Veteran

96 Posts

Posted - 2007-03-28 : 16:01:41
No need to change memory allocation unless you have modified it from standard install. By default SQL will request almost all available memory as needed, up to 2 GB of RAM. Anything over 2GB can be accessed with /3GB switch in the startup files. BUT... how much memory is on the laptop to start with, what OS are you using, how many other apps are running? It could be SQL is starved from memory and having to page this will really slow down the responses. If the laptop has limited/low ram then setting the MINIMUM Ram settings should help, but it may cause other issues with the OS and other applications. SQL wants 512 MB of ram all for itself most of the time and alot of older laptop only have 512 to start with.

Raymond Laubert
MCDBA, MCITP:Administration, MCT
Go to Top of Page

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-03-28 : 16:45:01
rlaubert,

I trying to restored 100MB database on 2GB ram laptop which is dual core processor. It is running windows xp.

Am I correct to assume that when the laptop is started initially app will slow due to the database since no sql or data is cached.

Thanks
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-03-28 : 17:54:19
quote:
Originally posted by scelamko

rlaubert,

I trying to restored 100MB database on 2GB ram laptop which is dual core processor. It is running windows xp.

Am I correct to assume that when the laptop is started initially app will slow due to the database since no sql or data is cached.

Thanks



You will not have data in the SQL Server data cache until SQL Server has a reason to put it there. All queries run against data in the data cache, so if is isn't there, SQL Server has to get it from disk to load into the cache first.

As to why the app is slow, well that could be a lot of things. It may be that running on a lower powered platform is just highlighting issues that are being covered up by more powerful hardware. It is always better to have things like well tuned queries and procedures and useful indexes. It can't hurt to spend some time tuning the application.








CODO ERGO SUM
Go to Top of Page
   

- Advertisement -