Re: Accessing database statistics - Mailing list pgsql-novice

From Tony Griffiths(RA)
Subject Re: Accessing database statistics
Date
Msg-id 3CF616A1.6060703@cs.man.ac.uk
Whole thread Raw
In response to Re: Accessing database statistics  ("Duncan Adams (DNS)" <duncan.adams@vcontractor.co.za>)
List pgsql-novice
Ok, this all depends on how postgresql does this query. If it (behind
the scenes) does a call to a system table which holds a field for the
count of each table then fine - nice and efficient. However if this does
a scan of the appropriate table and counts the number of tuples then
returns this figure, then this is a really expensive operation, and I
need this to be fast.

Tony

Duncan Adams (DNS) wrote:

>for the first part u might try
>
>select count(*) from <table>;
>
>-----Original Message-----
>From: Tony Griffiths(RA) [mailto:griffitt@cs.man.ac.uk]
>Sent: Thursday, May 30, 2002 2:01 PM
>To: pgsql-novice@postgresql.org
>Subject: [NOVICE] Accessing database statistics
>
>
>Hi,
>I need to write a query that returns the number of rows currently stored
>in a table. I presume that I issue a query against the system tables,
>but don't know which one(s) to do this against. So a couple of questions:
>
>1) With specific reference to my problem, how do I do this?
>2) More generally, is there any where that gives detailed descriptions
>of the system tables?
>
>Many thanks,
>
>
>Tony
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo@postgresql.org so that your
>message can get through to the mailing list cleanly
>



pgsql-novice by date:

Previous
From: "Henshall, Stuart - WCP"
Date:
Subject: Re: Enabling Auditing in Postgres
Next
From: "Henshall, Stuart - WCP"
Date:
Subject: Re: Accessing database statistics