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.96) (envelope-from ) id 1veYnS-00ErX3-2l for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jan 2026 13:14:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1veYnL-00A8Wn-1a for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jan 2026 13:14:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1veYnL-00A8We-06 for pgsql-hackers@lists.postgresql.org; Sat, 10 Jan 2026 13:14:19 +0000 Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1veYnK-005EnC-07 for pgsql-hackers@postgresql.org; Sat, 10 Jan 2026 13:14:18 +0000 Received: by mail-ua1-x92e.google.com with SMTP id a1e0cc1a2514c-93f5774571eso1683847241.1 for ; Sat, 10 Jan 2026 05:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768050856; x=1768655656; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=tYyWgV6k92HrDd0aRMsDXeNrMApBEVmvRe3ySqnQSsE=; b=Sa2vSMvPY2QYbfkfCsWt/t+Z+nOFU4M6plJKi+QQ7eVLskwBKS9LWb7GqfrMKTewWm f8mqhXYDnBHX55T0gWK/9T+5lvtufn++vyojT5KNcrAtUnP5Oah7+vxqwrSxczN6PYJQ GxX1cjKq/b3Gsh7iTW/kgEpoUr7fS/iBWAlxuSo3o8hh5AssSHA8hFRQVIuQQOHfH8ZR 17jke0oEgRJI2pGvmUVBRpRWJ2kiRKKbcCTcYeFEXjQjetWlTKAtRUMrSrEqjaO8Lm9k KxOiownZvVdnT93rwRk8spf8epcaN+V+mqoSjyotjOA+z2frdH4zcEwfCzFc0LeLSW3N Vq3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768050856; x=1768655656; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tYyWgV6k92HrDd0aRMsDXeNrMApBEVmvRe3ySqnQSsE=; b=B4+fDvfq8WnjwejmWYj890zYad9cKrVCkJ0cllVvofgm7iOFQfukqRK8F3M4ovpM8x tfA2tzZBfrxDFCNSy9PWW2uOYqsm+yjppdl3pWpM+4zB3PD6v+rJMHWqPtSvo80t3YOy 2YVKTD6FdeqWIrUsoGN+D+/vtJcyjxwc6TjbKiMEOfE4gvFs/56EyUjt3YcqsJKnnO3+ T2kEimsvNldFJ3dRaoSlSph+3o7r7GdFEgO0MSwdcsgtCyiZOVMesQJRRFa6Ae18XqdG o5FVyNzSBlGs+R5YvzUUyTN0rceSKmKmGqQzjLq6NXsIRxlZrIZ1kBIPFUSdaRSp6F3r Fcpw== X-Gm-Message-State: AOJu0YyYbKz2Rx3OaDWn6oq3pIkCOPfvZKRiA2e8xTsIDII5Nz8ioOGZ 4X/DcICTH7v8IBzY32svBcv412GXeinSjHBNrMO8PttS/UxTpS+ZK/eiqlXMXeFnEMZdJusiZcP TPxCQvWAfmsHVsjQ9IIZOMblRoRY8ko6wpuqbiUNs+w== X-Gm-Gg: AY/fxX6c25JR8AKDmG45zvt5VtbybF8jjL2LsYO/yp2wAF8z6KhWqxkLngDl2vEN7BI AS0J7dE3a3Zf4itJH5rN/x7wyIfBO1Kd8KyWpxrfWmrhpOfaN7Wuv5BhhPR6nxbgz57otDa0hSy /YsZ+e5zaE40jLIcMpUau1vJlroBXR+sDM4NyKcviUX4fYSYIyBvBQV9JkO39X6LbqKZVUA3BKY smuH5ITrpEjFDGk2Q9cduUltrrtQZsrKeWGb/fW5yHRByKqlFQ84GjpJwkI3vGbWmC1rwgeeBVP qz0Vk535ubcu6MkuJUxRgLhkFy/8v7ScfEbxIP8ISODJFZHGxDRAbYhSN75ZFim6/N3af6T0/db /1i8Po82lUqMGW4lRUcDje4wVDiRQeuRpJOOxTBAo3BT06v13uiXKjRmZCadASqIDzID57vQcWB K5YQzb1vE9HQ== X-Google-Smtp-Source: AGHT+IHILb4qFFG/ehBLctDXfiOXztKK1rckGVPMAiwW7/9CBUpnNWQcfR+6WOPvuPVNHSYVXbczrz0d8eABre96UVc= X-Received: by 2002:a67:e716:0:b0:5db:cc69:73a1 with SMTP id ada2fe7eead31-5ecbae5343cmr5034677137.42.1768050856432; Sat, 10 Jan 2026 05:14:16 -0800 (PST) MIME-Version: 1.0 From: jian he Date: Sat, 10 Jan 2026 21:13:39 +0800 X-Gm-Features: AZwV_QjWUdvx4nfkAQv-SwQmZFQxjBtaWyzCpS2QMVEMtgxx2o7yEaW-v4MAfCA Message-ID: Subject: JumbleQuery ma treat different GROUP BY expr as the same To: PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. drop table if exists t; create table t(a text, b text, c int); SELECT pg_stat_statements_reset() IS NOT NULL AS t; explain(costs off, verbose) select count(*) from t group by a; explain(costs off, verbose) select count(*) from t group by b; explain(costs off, verbose) select count(*) from t group by c; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; calls | rows | query -------+------+------------------------------------------------------------------------------ 0 | 0 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C" 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t 2 | 0 | explain(costs off, verbose) select count(*) from t group by a 2 | 0 | explain(costs off, verbose) select count(*) from t group by a; 1 | 0 | explain(costs off, verbose) select count(*) from t group by c 1 | 0 | explain(costs off, verbose) select count(*) from t group by c; (6 rows) transformSelectStmt->transformGroupClause->transformGroupClauseExpr->addTargetToGroupList will produce the same SortGroupClause node for "group by a" and "group by b". JumbleQuery will jumble Query->groupClause, but RangeTblEntry->groupexprs in Query->rtable is marked with query_jumble_ignore and therefore excluded from jumbling. So "group by a" and "group by" merged into the same entry in pg_stat_statements, Is this what we expected? -- jian https://www.enterprisedb.com/