Re: indexes - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: indexes
Date
Msg-id 20020206072840.L16466-100000@megazone23.bigpanda.com
Whole thread Raw
In response to indexes  (Isabelle Brette <isabelle@apartia.fr>)
List pgsql-sql
On Tue, 5 Feb 2002, Isabelle Brette wrote:

> As you may also guess, making straight indexes does not work (I still
> have this damn Seq Scan while EXPLAINing). For the date, I tried this :
>
>     create index sess_created on sessions (to_char(created,'YYYY/MM'));
>
> but I get a parse error near "'". What do I have wrong, as the query
> seems right ? Is it because of the non-column argument ?

For a functional index that you want to pass constants to, right now you'd
need to make a cacheable function that takes created in this case and
returns the to_char(created, 'YYYY/MM') and then use that in the index and
query.



pgsql-sql by date:

Previous
From: Isabelle Brette
Date:
Subject: Re: indexes
Next
From: Evil Azrael
Date:
Subject: Query with Parameters