| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: number of rows |
| Date: | 2003-06-13 14:12:04 |
| Message-ID: | 447.1055513524@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
"Marcus Andree S. Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br> writes:
> I mean, is there any internal variable that stores the number of
> rows instead of sequencially scanning the entire database??
If a very approximate answer is good enough, you could consult
pg_class.reltuples, which is good as of the last VACUUM. There
is no on-the-fly maintenance of a row count, for a number of good
reasons that you can read about in the PG list archives.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Berkus | 2003-06-13 16:11:26 | Re: Exporting data from PostgreSQL |
| Previous Message | Jeff Eckermann | 2003-06-13 13:57:40 | Re: Exporting data from PostgreSQL |