Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-14 Thread Rhino
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-14 Thread sheeri kritzer
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-04 Thread Jigal van Hemert
[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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-02 Thread Heikki Tuuri
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-02 Thread SGreen
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-02 Thread Jigal van Hemert
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread Shankar Unni
[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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread Kevin Burton
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,

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread Jochem van Dieten
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread SGreen
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

Re: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread Paul DuBois
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

Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?

2005-11-01 Thread Kevin Burton
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