Magnus Hagander <magnus(at)hagander(dot)net> writes:
> I've noticed that pg_stat_all_tables returns NULL for idx_scan and
> idx_tup_fetch if there are no indexes present on a table.
> Is this actually intended, or is that something that should be fixed?
Hmm. I suspect it's an implementation artifact rather than something
that was consciously chosen, but on reflection it doesn't seem like a
bad thing. If we just COALESCE'd it to zero (which I assume is what
you have in mind) then there would be no distinction in the view
between "you have no indexes" and "there are indexes but they aren't
being used".
I'd vote to leave it alone, I think.
regards, tom lane