From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | Isabelle Brette <isabelle(at)apartia(dot)fr> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: indexes |
Date: | 2002-02-06 15:29:56 |
Message-ID: | 20020206072840.L16466-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Evil Azrael | 2002-02-06 16:53:23 | Query with Parameters |
Previous Message | Isabelle Brette | 2002-02-06 09:50:20 | Re: indexes |