From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Mr Pink <mr_pink_is_the_only_pro@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why does a simple query not use an obvious index?
Date: Mon, 30 Aug 2004 17:00:00 -0400
Message-ID: <11438.1093899600@sss.pgh.pa.us> (raw)
In-Reply-To: <87ekloidls.fsf@stark.xeocode.com>
References: <20040830073841.30957.qmail@web41108.mail.yahoo.com>
<87ekloidls.fsf@stark.xeocode.com>
Greg Stark <gsstark@mit.edu> writes:
> However I have the complementary reaction. I find peeking at the first
> bind parameter to be scary as hell. Functions seem slightly less scary.
FWIW, we only do it in the context of unnamed parameterized queries.
As the protocol docs say, those are optimized on the assumption that
they will be executed only once. It seems entirely legitimate to me
to use the parameter values in such a case.
We might in future get braver about using sample parameter values,
but 8.0 is conservative about it.
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, gsstark@mit.edu, mr_pink_is_the_only_pro@yahoo.com
Subject: Re: Why does a simple query not use an obvious index?
In-Reply-To: <11438.1093899600@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