pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Greg Stark <gsstark@mit.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Good News re count(*) in 8.1
Date: Thu, 23 Feb 2006 14:25:46 -0600
Message-ID: <20060223202546.GP86022@pervasive.com> (raw)
In-Reply-To: <43FDB09C.EE98.0025.0@wicourts.gov>
References: <43FC4384.EE98.0025.0@wicourts.gov>
	<87irr6zq7j.fsf@stark.xeocode.com>
	<43FDB09C.EE98.0025.0@wicourts.gov>

On Thu, Feb 23, 2006 at 12:54:52PM -0600, Kevin Grittner wrote:
> >>> On Wed, Feb 22, 2006 at  9:52 pm, in message
> <87irr6zq7j.fsf@stark.xeocode.com>, Greg Stark <gsstark@mit.edu> wrote:
> 
> 
> > "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> > 
> >> There have been several times that I have run a SELECT COUNT(*) on
> an entire
> >> table on all central machines. On identical hardware, with identical
> data,
> >> and equivalent query loads, the PostgreSQL databases have responded
> with a
> >> count in 50% to 70% of the time of the commercial product, in spite
> of the
> >> fact that the commercial product does a scan of a non- clustered
> index while
> >> PostgreSQL scans the data pages.
> > 
> > I take it these are fairly narrow rows? The big benefit of index-
> only scans
> > come in when you're scanning extremely wide tables, often counting
> rows
> > matching some indexed criteria.
> 
> I'm not sure what you would consider "fairly narrow rows" -- so see the
> attached.  This is the VACUUM ANALYZE VERBOSE output for the largest
> table, from last night's regular maintenance run.

Looks to be about 60 rows per page, somewhere around 140 bytes per row
(including overhead). Accounting for overhead and allowing for some
empty room, about 100 bytes of data per row, which isn't all that thin.
Not all that fat, either... The PK index is about 5 times smaller. IF
that ratio holds on the commercial product and they can't beat us with
an index scan.... :)
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (6+ messages)

Message-ID: <20060223202546.GP86022@pervasive.com>
Permalink:  ../20060223202546.GP86022@pervasive.com/
Also on:    postgresql.org/message-id/20060223202546.GP86022@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, Kevin.Grittner@wicourts.gov, gsstark@mit.edu
  Subject: Re: Good News re count(*) in 8.1
  In-Reply-To: <20060223202546.GP86022@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox