Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: How to influence the planner




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





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group