pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@paradise.net.nz>
To: Laurent Manchon <lmanchon@univ-montp2.fr>
Cc: pgsql-performance@postgresql.org
Subject: Re: slow result
Date: Wed, 24 Jan 2007 13:51:51 +1300
Message-ID: <45B6ADA7.80204@paradise.net.nz> (raw)
In-Reply-To: <5.0.2.1.2.20070123133416.00cf43b8@pop.univ-montp2.fr>
References: <5.0.2.1.2.20070123133416.00cf43b8@pop.univ-montp2.fr>

Laurent Manchon wrote:
> Hi,
> 
> I have a slow response of my PostgreSQL database 7.4 using this query below
> on a table with 800000 rows:
> 
> select count(*)from tbl;
> 
> PostgreSQL return result in 28 sec every time.


Can you post the results of:

analyze verbose tbl;
explain analyze select count(*) from tbl;

The first will give us some info about how many pages tbl has (in 7.4 
ISTR it does not state the # of dead rows... but anyway), the second 
should help us deduce why it is so slow.

Also as others have pointed out, later versions are quite a bit faster 
for sequential scans...

Cheers

Mark



view thread (12+ messages)  latest in thread

Message-ID: <45B6ADA7.80204@paradise.net.nz>
Permalink:  ../45B6ADA7.80204@paradise.net.nz/
Also on:    postgresql.org/message-id/45B6ADA7.80204@paradise.net.nz

 · 

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: markir@paradise.net.nz, lmanchon@univ-montp2.fr
  Subject: Re: slow result
  In-Reply-To: <45B6ADA7.80204@paradise.net.nz>

* 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