From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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: Sun, 29 Aug 2004 22:23:56 -0400
Message-ID: <18966.1093832636@sss.pgh.pa.us> (raw)
In-Reply-To: <20040830020954.3596.qmail@web41110.mail.yahoo.com>
References: <20040830020954.3596.qmail@web41110.mail.yahoo.com>
Mr Pink <mr_pink_is_the_only_pro@yahoo.com> writes:
>>> AFAIK postgres doesn't peek at values used in a query when optimizing
>>
>> Of course it does.
> But not ones returned by a function such as now(), or when you use
> bind variables, as Tom aptly explained.
FWIW, 8.0 does have the ability to use the values of bind variables for
planning estimation (Oliver Jowett did the work for this). The main
issue in the way of dealing with now() is that whatever we did to now()
would apply to all functions marked "stable", and it's a bit
nervous-making to assume that they should all be treated this way.
Or we could introduce more function volatility categories, but that's
not much fun either.
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, mr_pink_is_the_only_pro@yahoo.com
Subject: Re: Why does a simple query not use an obvious index?
In-Reply-To: <18966.1093832636@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