 |
|
SQL Server Tips by Burleson |
Pinning Tables
While the access times of heavily accessed objects can be improved
by placing them in their own filegroups, assuming separate I/O
controllers exist for distinct hard drives, the best place for
objects to reside will always be memory. With the exception of the
large 64 bit servers, current data volumes prohibit placing all
objects into RAM. However, the DBA should try to keep all or most of
the often-accessed data in memory as the response times will be
better than if their data is constantly re-read from disk.
This is accomplished through pinning a table in memory via the DBCC
PINTABLE command. A table can also be unpinned through the DBCC
UNPINTABLE command. Pinning a table does not toss the pinned object
into memory immediately, but as the table is accessed via standard
queries, SQL Server will move the table’s pages into the buffer
cache as it normally would. It will then mark them as pinned, so
they will not be flushed as with standard pages.
Small, frequently accessed lookup tables are the best targets for
pinning. Large objects should not be considered candidates as their
pages could crowd a buffer cache and disallow other objects an
otherwise easy entrance into the cache.
The above book excerpt is from:
High-Performance SQL Server DBA
Tuning & Optimization Secrets
ISBN:
0-9761573-6-5
Robin Schumacher
http://www.rampant-books.com/book_2005_2_sql_server_dba.htm |