Re: An Idea for planner hints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: An Idea for planner hints
Дата
Msg-id 14860.1155090146@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: An Idea for planner hints  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> My main problem is that selectivity is the wrong measurement. What
> users really want to be able to communicate is:

> 1. If you join tables a and b on x, the number of resulting rows will be
> the number of roows selected from b (since b.x id a foreign key
> referencing a.x).

FWIW, I believe the planner already gets that case right, because a.x
will be unique and it should know that.  (Maybe not if the FK is across
a multi-column key, but in principle it should get it right.)

I agree though that meta-knowledge like this is important, and that
standard SQL frequently doesn't provide any adequate way to declare it.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Casts
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: 8.2 features status