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 1iimGK-0000NR-CO for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Dec 2019 21:26:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iimFL-0004bV-0W for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Dec 2019 21:25:11 +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 1iimFK-0004bN-O5 for pgsql-hackers@lists.postgresql.org; Sat, 21 Dec 2019 21:25:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iimFI-0002R4-IP for pgsql-hackers@lists.postgresql.org; Sat, 21 Dec 2019 21:25:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBLLP5dJ025275; Sat, 21 Dec 2019 16:25:05 -0500 From: Tom Lane To: Nikolay Samokhvalov cc: Michael Paquier , Bruce Momjian , Alexey Kondratov , Robert Haas , v.makarov@postgrespro.ru, PostgreSQL Hackers Subject: Re: [PATCH] Increase the maximum value track_activity_query_size In-reply-to: References: <7b5ecc5a9991045e2f13c84e3047541d@postgrespro.ru> <20191219154110.GL30116@momjian.us> <556.1576771167@sss.pgh.pa.us> <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru> <20191220135704.GC29807@momjian.us> <20191221024757.GF15758@paquier.xyz> Comments: In-reply-to Nikolay Samokhvalov message dated "Sat, 21 Dec 2019 12:45:05 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <25273.1576963505.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 21 Dec 2019 16:25:05 -0500 Message-ID: <25274.1576963505@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Nikolay Samokhvalov writes: > Here is what ORMs do: > select length('SELECT "column_name_1001", "column_name_1002", > "column_name_1003", "column_name_1004", "column_name_1005", > "column_name_1006", "column_name_1007", "column_name_1008", > "column_name_1009", "column_name_1010", "column_name_1011", > "column_name_1012", "column_name_1013", "column_name_1014", > "column_name_1015", "column_name_1016", "column_name_1017", > "column_name_1018", "column_name_1019", "column_name_1020", > "column_name_1021", "column_name_1022", "column_name_1023", > "column_name_1024", "column_name_1025", "column_name_1026", > "column_name_1027", "column_name_1028", "column_name_1029", > "column_name_1030", "column_name_1031", "column_name_1032", > "column_name_1033", "column_name_1034", "column_name_1035", > "column_name_1036", "column_name_1037", "column_name_1038", > "column_name_1039", "column_name_1040", "column_name_1041", > "column_name_1042", "column_name_1043", "column_name_1044", > "column_name_1045", "column_name_1046", "column_name_1047", > "column_name_1048", "column_name_1049", "column_name_1050" FROM > "some_table";'); > length > -------- > 1024 > (1 row) > That's it – with default settings, you won't see WHERE clause or > anything else. If that's true, it doesn't offer much of a case for upping the limit on track_activity_query_size. The longest such a query could reasonably get is somewhere near NAMEDATALEN times MaxHeapAttributeNumber, which as it happens is exactly the existing limit on track_activity_query_size. > As a result, many queries exceed track_activity_query_size How? And if they are, why do you care? Such queries sure seem pretty content-free. > What is the overhead here except the memory consumption? The time to copy those strings out of shared storage, any time you query pg_stat_activity. regards, tom lane