logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Accessing database statistics: msg#00348

db.postgresql.novice

Subject: Re: Accessing database statistics

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@xxxxxxxxxxxx]
Sent: Thursday, May 30, 2002 2:01 PM
To: pgsql-novice@xxxxxxxxxxxxxx
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@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo