Re: On disable_cost

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Peter Geoghegan <pg(at)bowt(dot)ie>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: On disable_cost
Date: 2024-07-02 17:40:38
Message-ID: 3114837.1719942038@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Jul 2, 2024 at 10:57 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> I fear this will break people's applications, if they are currently
>> forcing a sequential scan with "set enable_indexscan=off". Now they will
>> need to do "set enable_indexscan=off; set enable_indexonlyscan=off" for
>> the same effect. Maybe it's acceptable, disabling sequential scans to
>> force an index scan is much more common than the other way round.

> But I don't think one can have a GUC called enable_indexscan and
> another GUC called enable_indexonlyscan and argue that it's OK for the
> former one to affect both kinds of scans. That's extremely confusing
> and, well, just plain wrong.

FWIW, I disagree completely. I think it's entirely natural to
consider bitmap index scans to be a subset of index scans, so that
enable_indexscan should affect both. I admit that the current set
of GUCs doesn't let you force a bitmap scan over a plain one, but
I can't recall many people complaining about that. I don't follow
the argument that this definition is somehow unmaintainable, either.

>> Could we cram it into the "cost=... rows=..." part? And perhaps a marker
>> that a node was disabled would be more user friendly than showing the
>> cumulative count? Something like:

> The problem is that we'd have to derive that.

The other problem is it'd break an awful lot of client code that knows
the format of those lines. (Sure, by now all such code should have
been rewritten to look at JSON or other more machine-friendly output
formats ... but since we haven't even done that in our own regression
tests, we should know better than to assume other people have done it.)

I'm not really convinced that we need to show anything about this.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-07-02 17:50:13 Re: What is a typical precision of gettimeofday()?
Previous Message Ranier Vilela 2024-07-02 17:39:20 Assorted style changes with a tiny improvement