pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: alexandre - aldeia digital <adaldeia@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Nested loop and simple join query - slow after upgrade to 9.2
Date: Fri, 25 Jan 2013 17:30:41 -0200
Message-ID: <5102DD61.1000207@gmail.com> (raw)
In-Reply-To: <CAMkU=1zJ14Vki5zOXtaw7Q_8s4w=nUarfgx4n8SuRAxVOiayyQ@mail.gmail.com>
References: <5102A5F7.2070103@gmail.com>
	<CAMkU=1zJ14Vki5zOXtaw7Q_8s4w=nUarfgx4n8SuRAxVOiayyQ@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Em 25-01-2013 16:29, Jeff Janes escreveu:
> On Fri, Jan 25, 2013 at 7:34 AM, alexandre - aldeia digital
> <adaldeia@gmail.com> 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



view thread (3+ messages)

Message-ID: <5102DD61.1000207@gmail.com>
Permalink:  ../5102DD61.1000207@gmail.com/
Also on:    postgresql.org/message-id/5102DD61.1000207@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: adaldeia@gmail.com
  Subject: Re: Nested loop and simple join query - slow after upgrade to 9.2
  In-Reply-To: <5102DD61.1000207@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox