Re: How to influence the planner

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Richard Ray <rray(at)mstc(dot)state(dot)ms(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to influence the planner
Date: 2007-08-31 19:18:36
Message-ID: 373D2F52-E9CD-485A-9BF1-B019349FA5EC@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Aug 31, 2007, at 13:32 , Richard Ray wrote:

> "select * from t1 where length(bar) = 0;" runs about 2 minutes
> "select * from t1 where length(bar) = 0 order by foo ;" ran until I
> stopped it after about 20 minutes

EXPLAIN ANALYZE will help you see what the planner is doing to
produce the results. Have you recently ANALYZEd t1? If length(bar) =
0 is a common operation on this table, you might consider using an
expression index on t1:

create index t1_length_bar_idx on t1 (length(bar));

You might want to ask on the performance list as well, as this is
right up their alley.

Hope this gets you started on the right track.

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Ray 2007-08-31 21:07:17 Re: How to influence the planner
Previous Message Richard Ray 2007-08-31 18:32:17 How to influence the planner