Re: Optimizing queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimizing queries
Дата
Msg-id 13030.1155069749@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Optimizing queries  (Patrice Beliveau <pbeliveau@avior.ca>)
Ответы Re: Optimizing queries
Re: Optimizing queries
Список pgsql-performance
Patrice Beliveau <pbeliveau@avior.ca> writes:
>>> SELECT * FROM TABLE
>>> WHERE TABLE.COLUMN1=something
>>> AND TABLE.COLUMN2=somethingelse
>>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0;

> I find out that the function process every row even if the row should be
> rejected as per the first or the second condition.
> ... I'm using version 8.1.3

PG 8.1 will not reorder WHERE clauses for a single table unless it has
some specific reason to do so (and AFAICT no version back to 7.0 or so
has done so either...)  So there's something you are not telling us that
is relevant.  Let's see the exact table schema (psql \d output is good),
the exact query, and EXPLAIN output for that query.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Patrice Beliveau
Дата:
Сообщение: Re: Optimizing queries
Следующее
От: Kenji Morishige
Дата:
Сообщение: most bang for buck with ~ $20,000