From: Stefan Arentz <stefan.arentz@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Counting all rows
Date: Sat, 23 Jun 2007 12:15:11 +0200
Message-ID: <adf34c300706230315y43ba92daqf0804b7c377ffd29@mail.gmail.com> (raw)
I need to get statistics from a bunch of tables. Simply the number of
records in them.
The query plan looks like this:
=> explain select count(id) from stuff;
QUERY PLAN
-------------------------------------------------------------------
Aggregate (cost=1629.69..1629.70 rows=1 width=8)
-> Seq Scan on stuff (cost=0.00..1517.75 rows=44775 width=8)
The sequential scan kind of worries me. Is there a better/faster way to do this?
S.
S.
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-sql@postgresql.org
Cc: stefan.arentz@gmail.com
Subject: Re: Counting all rows
In-Reply-To: <adf34c300706230315y43ba92daqf0804b7c377ffd29@mail.gmail.com>
* 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