> Interested to hear comments on this.
I don't have chance to test it right now, but I am sure it would be an improvement over what we have right now. There is no single correct equation with so many unknowns we have. > *indexTotalCost += (numTuples * *indexSelectivity) * (cpu_index_tuple_cost + qual_op_cost); Have you preserved this line intentionally? This would make BRIN index scan cost even higher, but the primary property of BRIN is to be cheap to scan. Shouldn't bitmap heap scan node take into account of checking the tuples in its cost?