COUNT(*) result faster?
Rhino
- Original Message -
From: "sheeri kritzer" <[EMAIL PROTECTED]>
To: "Kevin Burton" <[EMAIL PROTECTED]>
Cc:
Sent: Monday, November 14, 2005 5:10 PM
Subject: Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?
H
Hi all,
I know I'm a bit late in coming to this discussion. Glad to see that
this problem is on the InnoDB to-do list.
I will put out that one thing you can do is utilize triggers. Make a
separate table with one field, and put a trigger on the table you want
counted so that every time there is
[EMAIL PROTECTED] wrote:
Jigal van Hemert <[EMAIL PROTECTED]> wrote on 11/02/2005 03:29:14 AM:
> If I understand
> http://dev.mysql.com/doc/refman/5.0/en/table-and-index.html
> correctly, the index of the primary key is stored as the clustered index
> together with the data. To me this means
Sent: Wednesday, November 02, 2005 10:30 AM
Subject: Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?
Shankar Unni wrote:
[EMAIL PROTECTED] wrote:
If I understand the InnoDB engine correctly, I don't see how they
could speed it up unless they start tracking how many records
Jigal van Hemert <[EMAIL PROTECTED]> wrote on 11/02/2005 03:29:14 AM:
> Shankar Unni wrote:
> > [EMAIL PROTECTED] wrote:
> >
> >> If I understand the InnoDB engine correctly, I don't see how they
> >> could speed it up unless they start tracking how many records belong
> >> to each active "vers
Shankar Unni wrote:
[EMAIL PROTECTED] wrote:
If I understand the InnoDB engine correctly, I don't see how they
could speed it up unless they start tracking how many records belong
to each active "version" within a database.
But one thing you can do to speed it up somewhat is to do a
COUNT
[EMAIL PROTECTED] wrote:
If I understand the InnoDB engine correctly, I don't see how they could
speed it up unless they start tracking how many records belong to each
active "version" within a database.
But one thing you can do to speed it up somewhat is to do a
COUNT(PK_column) (rather th
Are you sure? Finding a single record using an index may be O(logN),
but wouldn't reading all of the index be O(N)?
Yeah.. you're right. It would be O(N)... I was thinking this as I
hit the "send" button :)
Kevin
Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator,
On 11/1/05, Kevin Burton wrote:
> MyISAM has a cool feature where it keeps track of the internal row
> count so that
>
> SELECT COUNT(*) FROM FOO executes in constant time. Usually 1ms or so.
>
> The same query on INNODB is O(logN) since it uses the btree to
> satisfy the query.
Are you sure? Fin
Kevin Burton <[EMAIL PROTECTED]> wrote on 11/01/2005 03:39:59 PM:
> MyISAM has a cool feature where it keeps track of the internal row
> count so that
>
> SELECT COUNT(*) FROM FOO executes in constant time. Usually 1ms or so.
>
> The same query on INNODB is O(logN) since it uses the btree to
At 12:39 -0800 11/1/05, Kevin Burton wrote:
MyISAM has a cool feature where it keeps track of the internal row
count so that
SELECT COUNT(*) FROM FOO executes in constant time. Usually 1ms or so.
The same query on INNODB is O(logN) since it uses the btree to
satisfy the query.
I believe th
MyISAM has a cool feature where it keeps track of the internal row
count so that
SELECT COUNT(*) FROM FOO executes in constant time. Usually 1ms or so.
The same query on INNODB is O(logN) since it uses the btree to
satisfy the query.
I believe that MyISAM just increments an internal count
12 matches
Mail list logo