Re: Newbie question: ultra fast count(*)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I have been reading all this technical talk about costs and such that
> I don't (_yet_) understand.
> 
> Now I'm scared... what's the fastest way to do an equivalent of
> count(*) on a table to know how many items it has?

Make sure to analyze the database frequently and check pg_class for
reltuples field.  This gives 0 time approximations of # row in table at
the time of the last analyze.

Many other approaches...check archives.  Also your requirements are
probably not as high as you think they are ;)

Merlin



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux