Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> This sounds good until you think about locking. It'd be quite
>> impractical to implement anything as fine-grained as EXPLAIN ANALYZE
>> this way, because of the overhead involved in taking and releasing
>> spinlocks.
> I'm not entirely convinced. The only other process that would be looking at
> the information would be the statistics accumulator which would only be waking
> up every 100ms or so. There would be no contention with other backends
> reporting their info.
The numbers I've been looking at lately say that heavy lock traffic is
expensive, particularly on SMP machines, even with zero contention.
Seems the cache coherency protocol costs a lot even when it's not doing
anything...
regards, tom lane