pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Isabelle Brette <isabelle@apartia.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: indexes
Date: Wed, 6 Feb 2002 07:29:56 -0800 (PST)
Message-ID: <20020206072840.L16466-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <20020205170524.GA1990@aparima.com>


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.




view thread (22+ messages)  latest in thread

Message-ID: <20020206072840.L16466-100000@megazone23.bigpanda.com>
Permalink:  ../20020206072840.L16466-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020206072840.L16466-100000@megazone23.bigpanda.com

 · 

reply

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: sszabo@megazone23.bigpanda.com, isabelle@apartia.fr
  Subject: Re: indexes
  In-Reply-To: <20020206072840.L16466-100000@megazone23.bigpanda.com>

* 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