public inbox for [email protected]  
help / color / mirror / Atom feed
From: David Rowley <[email protected]>
To: Melanie Plageman <[email protected]>
Cc: Pg Hackers <[email protected]>
Cc: Robert Haas <[email protected]>
Subject: Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on
Date: Tue, 22 Oct 2024 14:32:45 +1300
Message-ID: <CAApHDvqAY6OVVPSRqGkcPExRKutCGzZPbhWm0EkORWGqLBWVxQ@mail.gmail.com> (raw)
In-Reply-To: <CAAKRu_atV=kovgpaLREyG68PB5+ncKvJ2UNoeRetEgyC3Yb5Sw@mail.gmail.com>
References: <CAAKRu_atV=kovgpaLREyG68PB5+ncKvJ2UNoeRetEgyC3Yb5Sw@mail.gmail.com>

On Tue, 22 Oct 2024 at 13:45, Melanie Plageman
<[email protected]> wrote:
> I was surprised today when I saw that with
> enable_indexscan=off
> enable_indexonlyscan=on
> EXPLAIN prints that the index only scan is disabled:
>
>                   QUERY PLAN
> -----------------------------------------------
>  Index Only Scan using history_pkey on history
>    Disabled: true

There's nothing new about Index Only Scans being disabled by
enable_indexscan. Index Only Scan is chosen with your test case as all
possible Paths are disabled and IOS is the cheapest of all Paths.

The PG17 results for your test case are:

                                               QUERY PLAN
---------------------------------------------------------------------------------------------------------
 Index Only Scan using history_pkey on history
(cost=10000000000.29..10000000527.78 rows=19966 width=4)
(1 row)

(note the 1e10 disable_cost has been applied to the Index Only Scan costs)

Robert did propose to change this behaviour while he was working on
the disabled_nodes changes. I did push back on the proposed change
[1]. If you feel strongly that what we have is wrong, then maybe it's
worth opening the discussion about that again.

David

[1] https://www.postgresql.org/message-id/CAApHDvoUUKi0JNv8jtZPfc_JkLs7FqymC5-DDUFNKnm4MMmPuQ%40mail.gma...






view thread (10+ 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]
  Subject: Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on
  In-Reply-To: <CAApHDvqAY6OVVPSRqGkcPExRKutCGzZPbhWm0EkORWGqLBWVxQ@mail.gmail.com>

* 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