Re: Expressional Indexes - Mailing list pgsql-sql

From Greg Stark
Subject Re: Expressional Indexes
Date
Msg-id 877k1w6fcv.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: Expressional Indexes  ("Randolf Richardson, DevNet SysOp 29" <rr@8x.ca>)
List pgsql-sql
"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



pgsql-sql by date:

Previous
From: "Merrall, Graeme"
Date:
Subject: Re: SOLVED: Emulating 'connect by prior' using stored proc
Next
From: Achilleus Mantzios
Date:
Subject: Re: Array fields in Postgresql...