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