Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Posts
    24

    Unanswered: How to cache SQL query results

    Is there anything equivalent in Microsoft SQL Server like SQL_CACHE in
    Mysql.

    I know tha Sql server driver will cache the results is there anyway i can specify in the query.

    Thanks in advance
    Kiran
    Last edited by kirandarisi; 01-15-09 at 14:55.

  2. #2
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    Buffer cache is used automatically in SQL Server. You don't need to do anything special to take advantage of it.

  3. #3
    Join Date
    Dec 2008
    Posts
    24
    thanks for your reply.

    Is there anyway i can add something to increase the performance as the table i am querying will not be updated result set will be the same all the time.

    Kiran

  4. #4
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    How about an index? Have you taken a look at the execution plan to see what indexes may be helpful? If you aren't familiar with analysing query plans yourself then you can try the Database Tuning Advisor (tools menu in Management Studio).

  5. #5
    Join Date
    Dec 2002
    Posts
    1,245
    look at indexes first. depending on the size of the table, it might be a candidate for pinning it in memory. Look at DBCC PINTABLE in SQL BOL.

    Regards,

    hmscott
    Have you hugged your backup today?

  6. #6
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    Quote Originally Posted by hmscott
    Look at DBCC PINTABLE in SQL BOL.
    Don't bother. PINTABLE is deprecated and does nothing in SQL Server 2000/2005/2008. The statement will appear to execute purely for backwards compatibility reasons but it has absolutely no effect.

  7. #7
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by dportas
    Don't bother. PINTABLE is deprecated and does nothing in SQL Server 2000/2005/2008. The statement will appear to execute purely for backwards compatibility reasons but it has absolutely no effect.
    D'oh...if I had read the MS documentation a little more closely, I would have seen that. I've never used it myself.

    Regards,

    hmscott
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •