List:General Discussion« Previous MessageNext Message »
From:Darek Maciera Date:July 10 2012 9:29am
Subject:Query take too long time - please help!
View as plain text  
Hello,

I have table:

mysql> DESCRIBE books;

|id                                          |int(255)  | NO   | PRI |
NULL              | auto_increment |
| idu                                       | int(255)  | NO   | MUL | NULL
| ksd                                       | char(15)  | YES  |     | NULL
| idn                                       | int(1)    | NO   | MUL | NULL
| text1                                   | text      | NO   |     | NULL
| ips                             | int(1)    | NO   | MUL | NULL
| ips2                            | int(1)    | NO   | MUL | NULL
| date                         | timestamp | NO   |     | CURRENT_TIMESTAMP
| date2                       | date      | NO   |     | NULL
| text2                        | text      | NO   |     | NULL
| text3                        | text      | NO   |     | NULL

I have indexes in this table:

mysql> SHOW INDEX FROM uzytkownicy_strona_kody;

| books |          0 | PRIMARY            |            1 | id  | A
    |      369625 |     NULL | NULL   |      | BTREE      |
        |
| books |          1 | idx_idu            |            1 | idu  | A
     |      184812 |     NULL | NULL   |      | BTREE      |
        |
| books |          1 | idx_id             |            1 | id | A
   |      369625 |     NULL | NULL   |      | BTREE      |
        |
| books |          1 | idx_idn            |            1 | idn  | A
     |           8 |     NULL | NULL   |      | BTREE      |
        |
| books |          1 | idx_ips  |            1 | ips  | A   |
 8 |     NULL | NULL   |      | BTREE      |         |
| books |          1 | idx_ips2 |            1 | ips2 | A  |
8 |     NULL | NULL   |      | BTREE      |         |

Every books have unique: 'ksd'. There are about 370.000 records in this table.

But this SELECT take too long time:

mysql> SELECT * FROM books WHERE ksd ='A309CC47B7';
1 row in set (2.59 sec)


Table is in InnoDB engine. I added to my.cnf:   innodb_buffer_pool_size = 512MB

Any suggestions? Help, please..
Thread
Query take too long time - please help!Darek Maciera10 Jul
  • Re: Query take too long time - please help!Ananda Kumar10 Jul