Re: performance inconsistency

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: performance inconsistency
Дата
Msg-id 12879.986424421@sss.pgh.pa.us
обсуждение исходный текст
Ответ на performance inconsistency  (Phuong Ma <pma@commandprompt.com>)
Список pgsql-sql
Phuong Ma <pma@commandprompt.com> writes:
> WHERE substr("ORDER_NUM", 1, 1) != 'W'; # (Orders NOT prefixed with W.)

> OR...

> WHERE substr("ORDER_NUM", 1, 1) = 'I';  # (Orders prefixed with I.)

> However, the first query runs in about 10-15 seconds, and the second
> query
> ran for over 40 minutes before I cancelled it.

What query plans does EXPLAIN show for each case?  (And have you done
VACUUM ANALYZE lately?)

The change in the WHERE clause may be altering the planner's selectivity
guesstimates enough to cause choice of a less appropriate plan.  Hard to
tell without seeing what EXPLAIN has to say, though.

            regards, tom lane

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

Предыдущее
От: Edipo Elder Fernandes de Melo
Дата:
Сообщение: Re: Memory and performance
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Need to do an ALTER TABLE.