Re: A minor adjustment to get_cheapest_path_for_pathkeys - Mailing list pgsql-hackers

From Robert Haas
Subject Re: A minor adjustment to get_cheapest_path_for_pathkeys
Date
Msg-id CA+TgmoZJ0a_Dcn+ST4YSeSrLnnmajmcsi7ZvEpgkKNiF0SwBuw@mail.gmail.com
Whole thread Raw
In response to Re: A minor adjustment to get_cheapest_path_for_pathkeys  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: A minor adjustment to get_cheapest_path_for_pathkeys
List pgsql-hackers
On Tue, Sep 5, 2023 at 12:05 PM Aleksander Alekseev
<aleksander@timescale.com> wrote:
> Now when we continue reviewing the patch, could you please elaborate a
> bit on why you think it's worth committing?

Well, why not? The test he's proposing to move earlier doesn't involve
calling a function, so it should be cheaper than the one he's moving
it past, which does.

I mean, I don't know whether the savings are going to be measurable on
a benchmark, but I guess I don't particularly see why it matters. Why
write a function that says "this thing is cheaper so we test it first"
and then perform a cheaper test afterwards? That's just silly. We can
either change the comment to say "we do this first for no reason even
though it would be more sensible to do the cheap test first" or we can
reorder the tests to match the principle set forth in the existing
comment.

I mean, unless there's some reason why it *isn't* cheaper. In that
case we should have a different conversation...

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PATCH: document for regression test forgets libpq test
Next
From: Alvaro Herrera
Date:
Subject: Re: information_schema and not-null constraints