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 1mFYqV-0007S5-Ql for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Aug 2021 09:23:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mFYqU-0003OV-HE for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Aug 2021 09:23:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFYqU-0003Mt-7o for pgsql-bugs@lists.postgresql.org; Mon, 16 Aug 2021 09:23:50 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFYqR-00066v-IE for pgsql-bugs@lists.postgresql.org; Mon, 16 Aug 2021 09:23:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:To:Sender:From:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1PAYMJYKQbr0hi7By+VOzVAZJ0jP9S7zIc4pxS3qRhM=; b=F5JT6zpR3L9aoX+e80/XJMmwis ttSmaqG9vVuAYeA96BkbdY+J6EeCRSF7xF7sIv/PCycdGsufvj0rofHdc9Ck/0XbjhUjfjQEaaEQV tZfCD9Zj5MXVdYgenksIeKlzo5XJPhS6n9Sq9rnSc176aNp+byPRNuJfy7arPNPu6NjU=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1mFYqP-0002U3-KK; Mon, 16 Aug 2021 11:23:45 +0200 Date: Mon, 16 Aug 2021 11:23:45 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: james.inform@pharmapp.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17146: pg_dump statements are going into pg_stat_statements in 13.4 Message-ID: <20210816092345.GA8258@depesz.com> Reply-To: depesz@depesz.com References: <17146-fd449661169489e5@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <17146-fd449661169489e5@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Aug 15, 2021 at 05:30:52PM +0000, PG Bug reporting form wrote: > I have just updated to 13.4 and I have noticed that "COPY" statements that > are produced by pg_dump appear in pg_stat_statements view. Of course they do. These are statements. > You can imagine that the copy statements are slower than all my other > statements, so they come up as the first and most expensive statements in > pg_stat_statements. > This is a new behaviour in 13.4 and hasn't existed in 13.3 and prior. No, it's not. I just tested to be 100% sure, on 12.6 and pg_dump queries are in pg_stat_statements. Just consider what would you do if excessive dumping was causing problems. You want these to be gone from stats? If you don't care about COPY, then filter it out using WHERE clause. Best regards, depesz