Re: PATCH: use foreign keys to improve join estimates v1

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: PATCH: use foreign keys to improve join estimates v1
Дата
Msg-id 57023BF5.4010109@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: PATCH: use foreign keys to improve join estimates v1  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: PATCH: use foreign keys to improve join estimates v1  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
On 2016/04/04 17:25, Simon Riggs wrote:
> The rel cache code you're adding uses a flag called "rd_fkeyvalid" which
> indicates that the relcache is correctly filled. That is confusing, since
> it has nothing to do with the concept of constraint validity. We should
> rename that to rd_fkeycachefilled or similar.

Maybe I'm missing something, but is a separate bool required at all in
this case?  Wouldn't simply doing the following suffice?
   /* Quick exit if we already computed the list. */   if (relation->rd_fkeylist)       return
list_copy(relation->rd_fkeylist);

ISTM, rd_fkeyvalid is modeled on rd_indexvalid, where the latter serves to
convey more info than simply whether the index list is valid or not, so
the extra field is justified.

Also, it seems the patch forgot to update RelationDestroyRelation().

Thanks,
Amit





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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Timeline following for logical slots
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: Optimization for updating foreign tables in Postgres FDW