From: Scott Kirkwood <scottakirkwood@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Caching of Queries
Date: Wed, 22 Sep 2004 16:50:26 -0300
Message-ID: <b3dc511704092212502a2ddb09@mail.gmail.com> (raw)
I couldn't find anything in the docs or in the mailing list on this,
but it is something that Oracle appears to do as does MySQL.
The idea, I believe, is to do a quick (hash) string lookup of the
query and if it's exactly the same as another query that has been done
recently to re-use the old parse tree.
It should save the time of doing the parsing of the SQL and looking up
the object in the system tables.
It should probably go through the planner again because values passed
as parameters may have changed. Although, for extra points it could
look at the previous query plan as a hint.
On the surface it looks like an easy enhancement, but what do I know?
I suppose it would benefit mostly those programs that use a lot of
PQexecParams() with simple queries where a greater percentage of the
time is spent parsing the SQL rather than building the execute plan.
What do you think?
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: scottakirkwood@gmail.com
Subject: Re: Caching of Queries
In-Reply-To: <b3dc511704092212502a2ddb09@mail.gmail.com>
* 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