Re: sql indexing suggestions needed

From: "Angva" <angvaw(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: sql indexing suggestions needed
Date: 2007-03-20 22:33:22
Message-ID: 1174430002.064990.261360@y66g2000hsf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 20, 2:54 pm, postg(dot)(dot)(dot)(at)2xlp(dot)com (Jonathan Vanasco) wrote:
> can anyone suggest an indexing approach that might get pg to use the
> indexes ? this is driving me crazy.

Have you tried an expression-based index?
http://www.postgresql.org/docs/8.1/interactive/indexes-expressional.html

I'm assuming the right side of each equals sign is constant for you.
Basically, you could create an expression-based index on all these
conditions, which would evaluate to true or false for every row in
your table.

Caveat: If you have heavy updates/inserts this might be a bad idea.
Also, the planner may still decide to seq scan, based on your
configuration and resultset size.

Mark

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arthur Hoogervorst 2007-03-20 22:40:24 Re: Postgresql to Delphi
Previous Message Joshua D. Drake 2007-03-20 22:22:00 Re: Lifecycle of PostgreSQL releases