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

How to influence the planner



I have a table, t1,  with about 12 million rows
The column foo is unique and indexed
The column bar is not unique and is indexed
"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
My simple solution is "select * into t2 from t1 where length(bar) = 0;"
and "select * from t2 order by foo ;"
Is there a way to make "select * from t1 where length(bar) = 0 order by foo ;"
or something similar work

Thanks
Richard Ray




Home | Main Index | Thread Index

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