Re: join removal

Поиск
Список
Период
Сортировка
От Lawrence, Ramon
Тема Re: join removal
Дата
Msg-id 6EEA43D22289484890D119821101B1DF05191043@exchange20.mercury.ad.ubc.ca
обсуждение исходный текст
Ответ на Re: join removal  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
> I took at a first crack at coding up an implementation of
> relation_is_distinct_for() tonight.

I am not sure if this will help or not, but on the 8.4 code base we
implemented two functions:

- getCandidateKeys() - would recursively traverse a tree from a given
node to the leaf nodes and determine the candidate keys for the
intermediate relation produced by that node

- getJoinCard() - determined the join cardinality of a hash join node
(1:1, 1:N, etc.) based on the candidate keys of the two input relations

It worked pretty well for our tests with equi-joins, but I am sure it is
missing many cases.  I have attached the code which we used
(cardinalityFuncs.c).  Some of the helper functions may also be useful
(convertUniqueIndexesToCandidateKeys, getJoinAttrs).

--
Ramon Lawrence


Вложения

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Alpha releases: How to tag
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Shipping documentation untarred