Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJnfv-0005bE-1C for pgsql-performance@arkaria.postgresql.org; Wed, 11 Sep 2013 16:53:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJnfu-0003DM-FC for pgsql-performance@arkaria.postgresql.org; Wed, 11 Sep 2013 16:53:54 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJnfs-0003BT-Jo for pgsql-performance@postgresql.org; Wed, 11 Sep 2013 16:53:52 +0000 Received: from mail01.pnet.xcon.it ([62.48.53.71]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJnfn-0007n5-Gs for pgsql-performance@postgresql.org; Wed, 11 Sep 2013 16:53:52 +0000 Received: from localhost (av.pnet.xcon.it [10.68.1.18]) by mail01.pnet.xcon.it (Postfix) with ESMTP id 5121030116E5E for ; Wed, 11 Sep 2013 18:53:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at av Received: from mail01.pnet.xcon.it ([10.68.1.19]) by localhost (av.pnet.xcon.it [10.68.1.18]) (amavisd-new, port 10024) with LMTP id WmJbTOBChRNK for ; Wed, 11 Sep 2013 18:53:06 +0200 (CEST) Received: from bnc1.pnet.xcon.it (bnc1.pnet.xcon.it [10.68.1.23]) by mail01.pnet.xcon.it (Postfix) with ESMTP id 30EBC30112D17 for ; Wed, 11 Sep 2013 18:53:45 +0200 (CEST) Received: from localhost (av.pnet.xcon.it [10.68.1.18]) by bnc1.pnet.xcon.it (Postfix) with ESMTP id 1E5401022E35 for ; Wed, 11 Sep 2013 18:53:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at av Received: from bnc1.pnet.xcon.it ([10.68.1.23]) by localhost (av.pnet.xcon.it [10.68.1.18]) (amavisd-new, port 10024) with LMTP id Goi22r4B97Rq for ; Wed, 11 Sep 2013 18:53:06 +0200 (CEST) Received: from [192.168.0.147] (unknown [83.149.163.202]) (Authenticated sender: giuseppe.broccolo@2ndquadrant.it) by bnc1.pnet.xcon.it (Postfix) with ESMTPSA id AE5091022E23 for ; Wed, 11 Sep 2013 18:53:44 +0200 (CEST) Message-ID: <5230A08A.7050001@2ndquadrant.it> Date: Wed, 11 Sep 2013 18:55:38 +0200 From: Giuseppe Broccolo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Reasons for choosing one execution plan over another? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.0 (/) 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 Il 11/09/2013 13:16, Mikkel Lauritsen ha scritto: > Hi all, > > I have a number of Postgres 9.2.4 databases with the same schema but with > slightly different contents, running on small servers that are basically > alike (8-16 GB ram). > I think that your answer can be found in your statement "slightly different contents". Planner choices query execution plans basing on statistics obtained during ANALYSE operations, including the autovacuum. In this way, Planner can decide which execution plan is the most suitable. Different content of values in your table could correspond to different statistical distribution of values in your columns and of rows in your tables, bringing to different choices of the Planner. Execution times can be very different, also by factor 10-100. There is a parameter (stat_target) which set the "selectivity" of statistical samples of a table. Maybe, but it's not necessarily true, you could obtain more comparable execution times for the two execution plans changing it, probably increasing them. Giuseppe. -- Giuseppe Broccolo - 2ndQuadrant Italy PostgreSQL Training, Services and Support giuseppe.broccolo@2ndQuadrant.it | www.2ndQuadrant.it -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance