Re: PATCH: use foreign keys to improve join estimates v1
В списке pgsql-hackers по дате отправления:
| От | Tomas Vondra |
|---|---|
| Тема | Re: PATCH: use foreign keys to improve join estimates v1 |
| Дата | |
| Msg-id | 28573c08-1338-e314-dd2e-3894325bf598@2ndquadrant.com обсуждение |
| Ответ на | Re: PATCH: use foreign keys to improve join estimates v1 (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>) |
| Ответы |
Re: PATCH: use foreign keys to improve join estimates v1
|
| Список | pgsql-hackers |
Hi, attached is the patch split into two parts, as proposed by Simon. 0001 just adds the stuff to relcache, 0002 actually uses it for estimation. On 04/04/2016 12:03 PM, Amit Langote wrote: > 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. I think you're right. I've copied the logic for indexes, but clearly for foreign keys we don't need this flag. I've removed it. > > Also, it seems the patch forgot to update RelationDestroyRelation(). Right. Fixed. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера