public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Gurjeet Singh <[email protected]>
Cc: Ahmed Ibrahim <[email protected]>
Cc: [email protected]
Subject: Re: Issue in _bt_getrootheight
Date: Fri, 21 Jul 2023 13:41:56 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CABwTF4XSREc4f-OxMXWnO=d3RPud+ntibPNS0rhvYinxMSv0sg@mail.gmail.com>
References: <CAHiW8txjW0qHjeTEwNLGKuLgOPkNXF2TE-sozjSMeeD7uTm77A@mail.gmail.com>
	<CABwTF4XSREc4f-OxMXWnO=d3RPud+ntibPNS0rhvYinxMSv0sg@mail.gmail.com>

Gurjeet Singh <[email protected]> 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






view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Issue in _bt_getrootheight
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox