List:General Discussion« Previous MessageNext Message »
From:Luuk de Boer Date:January 1 1970 12:00am
Subject:Re: can i speed up a query on a large database :?
View as plain text  
If your selects are only on the ID field just add an index to the ID 
field else add some other indexes to your table def so every query 
will use the indexes. 

Greetz...

Luuk

On 9 May 99, at 13:05, kalle volkov wrote:

> hi!
> 
> some queryes are SOOOO slow... can i speed them up somehow :?
> 
> machine is P2-350/128RAM/128SWAP/RedHat5.2... should be enough !?! and the
> total count of records is growing FAST...
> 
> explanation follows:
> 
> --- capture from mysql ---
> 
> [root@kiisu mysql]# bin/mysql Database
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
> 
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 30039 to server version: 3.22.20a
> 
> Type 'help' for help.
> 
> mysql> select count(*) from CounterDatabase;
> +----------+
> | count(*) |
> +----------+
> |  2200089 |
> +----------+
> 1 row in set (0.01 sec)
> 
> mysql> select count(*) from CounterDatabase where ID = '36d98fee94f7b';
> +----------+ | count(*) | +----------+ |    24647 | +----------+ 1 row in
> set (15.17 sec)
> 
> mysql> explain CounterDatabase;
> +------------+-------------+------+-----+---------+-------+
> | Field      | Type        | Null | Key | Default | Extra |
> +------------+-------------+------+-----+---------+-------+
> | ID         | varchar(20) |      | MUL |         |       |
> | date       | datetime    | YES  |     | NULL    |       |
> | ip         | text        | YES  |     | NULL    |       |
> | country    | varchar(10) |      | MUL |         |       |
> | hour       | int(4)      |      | MUL | 0       |       |
> | month      | int(4)      |      | MUL | 0       |       |
> | dow        | int(2)      |      | MUL | 0       |       |
> +------------+-------------+------+-----+---------+-------+
> 7 rows in set (0.00 sec)
> 
> mysql> 
> --- / ---
> 
> --- fragment of mysql.start ---
> $bindir/safe_mysqld -O max_allowed_packet=256000 -O key_buffer=32M -O
> table_cache=256 -O sort_buffer=24M -O record_buffer=4M & --- / ---
> 
> TIA,
> 
> regs,
> cal6
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread3095@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
> 


Thread
can i speed up a query on a large database :?kalle volkov9 May
  • Re: can i speed up a query on a large database :?Luuk de Boer10 May