Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyozH-0000vO-Pe for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jan 2013 19:30:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TyozG-0000bn-IY for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jan 2013 19:30:54 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyozF-0000bh-BH for pgsql-performance@postgresql.org; Fri, 25 Jan 2013 19:30:53 +0000 Received: from mail-gh0-f182.google.com ([209.85.160.182]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyozC-0006dz-Fx for pgsql-performance@postgresql.org; Fri, 25 Jan 2013 19:30:52 +0000 Received: by mail-gh0-f182.google.com with SMTP id z15so115938ghb.41 for ; Fri, 25 Jan 2013 11:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=KKXJzVH9JC+yQVILA9fAwaa1m2k3KNTFrdJ5z2sV0Lc=; b=AciUey04zG6a3g+UDIzmKRxYz9DWJ6tvrma6PvaBYfJYuYLN8lwdpF5PFPz11kOtJt BA+u/IW9VEUaEHz2mgwKGd6f2RD0Xs/lQ9SvQpQWfUNAvz4DJQYgX4uCqp3qRPNTtwUf 9OnQKaRNU8kjRCh11VGi8pPkI/mESvPlXsbizw83mdH1QCTCIFv9HJbPW3UHWFYv2SBJ L7eONf7sKvV3yIIVtCdUjXSwbFRbteM6myXxAldf5vvCh6HcSeSo2TwmA6BFeCch3Zpc L5p6EK5SSOl6xX4L380IP/kGPDNsOXOcJjLirFqJLcspdwW2eW1sP9PgwMoy0gIl7e2A B0Ow== X-Received: by 10.236.191.202 with SMTP id g50mr7208103yhn.78.1359142249934; Fri, 25 Jan 2013 11:30:49 -0800 (PST) Received: from [192.168.1.50] ([187.23.8.51]) by mx.google.com with ESMTPS id i24sm1651507ann.16.2013.01.25.11.30.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jan 2013 11:30:49 -0800 (PST) Message-ID: <5102DD61.1000207@gmail.com> Date: Fri, 25 Jan 2013 17:30:41 -0200 From: alexandre - aldeia digital User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 CC: pgsql-performance@postgresql.org Subject: Re: Nested loop and simple join query - slow after upgrade to 9.2 References: <5102A5F7.2070103@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.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 Em 25-01-2013 16:29, Jeff Janes escreveu: > On Fri, Jan 25, 2013 at 7:34 AM, alexandre - aldeia digital > wrote: >> Hi, >> >> Last weekend, we upgrade a PG from 8.4 to 9.2 version (full >> pg_dump/restore/vacuum/analyze). After this, some simple join querys >> became very slow, maybe because the use of nested loops. Bellow, an example >> with nestedloop on and off: > > What happens if you bump up default_statistics_target by a factor of > 10 or 100 and redo the analyze? Before send the e-mail, the default_statistics_target was 500 and I return to 100 (default). I will try to set 1000. > Here it is finding 39 times more rows than expected: > > Index Scan using ad_pc13t3_modpadrao on pc13t3 t1 (cost=0.00..6.21 > rows=1 width=65) (actual time=0.090..0.252 rows=39 loops=1) > > It would interesting to know why that is. This is a partial index: "ad_pc13t3_modpadrao" btree (pc13emp08p, pc13anoped, pc13codped, pc13codigo, pc13cor, pc13empins, pc13emp08, pc13tipin2, pc13insest) WHERE pc13emp08p = 0 AND pc13anoped = 0 AND pc13codped = 0 AND pc13item = 0 I can't connect to databse now. I will retry tests in sunday. Best regards, Alexandre -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance