Re: Expressional Indexes

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Randolf Richardson, DevNet SysOp 29" <rr(at)8x(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Expressional Indexes
Date: 2003-11-19 06:29:20
Message-ID: 877k1w6fcv.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql


"Randolf Richardson, DevNet SysOp 29" <rr(at)8x(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Miia Leino 2003-11-19 06:48:04 SQL statement is too long
Previous Message Matthew Wilson 2003-11-18 20:08:56 best way to setup postgres as backend for webapp?

Browse pgsql-sql by date

  From Date Subject
Next Message Randolf Richardson, DevNet SysOp 29 2003-11-19 06:54:43 Re: Expressional Indexes
Previous Message Merrall, Graeme 2003-11-19 04:24:25 Re: SOLVED: Emulating 'connect by prior' using stored proc