Re: Fix gin index cost estimation - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Fix gin index cost estimation
Date
Msg-id CAPpHfdtFYZjv41djYjNcJUuZhDKUu9eJSthKmmDWE-azAZjn5g@mail.gmail.com
Whole thread Raw
In response to Re: Fix gin index cost estimation  (Ronan Dunklau <ronan.dunklau@aiven.io>)
Responses Re: Fix gin index cost estimation
List pgsql-hackers
Hi, Ronan!

On Fri, Dec 2, 2022 at 1:19 PM Ronan Dunklau <ronan.dunklau@aiven.io> wrote:
> Sorry for the delay, but here is an updated patch which changes the costing in
> the following way:
>
> - add a descent cost similar to the btree one is charged for the initial
> entry-tree
> - additionally, a charge is applied per page in both the entry tree and
> posting trees / lists
> - instead of charging the quals to each tuple, charge them per entry only. We
> still charge cpu_index_tuple_cost per tuple though.
>
> With those changes, no need to tweak the magic number formula estimating the
> number of pages. Maybe we can come up with something better for estimating
> those later on ?

Thank you for your patch.  Couple of quick questions.
1) What magic number 50.0 stands for?  I think we at least should make
it a macro.
2) "We only charge one data page for the startup cost" – should this
be dependent on number of search entries?

------
Regards,
Alexander Korotkov



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Avoid streaming the transaction which are skipped (in corner cases)
Next
From: Amit Kapila
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply