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

Re: slow result

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: slow result
Date: 2007-01-23 10:53:35
Message-ID: 20070123105335.GD24927@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-performance
am  Tue, dem 23.01.2007, um 11:34:52 +0100 mailte Laurent Manchon folgendes:
> 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;

If i remember correctly, i saw this question yesterday on an other
list...


Answer:

Because PG force a sequencial scan. You can read a lot about this in the
archives. Here some links to explanations:

http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10117&cNode=0T1L6L
http://sql-info.de/postgresql/postgres-gotchas.html#1_7
http://www.varlena.com/GeneralBits/49.php


Hope that helps, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

In response to

  • slow result at 2007-01-23 10:34:52 from Laurent Manchon

pgsql-performance by date

Next:From: Steinar H. GundersonDate: 2007-01-23 10:55:41
Subject: Re: slow result
Previous:From: Heiko W.RuppDate: 2007-01-23 10:43:16
Subject: Re: slow result

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