in reply to System V shared Memory Perl Module (more of a C question than Perl) aka Efficient SQL result caching

If you are using Oracle, the results are already cached in the database's SGA.

Could you be more specific about your environment. OS? DB? Also, post the SQL query if you can. Optimization of SQL is the biggest factor in tuning, along with correct indexing and memory usage.

  • Comment on Re: System V shared Memory Perl Module (more of a C question than Perl) aka Efficient SQL result caching

Replies are listed 'Best First'.
Re: Re: System V shared Memory Perl Module (more of a C question than Perl) aka Efficient SQL result caching
by tachyon (Chancellor) on Apr 03, 2003 at 07:44 UTC

    OS is Redhat 7.3. DB is MySQL because it has the fastest SELECT speed of any DB (so they say). Happy to use any DB - speed is the issue not rigid data integrity/rollbacks or finance per se. Berkeley won't work due to single reader/writer or multi reader config. Server has 2GB ram dual processors and all the RAID tweaks to minimize seek time. MySQL/OS compile tweaks to get around its ~800 query limit in stock form. Typical query is:

    SELECT integer from client_X WHERE key IN ( ?,?,?,? ) ORDER BY key DES +C

    Primary key is key. IN grouping 1 min, 10 max, average 3 typical 2-4.

    Peak query rate can potentially exceed 10,000 per second. Base code all copes fine. DB not so happy at high loads.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      I have the same sort of problem with an overloaded db doing queries where the results only change 5-10 times a day.

      I was thinking of only triggering my select queries when the cgi that updates the data is used. So my script would run off a static file and the file would only get updated when the data changed.

      You think I can use these memory module instead to get rid of the static file and store my results in memory.

      I'm in Mysql Apache as well and I am pretty sure that mysql has a query cache.