Hi, Ronan! On Wed, Oct 12, 2022 at 10:15 AM Ronan Dunklau <ronan.dunk...@aiven.io> wrote: > > > You're right, I was too eager to try to raise the CPU cost proportionnally > to > > > the number of array scans (scalararrayop). I'd really like to understand > where > > > this equation comes from though... > > > > So, what's the latest update here? > > Thanks Michael for reviving this thread. > > Before proceeding any further with this, I'd like to understand where we > stand. Tom argued my way of charging cost per entry pages visited boils down > to charging per tuple, which I expressed disagreement with. > > If we can come to a consensus whether that's a bogus way of thinking about it > I'll proceed with what we agree on.
I briefly read the thread. I think this line is copy-paste from other index access methods and trying to estimate the whole index scan CPU cost by bypassing all the details. *indexTotalCost += (numTuples * *indexSelectivity) * (cpu_index_tuple_cost + qual_op_cost); I think Tom's point was that it's wrong to add a separate entry-tree CPU cost estimation to another estimation, which tries (very inadequately) to estimate the whole scan cost. Instead, I propose writing better estimations for both entry-tree CPU cost and data-trees CPU cost and replacing existing CPU estimation altogether. ------ Regards, Alexander Korotkov