Re: How to influence the planner - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: How to influence the planner
Date
Msg-id 373D2F52-E9CD-485A-9BF1-B019349FA5EC@seespotcode.net
Whole thread Raw
In response to How to influence the planner  (Richard Ray <rray@mstc.state.ms.us>)
Responses Re: How to influence the planner  (Richard Ray <rray@mstc.state.ms.us>)
List 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




pgsql-sql by date:

Previous
From: Richard Ray
Date:
Subject: How to influence the planner
Next
From: Richard Ray
Date:
Subject: Re: How to influence the planner