Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UY2TW-0004iO-2M for pgsql-performance@arkaria.postgresql.org; Thu, 02 May 2013 22:59:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UY2TV-000207-JJ for pgsql-performance@arkaria.postgresql.org; Thu, 02 May 2013 22:59:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UY2TU-0001yz-Ps for pgsql-performance@postgresql.org; Thu, 02 May 2013 22:59:40 +0000 Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UY2TP-00046W-99 for pgsql-performance@postgresql.org; Thu, 02 May 2013 22:59:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 14D1267944; Fri, 3 May 2013 10:59:32 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gy1JSAUN5TSI; Fri, 3 May 2013 10:59:31 +1200 (NZST) Received: from mail.catalyst.net.nz (unknown [IPv6:::1]) by mail.catalyst.net.nz (Postfix) with ESMTP id EF6B532F38; Fri, 3 May 2013 10:59:30 +1200 (NZST) Received: from 202.49.200.143 (SquirrelMail authenticated user mark.kirkwood@catalyst.net.nz) by mail.catalyst.net.nz with HTTP; Fri, 3 May 2013 10:59:31 +1200 Message-ID: <9d1267f54ba06afd4624ac8dae787222.squirrel@mail.catalyst.net.nz> In-Reply-To: References: <5179E77B.7050601@catalyst.net.nz> <5179ECC5.2010206@archidevsys.co.nz> <5179F259.3010509@catalyst.net.nz> <5179F5C6.8070702@archidevsys.co.nz> <5180E3C8.3010201@catalyst.net.nz> <2121.1367417215@sss.pgh.pa.us> <5181B80D.70404@catalyst.net.nz> <916bff05a5ab130c76d7835abbaf7762.squirrel@mail.catalyst.net.nz> Date: Fri, 3 May 2013 10:59:31 +1200 Subject: Re: In progress INSERT wrecks plans on table From: mark.kirkwood@catalyst.net.nz To: "Thomas Kellerer" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org > mark.kirkwood@catalyst.net.nz wrote on 03.05.2013 00:19: >> I think the idea of telling postgres that we are doing a load is >> probably >> the wrong way to go about this. We have a framework that tries to >> automatically figure out the best plans...I think some more thought >> about >> how to make that understand some of the more subtle triggers for a >> time-to-do-new-plans moment is the way to go. I understand this is >> probably hard - and may imply some radical surgery to how the stats >> collector and planner interact. > > I wonder if "freezing" (analyze, then disable autovacuum) the statistics > for the large number of rows would work. > > > I'm thinking that the issue is actually the opposite - it is that a new plan is needed because the new (uncomitted) rows are changing the data distribution. So we want more plan instability rather than plan stability :-) Cheers Mark --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance