Re: [SQLObject] PostgreSQL: costly count
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Frank B. <fb...@fo...> - 2003-12-04 17:31:00
|
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote: > This message however: > http://archives.postgresql.org/pgsql-performance/2003-10/msg00093.php > suggests doing a "count(pkey)" instead: > > <quote> > Have you tried doing > > SELECT count(pkey) > > rather than count(*) where pkey is the primary key (assuming you > have a single field that is a primary key or a unique indexed key). > This is MUCH faster in my experience. > </qoute> > > Note that the pkey is not the id-colmun, but an index on this column. Ah, it seems I probably misread that message, and the author was indeed talking about the id-column. Well, at least with my 60.000 records table it wasn't faster. ciao -- Frank Barknecht _ ______footils.org__ |