| От | Tom Lane |
|---|---|
| Тема | Re: Query planning question |
| Дата | |
| Msg-id | 834.1242054368@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Query planning question ("John Lister" <john.lister-ps@kickstone.com>) |
| Список | pgsql-sql |
"John Lister" <john.lister-ps@kickstone.com> writes:
> Am I right in assuming the planner thinks a sequential scan is quicker than 10k index hits, would tweaking the costs
fixthis or would i be better updating the stats for the product_id and manufacturer_id fields?
AFAICT the planner did exactly the right things here. Your first
example is fetching 40 times as many rows from retailer_offer as
the second one is. If the planner had stuck with the nestloop plan,
it would've taken about 40x as long, and been significantly slower
than the hash join.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера