Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> writes:
> Or perhaps what if we have a function that quickly determines if the
> attribute has MCV, without loading it? I'd bet the expensive part of
> get_attstatslot() is the deconstruct_array().
> We could have a function that only does the first small loop over slots,
> and returns true/false if we have a slot of the requested stakind.
Yeah, I like this idea.
> It might even check the isunique flag first, to make it more convenient.
That would tie it to this one use-case, which doesn't seem advisable.
I think we should forget the known-unique angle and just do quick
checks to see if both sides have MCVs.
regards, tom lane