pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erwin Brandstetter <brsaweda@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Query performance
Date: Sun, 28 May 2006 23:56:27 +0200
Message-ID: <ed80d$447a1c8c$506d0da5$19172@news.chello.at> (raw)
In-Reply-To: <e4s9gh$s5s$1@newsreader1.utanet.at>
References: <e4rvnb$o8f$1@newsreader1.utanet.at>
	<1148294589.715695@proxy.dienste.wien.at>
	<e4s9gh$s5s$1@newsreader1.utanet.at>

Antonio Batovanja wrote:
> Laurenz Albe wrote:
> 
>> Antonio Batovanja wrote:
>>> I'm having trouble understanding, why a specific query on a small
>>> database is taking so long...
>>>
>> Before I try to understand the execution plans:
>>
>> Have you run ANALYZE on the tables involved before you ran the query?
> 
> Hi,
> 
> Just to be on the safe side, I've run ANALYZE now.
> Here are the query plans for the two queries:

I suspect a misunderstanding here. What Laurenz probably meant is to run 
  analyze on the involved _tables_ so the statistics data is refreshed. 
If the query planner runs with outdated statistics, queries may perform 
very poorly. Try

	vacuum full analyze yourdatabase

To fully vacuum your database and analyze all tables.
(vacuum full is extra, but can't hurt.)

http://www.postgresql.org/docs/8.1/static/sql-vacuum.html
http://www.postgresql.org/docs/8.1/static/sql-analyze.html

Regards, Erwin



view thread (48+ messages)  latest in thread

Message-ID: <ed80d$447a1c8c$506d0da5$19172@news.chello.at>
Permalink:  ../ed80d$447a1c8c$506d0da5$19172@news.chello.at/
Also on:    postgresql.org/message-id/ed80d$447a1c8c$506d0da5$19172@news.chello.at

 · 

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: brsaweda@gmail.com
  Subject: Re: Query performance
  In-Reply-To: <ed80d$447a1c8c$506d0da5$19172@news.chello.at>

* 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