pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Taking the cache out of the equation?
3+ messages / 3 participants
[nested] [flat]

* Taking the cache out of the equation?
@ 2009-06-09 17:51 Rob Sargent <robjsargent@gmail.com>
  2009-06-12 22:12 ` Re: Taking the cache out of the equation? Erik Jones <ejones@engineyard.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Rob Sargent @ 2009-06-09 17:51 UTC (permalink / raw)
  To: pgsql-sql

Caching helps a *lot* and I'm thankful for that but I would like to take 
it out of the picture as I massage my queries for better performance.  
Naturally the first invocation of the query cannot take advantage of the 
cache and these queries would normally only be called once for the same 
target data.    What tricks are there to flush, ignore, circumvent the 
caching boost?  (Especially in the production environment.)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Taking the cache out of the equation?
  2009-06-09 17:51 Taking the cache out of the equation? Rob Sargent <robjsargent@gmail.com>
@ 2009-06-12 22:12 ` Erik Jones <ejones@engineyard.com>
  2009-06-12 22:25   ` Re: Taking the cache out of the equation? Greg Stark <gsstark@mit.edu>
  0 siblings, 1 reply; 3+ messages in thread

From: Erik Jones @ 2009-06-12 22:12 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: pgsql-sql


On Jun 9, 2009, at 10:51 AM, Rob Sargent wrote:

> Caching helps a *lot* and I'm thankful for that but I would like to  
> take it out of the picture as I massage my queries for better  
> performance.  Naturally the first invocation of the query cannot  
> take advantage of the cache and these queries would normally only be  
> called once for the same target data.    What tricks are there to  
> flush, ignore, circumvent the caching boost?  (Especially in the  
> production environment.)

Why on earth would you want your queries to always go to disk?

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k








^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Taking the cache out of the equation?
  2009-06-09 17:51 Taking the cache out of the equation? Rob Sargent <robjsargent@gmail.com>
  2009-06-12 22:12 ` Re: Taking the cache out of the equation? Erik Jones <ejones@engineyard.com>
@ 2009-06-12 22:25   ` Greg Stark <gsstark@mit.edu>
  0 siblings, 0 replies; 3+ messages in thread

From: Greg Stark @ 2009-06-12 22:25 UTC (permalink / raw)
  To: Erik Jones <ejones@engineyard.com>; +Cc: Rob Sargent <robjsargent@gmail.com>; pgsql-sql

On Sat, Jun 13, 2009 at 12:12 AM, Erik Jones<ejones@engineyard.com> wrote:
>
> On Jun 9, 2009, at 10:51 AM, Rob Sargent wrote:
>
>> Caching helps a *lot* and I'm thankful for that but I would like to take
>> it out of the picture as I massage my queries for better performance.
>>  Naturally the first invocation of the query cannot take advantage of the
>> cache and these queries would normally only be called once for the same
>> target data.    What tricks are there to flush, ignore, circumvent the
>> caching boost?  (Especially in the production environment.)
>
> Why on earth would you want your queries to always go to disk?

I think he answered that in the original message -- to better
represent the real workload.

Unfortunately there isn't really a good answer. On Linux you can echo
1 > /proc/sys/vm/drop_caches but that doesn't affect the postgres
shared buffers and worse, it does affect other buffers that probably
would still be cached.

The best answer is usually to build a test configuration large enough
that it has similar cache effects as your production environment. Then
test random values and repeat the test many times to avoid any random
fluctuations.

-- 
greg
http://mit.edu/~gsstark/resume.pdf



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2009-06-12 22:25 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09 17:51 Taking the cache out of the equation? Rob Sargent <robjsargent@gmail.com>
2009-06-12 22:12 ` Erik Jones <ejones@engineyard.com>
2009-06-12 22:25   ` Greg Stark <gsstark@mit.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox