| От | Richard Huxton |
|---|---|
| Тема | Planner matching constants across tables in a join |
| Дата | |
| Msg-id | 200303051113.14320.dev@archonet.com обсуждение исходный текст |
| Ответы |
Re: Planner matching constants across tables in a join
|
| Список | pgsql-performance |
I know this has been covered on one of the lists in the past, but I'm damned if I can find the keywords to locate it. If I join two tables with a comparison to a constant on one, why can't the planner see that the comparison applies to both tables: SELECT a.id FROM a JOIN b ON a.id=b.id WHERE a.id=1; runs much slower than SELECT a.id FROM a JOIN b ON a.id=b.id WHERE a.id=1 AND b.id=1; It's not a real problem since it's easy to work around, but I was wondering what the difficulties are for the planner in seeing that query 1 is the same as query 2. Note that it doesn't seem related to JOIN forcing the planner's hand, the same applies just using WHERE a.id=b.id -- Richard Huxton
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера