Re: [SQL] Yet Another (Simple) Case of Index not used

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: <denis(at)next2me(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used
Date: 2003-04-09 16:18:45
Message-ID: 200304090918.45275.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance pgsql-sql

Denis,

> Are you saying the 7.4 'group by' trick would be faster than the simple
> select count(*)? That seems hard to believe, being that the request now has
> to fetch / sort the data. I must be missing something.

No, I'm saying that the 7.4 hash-aggregate is faster than the same query was
under 7.2 or 7.3. Much faster. But it does little to speed up a raw
count(*).

> The kind of requests that I am really interested in are:
> select count(*) from table where table.column like 'pattern%'

Hash-aggregates may, in fact, help with this. Care to try downloading the
the source from CVS?

> These seems to go much master on mysql (which I guess it not a MVCC
> database? or wasn't the Innobase supposed to make it so?),

They did incorporate a lot of MVCC logic into InnoDB tables, yes. Which means
that if SELECT count(*) on an InnoDB table is just as fast as a MyISAM table,
then it is not accurate. This would be in keeping with MySQL's design
philosophy, which values performance and simplicity over accuracy and
precision -- the opposite of our philosophy.

> So, in the meantime, I've decided to split up my data into two sets,
> the static big tables which are handled by mysql, and the rest of it
> handled by postgresql....

Hey, if it works for you, it's probably easier than dealing with the
PostgreSQL workarounds to this performance issue. I'll ask you to give
PostgreSQL a try for those tables again when 7.4 comes out.

> ps: apologies for the cross-posting.

De nada. The Performance list is the right place for this sort of question
in the future.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philip Hallstrom 2003-04-09 16:30:45 Re: PostgreSQL Hosting
Previous Message Tom Lane 2003-04-09 16:04:32 Re: Duplicate Data entry problem

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-04-09 16:28:01 Re: choosing the right platform
Previous Message Josh Berkus 2003-04-09 16:10:29 Re: ext3 filesystem / linux 7.3

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-04-09 16:45:45 Re: Getting NEW and OLD in ordinary functions.
Previous Message Joe Conway 2003-04-09 15:18:07 Re: Concatenating not working properly