Joe Conway <mail@joeconway.com> writes:
> On 5/21/19 3:55 PM, Tom Lane wrote:
>> Are you suggesting that we should set stawidth to zero even for a
>> fixed-width datatype? That seems pretty silly. We know exactly what
>> the value should be, and would be if we'd chanced to find even one
>> non-null entry.
> Well you could argue in similar fashion for variable width values -- if
> we find even one of those, it will be at least 4 bytes. So why set those
> to zero?
Um, really the minimum width is 1 byte, given short headers. But as
the code notes, zero means we don't know what a sane estimate would
be, which is certainly not the case for fixed-width types.
regards, tom lane