| От | Tom Lane |
|---|---|
| Тема | Re: optimizing a view-driven query |
| Дата | |
| Msg-id | 20360.985822298@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | optimizing a view-driven query (will trillich <will@serensoft.com>) |
| Список | pgsql-general |
will trillich <will@serensoft.com> writes:
> select topic from course where course like '%comput%' ;
> -- not asking for state, we don't need to join the state table
But you still do need to join, because the join affects which rows
will be returned. The fact that you don't happen to use any values
out of one of the joined tables in your SELECT list is not very
relevant.
In this example, you might happen to know (or think you know) that there
will be one and only one state row matching any possible row from the
subjoin of the other tables, so in the end it wouldn't affect the number
of rows output. This is not an assumption the planner is prepared to
make, however.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера