Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnRcV-0002eC-AZ for pgsql-performance@arkaria.postgresql.org; Sat, 17 Oct 2015 13:33:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZnRcT-0003oq-Ha for pgsql-performance@arkaria.postgresql.org; Sat, 17 Oct 2015 13:33:57 +0000 Received: from makus.postgresql.org ([174.143.35.229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZnRap-0001tl-Ol for pgsql-performance@postgresql.org; Sat, 17 Oct 2015 13:32:15 +0000 Received: from smtp-out-no.shaw.ca ([64.59.134.9]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZnRYi-0004Bg-M4 for pgsql-performance@postgresql.org; Sat, 17 Oct 2015 13:30:06 +0000 Received: from home.zioup.com ([70.72.160.156]) by shaw.ca with SMTP id nRYcZCHrPT2vonRYdZHhWz; Sat, 17 Oct 2015 07:30:00 -0600 X-Authority-Analysis: v=2.1 cv=NrEbCZpJ c=1 sm=1 tr=0 a=1AzCEyHvRsrOnBOCSdCQag==:117 a=1AzCEyHvRsrOnBOCSdCQag==:17 a=N8iSzGwtAAAA:8 a=EcwkyOLhAAAA:8 a=IkcTkHD0fZMA:10 a=5lJygRwiOn0A:10 a=Xd_GuD9fAVQP71DGygIA:9 a=QEXdDO2ut3YA:10 Received: from [192.168.2.80] (epicurus.zioup.net [192.168.2.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by home.zioup.com (Postfix) with ESMTPSA id A7050A04C3 for ; Sat, 17 Oct 2015 07:29:57 -0600 (MDT) Subject: Re: SELECT slows down on sixth execution To: pgsql-performance@postgresql.org References: <561E068F.1040702@socialserve.com> From: Yves Dorfsman Message-ID: <56224D55.1020907@zioup.com> Date: Sat, 17 Oct 2015 07:29:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfPujd+VBvZU/bYbvVhIRmd2XRgSlCrqwRZoK4xOTpWo3kDKrDU5DtGJZ9cb9mkVvF5jK+8hKL21EftiY+ddbSDuFZ+whrmzQexLDkd6ji7S2Z/uPvcj7aaS6IbXQHtQ/oRZiv6Md2okltNBO3oOBNJGsGhf0Ko7G7V+L4IyaLmBZBnYh0V5A0ra0GX2TL3okaQ== X-Pg-Spam-Score: -2.6 (--) 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 On 2015-10-14 03:00, Albe Laurenz wrote: > > You are encountering "custom plans", introduced in 9.2. > > When a statement with parameters is executed, PostgreSQL will not only generate > a generic plan, but for the first 5 executions it will substitute the arguments > and generate and execute a custom plan for that. Wow! Thanks. I feel this should be documented a bit better. Shouldn't this be explained in at least as much details as in your explanation, in the sql-prepare document? Yves. -- http://yves.zioup.com gpg: 4096R/32B0F416 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance