Re: Improving count(*) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Improving count(*)
Date
Msg-id 20051118195620.GB26861@surnet.cl
Whole thread Raw
In response to Re: Improving count(*)  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers
Merlin Moncure wrote:
> > In Sybase ASE (and I'm pretty sure the same is true in Microsoft SQL
> > Server) the leaf level of the narrowest index on the table is scanned,
> > following a linked list of leaf pages.  Leaf pages can be pretty dense
> > under Sybase, because they do use prefix compression.  A count(*)
> > on a table with 100 million rows is going to take a few minutes, but
> it
> > is going to be at least an order of magnitude faster than a data page
> > scan -- maybe two orders of magnitude faster.
> 
> MS SQL server (pre 2005) is not an MVCC database, so it's not apples to
> apples with pg.

Oh, also it was mentioned on pgsql-advocacy that InnoDB is MVCC.  If
that's the case, I wonder how do they do the count(*) thing?  Is it fast?


-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Improving count(*)
Next
From: Gregory Maxwell
Date:
Subject: Re: Improving count(*)