• Tom Lane's avatar
    Improve management of "sticky" entries in contrib/pg_stat_statements. · d5375491
    Tom Lane authored
    This patch addresses a deficiency in the previous pg_stat_statements patch.
    We want to give sticky entries an initial "usage" factor high enough that
    they probably will stick around until their query is completed.  However,
    if the query never completes (eg it gets an error during execution), the
    entry shouldn't persist indefinitely.  Manage this by starting out with
    a usage setting equal to the (approximate) median usage value within the
    whole hashtable, but decaying the value much more aggressively than we
    do for normal entries.
    
    Peter Geoghegan
    d5375491
pg_stat_statements.c 57.6 KB