Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6LqR-0004Dm-03 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2019 21:00:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6LqP-0001JY-FO for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2019 21:00:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6LqP-0001JQ-3t for pgsql-hackers@lists.postgresql.org; Tue, 19 Mar 2019 21:00:21 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6LqL-0007NU-DB for pgsql-hackers@postgresql.org; Tue, 19 Mar 2019 21:00:19 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id B27F612B1826D for ; Tue, 19 Mar 2019 14:00:15 -0700 (MST) Date: Tue, 19 Mar 2019 14:00:15 -0700 (MST) From: legrand legrand To: pgsql-hackers@postgresql.org Message-ID: <1553029215728-0.post@n3.nabble.com> Subject: [survey] New "Stable" QueryId based on normalized query text 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 Hello, There are many projects that use alternate QueryId distinct from the famous pg_stat_statements jumbling algorithm. https://github.com/postgrespro/aqo query_hash https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Optimize.ViewPlans.html sql_hash https://github.com/ossc-db/pg_hint_plan queryid Even pg_stat_statement has a normalize function, that would answer the current question ... Here are some *needs* : needs.1: stable accross different databases, needs.2: doesn't change after database or object rebuild, needs.3: search_path / schema independant, needs.4: pg version independant (as long as possible), ... and some *normalization rules*: norm.1: case insensitive norm.2: blank reduction norm.3: hash algoritm ? norm.4: CURRENT_DATE, CURRENT_TIME, LOCALTIME, LOCALTIMESTAMP not normalized norm.5: NULL, IS NULL not normalized ? norm.6: booleans t, f, true, false not normalized norm.7: order by 1,2 or group by 1,2 should not be normalized norm.8: pl/pgsql anonymous blocks not normalized norm.9: comments aware Do not hesitate to add your thougths Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html