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 1kkSO9-0003rY-4E for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 13:41:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkSO7-0006Gh-Kj for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 13:41:43 +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 1kkSO7-0006Fu-DO for pgsql-hackers@lists.postgresql.org; Wed, 02 Dec 2020 13:41:43 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkSO2-0002a9-Tf for pgsql-hackers@postgresql.org; Wed, 02 Dec 2020 13:41:42 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 1042223242584 for ; Wed, 2 Dec 2020 06:41:36 -0700 (MST) Date: Wed, 2 Dec 2020 06:41:36 -0700 (MST) From: legrand legrand To: pgsql-hackers@postgresql.org Message-ID: <1606916496022-0.post@n3.nabble.com> In-Reply-To: <20201202082402.GB51769@nol> References: <20201202040516.GA43757@nol> <20201202063241.GA51769@nol> <20201202082402.GB51769@nol> Subject: Re: pg_stat_statements oddity with track = all MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, a crazy idea: - add a parent_statement_id column that would be NULL for top level queries - build statement_id for nested queries based on the merge of: a/ current_statement_id and parent one or b/ current_statement_id and nested level. this would offer the ability to track counters at any depth level ;o) Regards PAscal -- Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html