Slow COUNT queries

2003-03-03 Thread Jesse Sheidlower
I have a Web application that allows users to search for text in a potentially complicated form, and then return results. Leaving aside the issue of the speed of FULLTEXT searching, which I'm discussing in a separate thread, I'm having a problem with an initial COUNT query. When the user enters

Re: slow count queries

2002-07-17 Thread Jeremy Zawodny
On Tue, Jul 16, 2002 at 07:49:27PM -0500, mos wrote: With InnoDb you need to pre-allocate file space so all the tables get put into one file. This is a good idea when you have a lot of people accessing the database because it reduces the file handles (less work for the operating system).

slow count queries

2002-07-16 Thread walt
I have an INNODB table which has 4 records in it. customer_number is the primary key. If I run select count(cutomer_number) from customer; It takes about 15 seconds to return the number of rows. I ran explain on the query and it's using the unique key index on customer_number. If I run

Re: slow count queries

2002-07-16 Thread Jeremy Zawodny
On Tue, Jul 16, 2002 at 03:52:35PM -0400, walt wrote: I have an INNODB table which has 4 records in it. customer_number is the primary key. If I run select count(cutomer_number) from customer; It takes about 15 seconds to return the number of rows. I ran explain on the query and

Re: slow count queries

2002-07-16 Thread walt
On Tuesday 16 July 2002 05:05 pm, Jeremy Zawodny wrote: On Tue, Jul 16, 2002 at 03:52:35PM -0400, walt wrote: I have an INNODB table which has 4 records in it. customer_number is the primary key. If I run select count(cutomer_number) from customer; It takes about 15 seconds to

Re: slow count queries

2002-07-16 Thread mos
Walt, InnoDb physically counts all the rows in the table (unlike MyISAM tables which stores the row count in a separate location). So in your case it went through all 99,994 rows. The more rows you have in the table, the longer it will take. I don't know how accurate Show table status

Re: slow count queries

2002-07-16 Thread mos
At 06:00 PM 7/16/2002, you wrote: hello, this issue is important for me too. i have a few silly questions 1. why innodb table type? what is its use? which one is default? (ISAM?) Innodb Supports row locking and transactions which is very important when a lot of users are updating the same