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 1w5lkV-003bpD-1F for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 14:31:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5ljU-0037AZ-0C for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 14:30:48 +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 1w5ljT-0037AO-2U for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 14:30:48 +0000 Received: from mail-vk1-xa2f.google.com ([2607:f8b0:4864:20::a2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5ljS-000000019TY-20h5 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 14:30:47 +0000 Received: by mail-vk1-xa2f.google.com with SMTP id 71dfb90a1353d-56b7e5dfd25so1584435e0c.1 for ; Thu, 26 Mar 2026 07:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774535446; x=1775140246; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KOxZacl6KJU/whWdPcmHichrk/JjMgWliJLyUeFTwdc=; b=b6OTz+mx+ovlxG3Jy7AJZfQPNL+Qgn8lZdRXzkLEeGaTIe+XV/KhqV9FkkjZwG8mHW qG/R6X+pM4Ru0ND9Ks3rutoHSP+EfkW/Sc2ow96MhLuT6dtFcW/BWGXlpSnMectzXuvO gK5FUNJnGRapKUZXy4+3gfsqe25pYlzh3kl/MUol2AsK4Bjt8+yHt1zqDOmpLeR0eFpN muICLsstD+h1TQYJe65N0lhSHItxBVqG17ILji7N/OstvWNXzVwOdieAseb8qW9Cp/TH OzFqed+7OSd6/gKBvX+NZlKklbvrgPihMrNad068TdZDOEkH4z4rQzj02HJTB36DuKed x5kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774535446; x=1775140246; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KOxZacl6KJU/whWdPcmHichrk/JjMgWliJLyUeFTwdc=; b=P1BNrTza/eYekMxuGh2fJNNZEH4rYOMNPRcZakt6N5ovvKwN7ETtano5jBZbFLGz6S Wer+E9yDO0/N9C5PiKquL2+BnFM3uJe1JZe+bswzLdpHHf1q+u+429OOzsbygBGG4P1W bPJDwgKDGbk+F3yAiu7SSMt64LZaX9XQSQPk2fM4wEeRDr46LJa6H81EQkpEVEZEknfX 5eyK+LZ9Z1WUCLJITUOAU+6V6/1m54xDe6jdhNK10ay1BuNMfrb4T9Z7SdbeP5CPtT25 PAmii+MurBe6a13H+OWhnQbc0dPwbZ9NK2zJ0BpnHtCub99uzUFpLG8FXRjHHcCpX2BD 5Clg== X-Forwarded-Encrypted: i=1; AJvYcCXg8eKcip5Vu9NEr1bHaYb8cc0KBYHr8X2gnzG72AiOz9tn4wapKNCXwvIQNr71bQ8E5Kr0mWrj+xfQUaZW@lists.postgresql.org X-Gm-Message-State: AOJu0YzShIQjGDVdGzaNcVslCZr3PcQk5QY5a8UfFcxzZgoAyOwG505d k2GwCAGoECKVlKeSqBDi/mLpCybEN6LIs8mOBXl4/MJzHOAs8TlAXpCJ X-Gm-Gg: ATEYQzyVmGuXp/YfztD8xON1Qs88qREba9lSXN6hj96Q+4jOUTPx1HLAAtehREdOAws zdIRIl0toL9pUm8IiJHY7wcnYFQjDRt7uBG9FWmm1/eBoQVz/Mb6R598mQ8MWxcIZYmT8AyfqpI xCAKeexG3d2nusiv1C093yO9PUq1nJy///oMhaFXIal//lp2mnjP9eRzaOMCHt2PvqvBf0UY9lY EDtU7YAs42I7v0371RN8U1xw3l/UNwv8htwY9O//5j9ZZTu4BiYvq2vWFaqoDsl2ylqz5xmdWtK M0m4QvFmMFe7eqMN2f318gjPpeB/AfEhS6kyuKgXKTHy6orsQ/aRLN3c94NjnfsGE4d2MjuEF/k q8NM3zGw2qQmz8AvPqISYTJPP8U4zXpmHI3i4Zop/zUM06GHJSJ0uV3JC7g2wOmLPiHKfqS1Lph kPSit8/KnrLNQy4o8VrxxzUoBlEK136jm3K9LwG6C3VU+YoTKWh8fxDr/O23dU8pJ3BwUtjwZNH XW+ajusY+6eJHjh/HFyy9D0MfIPbhRS X-Received: by 2002:a05:6102:cc8:b0:5ff:ecd0:1d1f with SMTP id ada2fe7eead31-604e4e0d626mr706684137.19.1774535445570; Thu, 26 Mar 2026 07:30:45 -0700 (PDT) Received: from ?IPV6:2804:14d:328a:a59c:b0a3:dcfe:eb55:b7cd? ([2804:14d:328a:a59c:b0a3:dcfe:eb55:b7cd]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-951be1063bbsm3766528241.3.2026.03.26.07.30.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2026 07:30:44 -0700 (PDT) Message-ID: <7f75a4ed-f91b-4a9b-a496-4ea89f54e1de@gmail.com> Date: Thu, 26 Mar 2026 11:30:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_plan_advice To: Robert Haas , Lukas Fittl Cc: Tom Lane , PostgreSQL Hackers References: <1299934.1773938807@sss.pgh.pa.us> Content-Language: en-US From: Matheus Alcantara In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 26/03/26 10:55, Robert Haas wrote: >> I realize not having query texts reduces its effectiveness (since you >> don't see which parameters produced which plan advice), but it still >> helps surface which different advice strings where seen for which >> query IDs, letting you identify if you're getting a mix of bad and >> good plans. And I'm just really worried people will enable this on >> production in shared collection mode and take down their system. > > I fully admit that pg_collect_advice is crude, but I don't think > ripping out some portion of the limited functionality that it has is > going to get us where we want to be. If it hadn't collected the query > strings, it would have been useless for the purpose for which I > originally wrote it. We could add a GUC for a length limit, perhaps, > but I think the real feature that this needs to be used in the way > that you seem to want to use it is deduplication, and as I said > earlier, I think we should consider adding the advice collection logic > to pg_stat_statements rather than building an alternative version of > that module with overlapping functionality. > I also think that we should consider adding the advice string on pg_stat_statements. It seems to make more sense to me IMHO. Adding support for auto_explain to explain(plan_advice, ...) (or any other custom explain option from loadable modules) would help or make sense here? I have been thinking about this for a while. -- Matheus Alcantara EDB: https://www.enterprisedb.com