From: Greg Stark <gsstark@mit.edu>
To: Randolf Richardson, DevNet SysOp 29 <rr@8x.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Expressional Indexes
Date: 19 Nov 2003 01:29:20 -0500
Message-ID: <877k1w6fcv.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <Xns9435D8D7BF744rr8xca@200.46.204.72>
References: <7141E2A2-04BE-11D8-81AE-0005029FC1A7@myrealbox.com>
<200310221239.58302.josh@agliodbs.com>
<18349.1066851898@sss.pgh.pa.us>
<200310221322.26013.josh@agliodbs.com>
<Xns9435D8D7BF744rr8xca@200.46.204.72>
"Randolf Richardson, DevNet SysOp 29" <rr@8x.ca> writes:
> For example, if I want to index on a date field but only have the index
> keep track of the most recent 30 days (and then create a secondary index for
> all dates) so as to improve performance on more heavily loaded systems.
>
> Am I understanding this new terminology correctly? Thanks in advance.
No, you could do the above using "partial indexes" but it wouldn't work very
well in this case because the "last 30 days" keeps moving and you would have
to keep redefining the index periodically. It also wouldn't really help
performance.
Expression Indexes are just more powerful "functional indexes". In 7.3 they
could be used for indexing expressions like "lower(foo)". In 7.4 they're more
powerful and you can index expressions other than simple function calls.
They still should be things that always return the same value, which excludes
subqueries.
--
greg
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: gsstark@mit.edu, rr@8x.ca
Subject: Re: Expressional Indexes
In-Reply-To: <877k1w6fcv.fsf@stark.dyndns.tv>
* 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