SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL query cache: Should I cache small, simple queries or only complex ones?

    Query cache works great for long, complex queries, but should I also be caching the simplest of select queries.

    For example let's say I had a table with 100 records and I needed to select something using a unique key:
    Code:
    SELECT name FROM products WHERE id = 3
    Is caching the above pointless, especially in terms of wasted cache memory, considering how basic it is?

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    yes, query cache can speed up even queries such as that. sure, the margins will be smaller, but you should benchmark it yourself to find out if it helps your application.


Bookmarks

Posting Permissions

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