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 1iiGZN-0003UK-B1 for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 11:35:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiGZK-0003xq-Ps for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 11:35:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiGZK-0003xj-DT for pgsql-hackers@lists.postgresql.org; Fri, 20 Dec 2019 11:35:42 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iiGZH-0008CU-N6 for pgsql-hackers@lists.postgresql.org; Fri, 20 Dec 2019 11:35:41 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 4C58421C4CB5; Fri, 20 Dec 2019 14:35:38 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.223] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 074F921C4CB4; Fri, 20 Dec 2019 14:35:37 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1576841738; bh=liivsz9FlDMBRTruM7epoIEjW+p2ffSrhcOW1C7ZtOs=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=AXBOMuHw2YNQjakzH46NFNaUdV5c1A529CMMnJG9IbCNPjGVAhN7r67JrYcjAe+Gs ejVBTQ0x191+xi9vd/7XAzKjk4pV1QOKrjih8WeSvaFfLFKq6OdsAAqDPg8NGs/RTL nmVN4x8LPKwdPRSXArLYd7COm+uGSQjsgof2h60Q= Subject: Re: [PATCH] Increase the maximum value track_activity_query_size To: Robert Haas , Tom Lane Cc: Bruce Momjian , v.makarov@postgrespro.ru, PostgreSQL Hackers References: <7b5ecc5a9991045e2f13c84e3047541d@postgrespro.ru> <20191219154110.GL30116@momjian.us> <556.1576771167@sss.pgh.pa.us> From: Alexey Kondratov Message-ID: <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru> Date: Fri, 20 Dec 2019 14:35:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 19.12.2019 20:52, Robert Haas wrote: > On Thu, Dec 19, 2019 at 10:59 AM Tom Lane wrote: >> Bruce Momjian writes: >>> Good question. I am in favor of allowing a larger value if no one >>> objects. I don't think adding the min/max is helpful. >> >> The original poster. And probably anyone else, who debugs stuck queries of yet another crazy ORM. Yes, one could use log_min_duration_statement, but having a possibility to directly get it from pg_stat_activity without eyeballing the logs is nice. Also, IIRC log_min_duration_statement applies only to completed statements. > I think there are pretty obvious performance and memory-consumption > penalties to very large track_activity_query_size values. Who exactly > are we really helping if we let them set it to huge values? > > (wanders away wondering if we have suitable integer-overflow checks > in relevant code paths...) The value of pgstat_track_activity_query_size is in bytes, so setting it to any value below INT_MAX seems to be safe from that perspective. However, being multiplied by NumBackendStatSlots its reasonable value should be far below INT_MAX (~2 GB). Sincerely, It does not look for me like something badly needed, but still. We already have hundreds of GUCs and it is easy for a user to build a sub-optimal configuration, so does this overprotection make sense? Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company