From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joel Jacobson <joel@gluefinance.com>
Cc: Pierre C <lists@peufeu.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: plpgsql plan cache
Date: Mon, 22 Feb 2010 16:20:58 -0500
Message-ID: <1801.1266873658@sss.pgh.pa.us> (raw)
In-Reply-To: <8AD3F6B6-BCCF-46E1-B255-9EB8E761653B@gluefinance.com>
References: <38E2265E-B38E-4EBD-BB87-23B46EF4FD1C@gluefinance.com>
<op.u8jnpjikeorkce@localhost>
<8AD3F6B6-BCCF-46E1-B255-9EB8E761653B@gluefinance.com>
Joel Jacobson <joel@gluefinance.com> writes:
> Hm, it is strange the query planner is using two different strategies
> for the same query?
They're not the same query. One plan is generic for any value of the
parameters, the other is chosen for specific values of those parameters.
In particular, the unparameterized query depends very strongly on the
knowledge that not many rows will meet the RecordDate range constraint.
If you picked dates that were further apart you'd probably get something
that looked more like the other plan.
regards, tom lane
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: tgl@sss.pgh.pa.us, joel@gluefinance.com, lists@peufeu.com
Subject: Re: plpgsql plan cache
In-Reply-To: <1801.1266873658@sss.pgh.pa.us>
* 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