Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKzuJ-0007oQ-QJ for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Sep 2020 08:13:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kKzuI-0005bX-Lb for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Sep 2020 08:13:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKzuI-0005bQ-FB for pgsql-hackers@lists.postgresql.org; Wed, 23 Sep 2020 08:13:42 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKzuF-0005ZF-Sl for pgsql-hackers@postgresql.org; Wed, 23 Sep 2020 08:13:41 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id 67EA1622D4; Wed, 23 Sep 2020 17:13:36 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 Sep 2020 17:13:36 +0900 From: Katsuragi Yuta To: legrand legrand Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH] Add features to pg_stat_statements In-Reply-To: <1600500942767-0.post@n3.nabble.com> References: <0d9f1107772cf5c3f954e985464c7298@oss.nttdata.com> <1600500942767-0.post@n3.nabble.com> Message-ID: <16a262a87492b4f4afc4c5010f8fa631@oss.nttdata.com> X-Sender: btkatsuragiyu@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-09-19 16:35, legrand legrand wrote: > +1 ! > > An other way is to log evictions, it provides informations about time > and > amount : > > for (i = 0; i < nvictims; i++) > { > hash_search(pgssp_hash, &entries[i]->key, HASH_REMOVE, NULL); > } > > pfree(entries); > > /* trace when evicting entries, if appening too often this can slow > queries > ... > * increasing pg_stat_sql_plans.max value could help */ > ereport(LOG, > (errmsg("pg_stat_sql_plans evicting %d entries", nvictims), > errhidecontext(true), errhidestmt(true))); > > > > -- > Sent from: > https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html Thank you for your comments! In addition to providing a view that is like a summary of history, logging might be a good choice. Regards, Katsuragi Yuta