| От | Arnaud Lesauvage |
|---|---|
| Тема | Re: Index on two columns not used |
| Дата | |
| Msg-id | 4536698B.7010001@freesurf.fr обсуждение исходный текст |
| Ответ на | Re: Index on two columns not used (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-performance |
Tom Lane a écrit : > Arnaud Lesauvage <thewild@freesurf.fr> writes: >> When I join these two tables, the 2-column index of the first table is >> not used. >> Why does the query planner think that this plan is better ? > > Hm, is gid by itself nearly unique in these tables? If so, the merge > join would get only marginally more efficient by using both columns as > merge conditions. Heikki's probably right to guess that the planner > thinks it's better to use the smaller index. > > However, if there are lots of duplicate gids, then it ought to have > preferred the two-column merge ... gid is the primary key of the first table, so absolutely unique. Thanks for the information Tom ! -- Arnaud
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера