Josh Berkus <josh@agliodbs.com> writes: >> I've never fully understood the distinction the stats make between >> "tuples fetched" and "tuples returned", and it's even less obvious how >> to apply it when the index and heap operations are decoupled.
> Well, it's mainly a counter to measure how many dead rows are in your active > data set. You may think that's what it is, but given where the counts are actually placed in the code, it does no such thing. AFAICS there is no count of dead tuples at all in the seqscan case, and in the indexscan case the only counter that advances before the snapshot test is pgstat_count_index_scan, which isn't counting tuples so much as amgetnext calls, and is documented in a way that suggests it does something completely different :-( regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings