Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-11-03 Thread Jasen Betts
On 2010-10-26, John R Pierce wrote: > > count(*) has to read the whole table to get the accurate count. The > reason for this is that different clients can see different versions of > that table, for instance, if client A is already in a transaction, and > client B then does an INSERT, the tw

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-28 Thread Merlin Moncure
On Thu, Oct 28, 2010 at 11:36 AM, Ozz Nixon wrote: > How/where do I query this? > > My script does not need a 100% accurate count - just a recently valid count - > so I can verify the web crawlers are still crawling :-) you can do this: select reltuples from pg_class where relname = 'your_table'

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-28 Thread Ozz Nixon
How/where do I query this? My script does not need a 100% accurate count - just a recently valid count - so I can verify the web crawlers are still crawling :-) On Oct 27, 2010, at 7:15 AM, Merlin Moncure wrote: > pg_class.reltuples -- Sent via pgsql-general mailing list (pgsql-general@postg

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-27 Thread Merlin Moncure
On Tue, Oct 26, 2010 at 4:30 PM, Diego Schulz wrote: > On Tue, Oct 26, 2010 at 2:18 PM, Ozz Nixon wrote: >> I am the only user on this system right now, and one table select count(*) >> took over 20 minutes: >> >> wikitags exists and has 58,988,656 records. >> >> Structure (in pascal) is: >> >>

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-26 Thread Diego Schulz
On Tue, Oct 26, 2010 at 2:18 PM, Ozz Nixon wrote: > I am the only user on this system right now, and one table select count(*) > took over 20 minutes: > > wikitags exists and has 58,988,656 records. > > Structure (in pascal) is: > >   quer.SQL.Add('create table '+DBTags+' ('); >   quer.SQL.Add('

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-26 Thread Alan Hodgson
On October 26, 2010 10:18:41 am Ozz Nixon wrote: > I have hung off indexes for each column, to resolve my previous > "performance" issue from 3+ weeks ago. However, COUNT() is still dog slow > - this table is a write once, read many... *never* update, nor delete. > > Any suggestions? If you need

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-26 Thread John R Pierce
On 10/26/10 10:18 AM, Ozz Nixon wrote: I am the only user on this system right now, and one table select count(*) took over 20 minutes: wikitags exists and has 58,988,656 records. Structure (in pascal) is: quer.SQL.Add('create table '+DBTags+' ('); quer.SQL.Add(' pagename '+SQL_TITL

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-26 Thread Bill Moran
In response to Ozz Nixon : > I am the only user on this system right now, and one table select count(*) > took over 20 minutes: > > wikitags exists and has 58,988,656 records. > > Structure (in pascal) is: > >quer.SQL.Add('create table '+DBTags+' ('); >quer.SQL.Add(' pagename '+SQL_T

[GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-26 Thread Ozz Nixon
I am the only user on this system right now, and one table select count(*) took over 20 minutes: wikitags exists and has 58,988,656 records. Structure (in pascal) is: quer.SQL.Add('create table '+DBTags+' ('); quer.SQL.Add(' pagename '+SQL_TITLE+'(100) not null,'); quer.SQL.Add(' t