Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkcXJ-0003Zx-SW for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Oct 2015 18:36:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZkcXJ-0000p6-4b for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Oct 2015 18:36:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZkcVz-0007V3-4o for pgsql-hackers@postgresql.org; Fri, 09 Oct 2015 18:35:35 +0000 Received: from mail-bn1bon0072.outbound.protection.outlook.com ([157.56.111.72] helo=na01-bn1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZkcVv-0007Lx-Nt for pgsql-hackers@postgresql.org; Fri, 09 Oct 2015 18:35:33 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jim.Nasby@bluetreble.com; Received: from decina.local (70.113.16.71) by BY2PR11MB0678.namprd11.prod.outlook.com (10.163.111.20) with Microsoft SMTP Server (TLS) id 15.1.286.20; Fri, 9 Oct 2015 18:35:27 +0000 Subject: Re: Less than ideal error reporting in pg_stat_statements To: Tom Lane , Alvaro Herrera References: <5601D354.5000703@BlueTreble.com> <15898.1442965225@sss.pgh.pa.us> <56030E72.9070104@BlueTreble.com> <30112.1444058156@sss.pgh.pa.us> <561296EC.805@dunslane.net> <20151005154032.GF8531@alvherre.pgsql> <31122.1444060230@sss.pgh.pa.us> CC: Andrew Dunstan , Peter Geoghegan , Pg Hackers From: Jim Nasby Message-ID: <561808E9.5030502@BlueTreble.com> Date: Fri, 9 Oct 2015 13:35:21 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <31122.1444060230@sss.pgh.pa.us> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [70.113.16.71] X-ClientProxiedBy: CY1PR21CA0018.namprd21.prod.outlook.com (25.161.247.28) To BY2PR11MB0678.namprd11.prod.outlook.com (25.163.111.20) X-Microsoft-Exchange-Diagnostics: 1; BY2PR11MB0678; 2:MkNzbG8BfTCYRe/cMTDbCPTUKyswwyxxzu9vQijct+SRGA0QGA3EysRiYKOKvMWOir1LD8ZvdxG2KyB2TtpbWtS/EEi7MsVXDNL1UfemX+gRZJKMbYKDqYq26lUXzr+c19mV1Tbz6rPTL1fLRsAw46wsz8GPtjklwvdpuLxy4VY=; 3:4YDB4VeP/Y+5c1192fQskvYpmDLGEPTVf+GbY+g/x54syMu1o9IPb/O2wi3ajr1zDDYcRvSYukyD9EPWx7z4rO9JyxQUEvZHIOyPrRP2lmdUIRG4nRYQnNx/MkfcYnEdr/OOBCFZePNZf1G5bmgZug==; 25:7zjUNH7aLuHT+7VJkhPlVC8C+IQ2Maxcys7KUyWfzWM6zFWoucssfA1mTQsLVde1ENkbdX8X5RmAtnmGTfKz8+7WLKu8lGdTgO02u+3VK3ZUV+rS9tybzqumY90aN1EhOnFxifRvVKBlhTR/TQlGGigULw4D1k8OVHkbnfFtStQTZziL9Bq1+6JDS9Wcti0m4pno224nb20GKRKPvx2SoBMa6VbWBVv7lfkf90fZXrq2R3egeqKFcDPLz7iSv1o64JNKFSfffJfG+tzcCOKVJA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR11MB0678; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001); SRVR:BY2PR11MB0678; BCL:0; PCL:0; RULEID:; SRVR:BY2PR11MB0678; X-Microsoft-Exchange-Diagnostics: 1; BY2PR11MB0678; 4:cEkK8OeH9babvn5ty1LdyX3DqxbT8vXZsBrVn5a+ydo6lmf00uqVjmRNZPGqn9swOZ19q384ih7m3cRy3ejGI0jT09rwN0kD16o7cJmhV4XOAPv2K9ScqsGbxkf0rb39WlTR3VEnWyXEfrRb9y7ytzeq1LZVY4VzjYm4IdbsnkobdEDzVxLDgVL0FsQehD9nldZAXzFmKYFACF7v5/WqDdGOLX5XMqOQwNddOC4XrQtkaoaRRGXR2v5fYsBlMDM87r9CqxTRtsrUtvSh8a9WrUkQdeDjMM4CmIps06104k1uxjt9M5MObqpThwVP4BAgyfm3cGcmkFlGS5lHZ+kFzfdoABDr947Rnp5/K3kyMxI= X-Forefront-PRVS: 0724FCD4CD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(479174004)(24454002)(199003)(377454003)(5008740100001)(46102003)(64126003)(106356001)(4001350100001)(5007970100001)(5001960100002)(65956001)(66066001)(64706001)(93886004)(105586002)(81156007)(65806001)(47776003)(97736004)(86362001)(189998001)(15975445007)(77096005)(5004730100002)(36756003)(5001770100001)(122386002)(99136001)(101416001)(65816999)(54356999)(76176999)(87266999)(2950100001)(23746002)(19580395003)(80316001)(42186005)(40100003)(59896002)(87976001)(92566002)(50986999)(50466002)(19580405001)(551934003)(33656002)(83506001)(85282002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR11MB0678; H:decina.local; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: bluetreble.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR11MB0678; 23:69yYE74qn0/x1rzcHqxdLjIGIzdJmjwQLYZ8f?= =?Windows-1252?Q?0g/3HmLVteqVtP6HGeb8urNRuFlxhCAMOg3cuy8uvhPYne+K8rUeFonD?= =?Windows-1252?Q?hIncIjfHYsji0fxKpFEkZyRZzxM4NRvcfci5zYddQT3sHH04wOAwzeBf?= =?Windows-1252?Q?9dDLrVvx/mR7GwxOHvuirkkpoYiLxE+Y0v8p55ePpaXxqgrDmWJA2CUZ?= =?Windows-1252?Q?vzEFFkd9SziPXE4xxg5kykQXduUndsAvK5lWJyRNzFcgGjlcyNGqxERP?= =?Windows-1252?Q?akLUEt5I0xTT7LY/Jc7km35jYuJX3EAqfivpg+fuYtUGdRt55VZU4X5z?= =?Windows-1252?Q?EZu/wqk1nyL1rf6HQkaz5h4gxbffsSigzVh6XBY7o72cDPqTVgAKBLAN?= =?Windows-1252?Q?W53SPogHvFHlRuV8cjoQzrq6O15ZzYPfxTB1AlJhTrnD052k7qAYcrd1?= =?Windows-1252?Q?yE8wjf/2Dxj4Bfy4VUyUfyjTog6JfiyNvAUaXqxwOJwgJH4+VOYZIcHb?= =?Windows-1252?Q?mjoavqzgOQ9l47B+iSGz8lUgG0zBsFHM310fCK3zdHxuPGiLNccwsms8?= =?Windows-1252?Q?4nN1QGkE/Kp4ntEyGen9CiDgV+w+0kDtd7A1LRbXOQsT3ULDzomkGcu2?= =?Windows-1252?Q?z1m465wbPaj1Wc+89CiDGzEiEzmbItLtioN+XBWE2VRlvYnEOY60o8S9?= =?Windows-1252?Q?UUtvYis1hiOORJR7sJNXoVpq/UvrkacC7LfaVKbN3tLc57Ih3RC1WxD2?= =?Windows-1252?Q?S5721g01mGVoxRILWXCuhJD+u7nUIzvnp+eYMN67BKBx3GL8sYgbn02C?= =?Windows-1252?Q?uVtRckZqBZXLhdaAW5iMVrgFTraARY4PaGJBFnFMBF4fAvbCWUgQjjzN?= =?Windows-1252?Q?wBJBJ1eHBs0PsHhq71q5gXlpYURYV3TQfEREcvibdjNCK99QvgUf42bu?= =?Windows-1252?Q?xKe54pqr4Eye8JLgLUCdqMlKTopUmP1UywotfrYUJDQvwJqBq17RsevH?= =?Windows-1252?Q?NtvrQtW930395G531ox8wiZOkFVrJBe86Gv3hKYT3JoCY0aiUb00cHax?= =?Windows-1252?Q?jgSQ5uWRtbWwvuEYv7i3eaEQPErq9lYHqPd5crdhtZm+LXjb+QAcFCV/?= =?Windows-1252?Q?3VWGH+TwhSCQhqWTwoTthD+GuHhzj1neyVBQGSanGdy5bZBmfMmMTjpo?= =?Windows-1252?Q?aok6qXfJcQzdFW9LNgZF0LcLXWdHJID5Gg+RdHoTGALnZJbH0CgNyoj7?= =?Windows-1252?Q?g2ClmXfdm1dgPkDCXsL+sjPNqjSJG9hxhonT2X4TZszKwVGpikdsLx/F?= =?Windows-1252?Q?7oT1tuCJff7uCprnQWp/Ng4NHwHl3hJBj3+AvtFNHqy9VSxxBAvVfDPH?= =?Windows-1252?Q?PUry96kbIoVXXe/FZ8UwR4t8aY3X9vy+Akk1VZovs5WRBWX4jmGzkO9H?= =?Windows-1252?Q?LwFWg6j0DCN/pfNeAeSo6CKBKWaaqlUYXIYDdTaANByVdmSPxuQF+VbH?= =?Windows-1252?Q?npLh0k0CxOLKOYJ/9usCrZw/OJHDvDeSPYswnpc0StmSaJZ3Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR11MB0678; 5:Y6BucZ/sJjfKX5zhrFZmRvtSptgaE+FE0ZDUvupLjQDqhHFq5a5mDWZkER/rnjrK+F7HrYHcVY1ubPUN1+OwcLSXl1nBMOtLkLxVZa9M5IOv0TZ1b3X7B2CLH1aM/O4BQ7xz0Ewwa+uBBPNcyfU0tQ==; 24:MgFBuos1obPM04j80D87wGDx2qskmTWzxKRvktkPSMYgqLWogtTo2yBEIdDF8BNvtZQPtZ6AcqFvnC8BHrMAuzx4UyeZ3jzyJVFCez9Ag9A=; 20:Jz8XRJHvsNK17bVdpJ1P3Q1rIkFYp1gUp2ySDkyFtSCD7yYux49GvSWFXPVPnsLNq2L/Y10mlj9Fv0TG+mmzgw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2015 18:35:27.1267 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR11MB0678 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 10/5/15 10:50 AM, Tom Lane wrote: > Alvaro Herrera writes: >> Andrew Dunstan wrote: >>> FWIW, (a) and (b) but not (c) is probably the right description for my >>> client who has been seeing problems here. > >> I think the fact that long IN lists are fingerprinted differently >> according to the number of elements in the list makes the scenario >> rather very likely -- not particularly narrow. > > That's certainly something worth looking at, but I think it's probably > more complicated than that. If you just write "WHERE x IN (1,2,3,4)", > that gets folded to a ScalarArrayOp with a single array constant, which > the existing code would deal with just fine. We need to identify > situations where that's not the case but yet we shouldn't distinguish. > > In any case, that's just a marginal tweak for one class of query. > I suspect the right fix for the core problem is the one Peter mentioned > in passing earlier, namely make it possible to do garbage collection > without having to slurp the entire file into memory at once. It'd be > slower, without a doubt, but we could continue to use the existing code > path unless the file gets really large. To address what Peter raised up-thread, according to my client the process that was doing this was generating 10,000 inserts per transaction and sending them all as a single statement. They tried cutting it to 1000 inserts and it still had the problem. Each overall command string could have been megabytes in size. Perhaps it's not worth supporting that, but if that's the decision then there needs to at least be better error reporting around this. I'll try to test Tom's patch next week to see what affect it has on this. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers