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 1tx5kt-002kw3-RN for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 14:59:51 +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 1tx5ks-005YBQ-3C for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 14:59:50 +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.94.2) (envelope-from ) id 1tx5kr-005YBI-Pz for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 14:59:49 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tx5kq-0013r7-0U for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 14:59:48 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-30bee1cb370so59323061fa.1 for ; Tue, 25 Mar 2025 07:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742914786; x=1743519586; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oU1eFwtR8oBhpWL3oftDsq9gXSyV6+ni3ZDDgD+ytMw=; b=DBTml97yKEWg3I69tLAg+hD8ca8UYSunpbo8yTgSthMHg/qkBwmkDi+dVjRF6iulwr BVrEKOP6aI8g4vMycDPEVzi5W8fk7AsaXYmrn0WSAZ45pM1qQ82NzMt40Ga5Iu/93j4B C0pWEVVbwKpFwwtzsj+RJmz1gc82MfZYbpt9YAbzOrWzJZuZMk4PgRZX99f40eGQr5yw 5Y6bNjN8lYmK+ZyUfPhjQd3Dxj7Hu6AiGHmQG+rwbLrx65A4rbG+6ySPDd+CDLDAT15U Pj61cKLHrN8MIOASphniBBz1CY9wxrpRPAZQF1KL5KemXHrWJCj9Tqxk5fydPyZb2J0K m3PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742914786; x=1743519586; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oU1eFwtR8oBhpWL3oftDsq9gXSyV6+ni3ZDDgD+ytMw=; b=vwt1mVmFxlJGtMQ6mBOXnho2tX1V/RwBTw9am1hVKZ1nC8m5EusXLglH0b6TfYJHC7 0ImPSGyrdrn9gJE2upOd20ikKoxa9VuPaOB+ciu2rfVFCG7BHVGSixx2ohfaJ0ve7HOE 33Co8thc1GyYC7iHZDacxRBwM0PJ7V7yQCfY2xWjUtTxzIm1pcGkOx8Z95YVMkUVaBd+ azcREa99hL5eVE1/YsA0TsplHI2tSZG0VJV6YzE7JiJv9ZMvh+sEJHrtwxGWmwtF2GR7 +jRw9fz1KKSD/6DylCqdPm/7VKDqJlk7Q4lx3TGyKTkvtpw1X8Ei5Ezbq7+ITrXDQdWQ RUxQ== X-Forwarded-Encrypted: i=1; AJvYcCW91WJ+wsXK4IwxlfwWgvAyzqJ0oHHnEGy5iUwGO0GlQKO0F16nwPFynptRmhMuGYMPKxRBrg+n8+F+UJK8@lists.postgresql.org X-Gm-Message-State: AOJu0Yw5QuK17Yi0GvScHjuK7CFmVO0coBstbdPCONMcCF6ZYp3iUHvd ndaaXRbTuVTyRnvibXZEoJJXJI4j97VlQVsTn03t+ruvoOgb0Wmz37OW4cOvsADXIvmtDuIk+wD sHeSVP6pnL6soqEEs2/w7Tm32//g= X-Gm-Gg: ASbGncvt4b/WXh6ePS5YcdaV4w1qjy9co+aUfbRFhDKk30AE8zPheDU1jCuSkvhjWtu 3m2cQlYTdK1EG2PPq06uVsBgziztw8vJn+nDGIad7dLR6B79AyGagTMHANL0P5sPBH4x9j8SmGs 4YqjtBlwlEwSoDbkEkAukUPRLA X-Google-Smtp-Source: AGHT+IEDsJkLFO+QHtvKETXUsl47xyiLChbuimhFSiN1W80lcD8i9i0/S/ioxdP6kNoJcrOdCMSgHm4PreQVq4SWm78= X-Received: by 2002:a05:651c:198b:b0:300:2a29:d47c with SMTP id 38308e7fff4ca-30d7e2a21b3mr68658981fa.24.1742914786048; Tue, 25 Mar 2025 07:59:46 -0700 (PDT) MIME-Version: 1.0 References: <1831838.1742656359@sss.pgh.pa.us> <80506.1742660683@sss.pgh.pa.us> <461405.1742691859@sss.pgh.pa.us> <1189112.1742869660@sss.pgh.pa.us> In-Reply-To: From: Sami Imseih Date: Tue, 25 Mar 2025 09:59:34 -0500 X-Gm-Features: AQ5f1JpbfL9zp9UkD1Q77DnsQJpjYtD9SkoXShco30fLAm1yy755WKLedk3d8-4 Message-ID: Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX To: Lukas Fittl Cc: Michael Paquier , Tom Lane , Christoph Berg , PostgreSQL Hackers , ma lz Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > In my experience these often not work well with pg_stat_statements today because > of their own bloat problem, just like with temp tables. You quickly have way too many > unique entries, and your query text file accumulates a lot of duplicative entries > (since the same query text gets repeated in the text file, since its queryid is different), > to the point that you can't monitor your workload at all anymore. That is true in terms of pg_stat_statements, and I have seen users have to increase pg_stat_statements.max to something much higher to avoid the bloat and constant deallocs/GC. But, besides pg_stat_statements, queryId is used to group queries for database load monitoring ( pg_stat_activity sampling). As of now, different schemas are tracked separately, but with this change they will be merged. This may come as a surprise to use-cases that rely on the existing behavior. But I do agree that pg_s_s bloat is a big pain point, so this change should be positive overall. Let's see if there are enough complaints to force us to reconsider. -- Sami Imseih Amazon Web Services (AwS)