How to influence the planner

Поиск
Список
Период
Сортировка
От Richard Ray
Тема How to influence the planner
Дата
Msg-id Pine.LNX.4.64.0708311116000.17749@rray.drdc.mstc.ms.gov
обсуждение исходный текст
Ответы Re: How to influence the planner  (Michael Glaesemann <grzm@seespotcode.net>)
Список 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 по дате отправления:

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: Incomprehensible dogged sort in Merge Join
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: How to influence the planner