Re: Slow query with planner row strange estimation

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: damien hostin <damien(dot)hostin(at)axege(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query with planner row strange estimation
Date: 2010-07-08 18:42:47
Message-ID: AANLkTimauId9FvRbYGvnpcnwBSk7Yuyd6LREavGM72Eu@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jul 7, 2010 at 10:39 AM, damien hostin <damien(dot)hostin(at)axege(dot)com> wrote:
> Hello again,
>
> At last, I check the same query with the same data on my desktop computer.
> Just after loading the data, the queries were slow, I launch a vaccum
> analyse which collect good stats on the main table, the query became quick
> (~200ms). Now 1classic sata disk computer is faster than our little monster
> server !!

Have you tried running ANALYZE on the production server?

You might also want to try ALTER TABLE ... SET STATISTICS to a large
value on some of the join columns involved in the query.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2010-07-08 18:51:04 Re: [Slony1-general] WAL partition overloaded--by autovacuum?
Previous Message Ryan Wexler 2010-07-08 17:16:47 Fwd: performance on new linux box