pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPerformances
4+ messages / 4 participants
[nested] [flat]
* Performances
@ 2006-12-28 09:59 Cedric BUSCHINI <cbuschini@carax.com>
0 siblings, 3 replies; 4+ messages in thread
From: Cedric BUSCHINI @ 2006-12-28 09:59 UTC (permalink / raw)
To: Novice Postgresql-list <pgsql-novice@postgresql.org>; pgsql-admin
Hello everyone,
A quick question:
- how long does it take you to perform that query :
"SELECT COUNT(*) FROM A_TABLE;"
There are like 56113000 rows in the table.
Thanks
Cedric
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Performances
@ 2006-12-28 10:48 A. Kretschmer <andreas.kretschmer@schollglas.com>
parent: Cedric BUSCHINI <cbuschini@carax.com>
2 siblings, 0 replies; 4+ messages in thread
From: A. Kretschmer @ 2006-12-28 10:48 UTC (permalink / raw)
To: pgsql-novice@postgresql.org
am Thu, dem 28.12.2006, um 10:59:39 +0100 mailte Cedric BUSCHINI folgendes:
> Hello everyone,
>
> A quick question:
> - how long does it take you to perform that query :
> "SELECT COUNT(*) FROM A_TABLE;"
Depends:
test=# \timing
Timing is on.
test=# select count(*) from a_table ;
count
-------
0
(1 row)
Time: 1.700 ms
test=#
>
> There are like 56113000 rows in the table.
A query like above performs a seq. scan on the table - this needs time.
You can get an estimation for this value by asking pg_class.reltuples.
select reltuples from pg_class where relname='a_table';
But this is only a estimation, depends on actual statistics.
It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE
INDEX.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Performances
@ 2006-12-28 17:17 Bricklen Anderson <banderson@presinet.com>
parent: Cedric BUSCHINI <cbuschini@carax.com>
2 siblings, 0 replies; 4+ messages in thread
From: Bricklen Anderson @ 2006-12-28 17:17 UTC (permalink / raw)
To: Cedric BUSCHINI <cbuschini@carax.com>; +Cc: Novice Postgresql-list <pgsql-novice@postgresql.org>; pgsql-admin
Cedric BUSCHINI wrote:
> Hello everyone,
>
> A quick question:
> - how long does it take you to perform that query :
> "SELECT COUNT(*) FROM A_TABLE;"
>
Not long :)
dev5=# SELECT COUNT(*) FROM A_TABLE;
ERROR: relation "a_table" does not exist
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Performances
@ 2006-12-29 03:09 Alvaro Herrera <alvherre@commandprompt.com>
parent: Cedric BUSCHINI <cbuschini@carax.com>
2 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2006-12-29 03:09 UTC (permalink / raw)
To: Cedric BUSCHINI <cbuschini@carax.com>; +Cc: Novice Postgresql-list <pgsql-novice@postgresql.org>; pgsql-admin
Cedric BUSCHINI wrote:
> Hello everyone,
>
> A quick question:
> - how long does it take you to perform that query :
> "SELECT COUNT(*) FROM A_TABLE;"
Longer than I want to wait in any case. In most cases you can rewrite
that query to something else; what that something looks like, depends on
how exact you want the result to be. So the question to you is, what do
you want that number for?
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-12-29 03:09 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-28 09:59 Performances Cedric BUSCHINI <cbuschini@carax.com>
2006-12-28 10:48 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2006-12-28 17:17 ` Bricklen Anderson <banderson@presinet.com>
2006-12-29 03:09 ` Alvaro Herrera <alvherre@commandprompt.com>
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