DBCC PINTABLE - What is actually pinned

  • Hi,

    this is more a learning question than anything else. I have a process in which i am thinking of pinning a small lookup table to memory using the DBCC PINTABLE, the table space details can be viewed below.

    Table Name/Record Count/Reserved/Data/Index Size/Unused

    TBL_00000_SITE_MAPPING10 40 KB8 KB32 KB0 KB

    My question is when the dbcc command pins the table to memory, does it only pin the 8KB of data or does it also pin the 32K of index?

    Thanks

  • Drop all indexes on this table.

    SQL Server uses indexes to find the page with requested data.

    You whole table fits in one page. Any index on this table is just a waste of space.

    _____________
    Code for TallyGenerator

  • Also, not sure why you'd bother pinning it... it will certainly fit in cache.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Almost certainly this will be left in memory if it's queried with any frequency, no need to pin it.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply