Re: Another optimizer question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Another optimizer question
Дата
Msg-id 5258.979853409@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Another optimizer question  ("Gordan Bobic" <gordan@freeuk.com>)
Список pgsql-general
"Gordan Bobic" <gordan@freeuk.com> writes:
> SELECT * FROM Table1 INNER JOIN Table2 ON (Table1.Field1 = Table2.Field1)
> WHERE Table1.Field1 = 'SomeValue';
> [ is slow, but this is fast: ]
> SELECT * FROM Table1 INNER JOIN Table2 ON (Table1.Field1 = Table2.Field1)
> WHERE Table1.Field1 = 'SomeValue' AND Table2.Field1 = 'SomeValue';

You're correct, we do not deduce the latter from the former, and so the
first example does not realize that it could use a constrained indexscan
over Table2.

Maybe we should try to do this, but I suspect we'd waste more cycles
trying than we'd make back on the queries where it helps.

            regards, tom lane

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