Re: Issue in _bt_getrootheight

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Issue in _bt_getrootheight
Дата
Msg-id 971650.1689961316@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Issue in _bt_getrootheight  (Gurjeet Singh <gurjeet@singh.im>)
Ответы Re: Issue in _bt_getrootheight  (Gurjeet Singh <gurjeet@singh.im>)
Список pgsql-hackers
Gurjeet Singh <gurjeet@singh.im> writes:
> Please see attached the patch that does this. Let me know if this patch helps.

I don't like this patch one bit, because it adds a lot of overhead
(i.e., an extra index_open/close cycle for every btree index in every
query) to support a tiny minority use-case.  How come we don't
already know whether the index is hypothetical at the point where
_bt_getrootheight is called now?

Actually, looking at the existing comment at the call site:

    /*
     * Allow a plugin to editorialize on the info we obtained from the
     * catalogs.  Actions might include altering the assumed relation size,
     * removing an index, or adding a hypothetical index to the indexlist.
     */
    if (get_relation_info_hook)
        (*get_relation_info_hook) (root, relationObjectId, inhparent, rel);

reminds me that the design intention was that hypothetical indexes
would get added to the list by get_relation_info_hook itself.
If that's not how the index adviser is operating, maybe we need
to have a discussion about that.

            regards, tom lane



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

Предыдущее
От: "Tristan Partin"
Дата:
Сообщение: Re: Use COPY for populating all pgbench tables
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: MERGE ... RETURNING