pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Aaron Werman <awerman@hotmail.com>
Cc: Scott Kirkwood <scottakirkwood@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Caching of Queries
Date: Mon, 27 Sep 2004 15:03:01 +1000
Message-ID: <1096261381.25688.741.camel@localhost.localdomain> (raw)
In-Reply-To: <BAY9-DAV21Y1SWoBDys0000cef5@hotmail.com>
References: <b3dc511704092212502a2ddb09@mail.gmail.com>
	<BAY9-DAV21Y1SWoBDys0000cef5@hotmail.com>

On Thu, 2004-09-23 at 07:43, Aaron Werman wrote:
> MySQL stores a statement with its results. This is optional and when a
> client allows this type of processing, the SQL is hashed and matched to the
> statement - and the stored *result* is returned. The point is that a lot of
> systems do lots of static queries, such as a pick list on a web page - but
> if the data changes the prior result is returned. This (plus a stable jdbc
> driver) was the reason MySQL did well in the eWeek database comparison.

I think the conclusion of past discussions about this feature is that
it's a bad idea. Last I checked, MySQL has to clear the *entire* query
cache when a single DML statement modifying the table in question is
issued. Not to mention that the feature is broken for non-deterministic
queries (like now(), ORDER BY random(), or nextval('some_seq'), and so
on). That makes the feature close to useless for a lot of situations,
albeit not every situation.

-Neil





view thread (72+ messages)  latest in thread

Message-ID: <1096261381.25688.741.camel@localhost.localdomain>
Permalink:  ../1096261381.25688.741.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1096261381.25688.741.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, awerman@hotmail.com, scottakirkwood@gmail.com
  Subject: Re: Caching of Queries
  In-Reply-To: <1096261381.25688.741.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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