Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Jun-27, Julien Rouhaud wrote:
>> On Thu, Jun 27, 2019 at 8:14 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>>> I think it would look nicer to have a routine parallel to brinGetStats()
>>> (brinGetStatsHypothetical?), instead of polluting selfuncs.c with these
>>> gory details.
>> I'm not opposed to it, but I used the same approach as a similar fix
>> for gincostestimate() (see 7fb008c5ee5).
> How many #define lines did you have to add to selfuncs there?
FWIW, the proposed patch doesn't seem to me like it adds much more
BRIN-specific knowledge to brincostestimate than is there already.
I think a more useful response to your modularity concern would be
to move all the [indextype]costestimate functions out of the common
selfuncs.c file and into per-AM files. I fooled around with that
while trying to refactor selfuncs.c back in February, but I didn't
come up with something that seemed clearly better. Still, as we
move into a world with external index AMs, I think we're going to
have to make that happen eventually.
regards, tom lane