Skip site navigation (1) Skip section navigation (2)

Re: slow result

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Laurent Manchon <lmanchon(at)univ-montp2(dot)fr>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: slow result
Date: 2007-01-24 00:51:51
Message-ID: 45B6ADA7.80204@paradise.net.nz (view raw or flat)
Thread:
Lists: pgsql-performance
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

In response to

  • slow result at 2007-01-23 12:34:19 from Laurent Manchon

pgsql-performance by date

Next:From: Mark KirkwoodDate: 2007-01-24 03:20:47
Subject: Re: extract(field from timestamp) vs date dimension
Previous:From: Dave DutcherDate: 2007-01-23 22:08:47
Subject: Bad Row Count Estimate on View with 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group