From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brent Verner <brent@rcfile.org>
Cc: Marc G. Fournier <scrappy@hub.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: INDEXng date_trunc ...
Date: Thu, 22 Nov 2001 12:29:02 -0500
Message-ID: <1433.1006450142@sss.pgh.pa.us> (raw)
In-Reply-To: <20011122102905.A34094@rcfile.org>
References: <20011122094048.T64011-100000@earth.hub.org>
<20011122102905.A34094@rcfile.org>
Brent Verner <brent@rcfile.org> writes:
> ... I'm curious
> why we can't take a constant as an argument to an indexed function...
It's a representational limitation in pg_index: what's stored is a
function OID and a list of column numbers that are its arguments.
There's noplace to put any constant arguments.
I've been toying with the notion of replacing "functional indexes"
with "expressional indexes", wherein the value to be indexed is
computed by any SQL expression (probably refusing subselects and
aggregates though; the restrictions would be the same as for CHECK
constraint expressions). Other than breaking nigh everything that
looks at pg_index, this seems doable enough, and much more efficient
than writing SQL-language helper functions to accomplish the result.
(SQL-language functions work, but the call overhead is depressing.)
Haven't got round to it yet though ...
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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, brent@rcfile.org, scrappy@hub.org
Subject: Re: INDEXng date_trunc ...
In-Reply-To: <1433.1006450142@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