Re: [SQLObject] PostgreSQL: costly count
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: J-P L. <jp...@si...> - 2003-12-04 16:59:46
|
Frank Barknecht wrote: >I did, it's largely the same as count(*) on Postgres, and also uses a >sequential scan through the whole DB. I'm just reading through this >looong thread on pgsql-performance: >http://archives.postgresql.org/pgsql-performance/2003-10/msg00058.php > > Hmm.. the thread seems to suggest the same thing. I'm not sure if you can get around the sequential scan. count(id) saves you the time of fetching all field contents. As the thread points out, this time diff is significant for large tables. For small ones, though, it's probably the same as count(*). -- J-P |