How to influence the planner - Mailing list pgsql-sql

From Richard Ray
Subject How to influence the planner
Date
Msg-id Pine.LNX.4.64.0708311116000.17749@rray.drdc.mstc.ms.gov
Whole thread Raw
Responses Re: How to influence the planner
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Chris Browne
Date:
Subject: Re: Incomprehensible dogged sort in Merge Join
Next
From: Michael Glaesemann
Date:
Subject: Re: How to influence the planner