• Tom Lane's avatar
    Save a few cycles while creating "sticky" entries in pg_stat_statements. · e969f9a7
    Tom Lane authored
    There's no need to sit there and increment the stats when we know all the
    increments would be zero anyway.  The actual additions might not be very
    expensive, but skipping acquisition of the spinlock seems like a good
    thing.  Pushing the logic about initialization of the usage count down into
    entry_alloc() allows us to do that while making the code actually simpler,
    not more complex.  Expansion on a suggestion by Peter Geoghegan.
    e969f9a7
pg_stat_statements.c 57.4 KB