Re: Index on two columns not used

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index on two columns not used
Дата
Msg-id 28276.1161192717@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Index on two columns not used  (Arnaud Lesauvage <thewild@freesurf.fr>)
Ответы Re: Index on two columns not used  (Arnaud Lesauvage <thewild@freesurf.fr>)
Список pgsql-performance
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 ...

            regards, tom lane

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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: Hints proposal
Следующее
От: Arnaud Lesauvage
Дата:
Сообщение: Re: Index on two columns not used