Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKgET-00BaGc-GS for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2024 15:31:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sKgER-003N9K-R0 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2024 15:31:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKgER-003N7K-Gs for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2024 15:31:19 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sKgEP-002qbe-9c for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2024 15:31:19 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id B19B22F00083; Sat, 22 Jun 2024 00:31:09 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.3]) by sranhm.sraoss.co.jp (Postfix) with SMTP id 975923415F1; Sat, 22 Jun 2024 00:31:09 +0900 (JST) Date: Sat, 22 Jun 2024 00:31:09 +0900 From: Yugo NAGATA To: Cc: , Subject: Re: Improve EXPLAIN output for multicolumn B-Tree Index Message-Id: <20240622003109.6a4db3d72cd296cc3a89c4c9@sraoss.co.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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: Archived-At: Precedence: bulk On Fri, 21 Jun 2024 07:12:25 +0000 wrote: > * Is this feature useful? Is there a possibility it will be accepted? I think adding such information to EXPLAIN outputs is useful because it will help users confirm the effect of a multicolumn index on a certain query and decide to whether leave, drop, or recreate the index, and so on. > * Are there any other ideas for determining if multicolumn indexes are > > being used efficiently? Although I considered calculating the efficiency using > > pg_statio_all_indexes.idx_blks_read and pg_stat_all_indexes.idx_tup_read, > > I believe improving the EXPLAIN output is better because it can be output > > per query and it's more user-friendly. It seems for me improving EXPLAIN is a natural way to show information on query optimization like index scans. > * Is "Index Bound Cond" the proper term?I also considered changing > > "Index Cond" to only show quals for the boundary condition and adding > > a new term "Index Filter". "Index Bound Cond" seems not intuitive for me because I could not find description explaining what this means from the documentation. I like "Index Filter" that implies the index has to be scanned. > * Would it be better to add new interfaces to Index AM? Is there any case > > to output the EXPLAIN for each index context? At least, I think it's worth > > considering whether it's good for amcostestimate() to modify the > > IndexPath directly as the PoC patch does. I am not sure it is the best way to modify IndexPath in amcostestimate(), but I don't have better ideas for now. Regards, Yugo Nagata > > > > > Regards, > > -- > > Masahiro Ikeda > > NTT DATA CORPORATION > > -- Yugo NAGATA