Re: Join over two tables of 50K records takes 2 hours

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Svetlin Manavski <svetlin(dot)manavski(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Join over two tables of 50K records takes 2 hours
Date: 2011-10-14 04:38:16
Message-ID: CAOR=d=2zPgFH=sGNrqEe7OQp5PLAF2+SG5W3AS5ZRcom7S6p7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

It seems like your row estimate are way off, with the planner
expecting 1 and getting 3000 or so. Have you tried cranking up
default stats target to say 1000, running analyze and seeing what
happens?

If that doesn't do it, try temporarily turning off nested loops:

set enable_nestloop = off;
explain analyze yourqueryhere;

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message CSS 2011-10-14 08:23:48 SSD options, small database, ZFS
Previous Message Tom Lane 2011-10-14 04:37:48 Re: Join over two tables of 50K records takes 2 hours