[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

MySQL fulltext search



Hey

Jeg har en tabel, hvor jeg har et fulltext index, men jeg kan ikke få
det til at performe særlig godt, og jeg forstår ikke hvorfor:

mysql> explain select count(*) from game_log_ng where match(log)
against("+nano" in boolean mode);
+----+-------------+-------------+----------+---------------+--------------+---------+------+------+-------------+
| id | select_type | table       | type     | possible_keys |
key          | key_len | ref  | rows | Extra       |
+----+-------------+-------------+----------+---------------+--------------+---------+------+------+-------------+
|  1 | SIMPLE      | game_log_ng | fulltext | fulltext_log  |
fulltext_log | 0       |      |    1 | Using where |
+----+-------------+-------------+----------+---------------+--------------+---------+------+------+-------------+
1 row in set (0,00 sec)

mysql> explain select count(*) from game_log_ng where log like "%nano%";
+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
| id | select_type | table       | type | possible_keys | key  | key_len
| ref  | rows    | Extra       |
+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
|  1 | SIMPLE      | game_log_ng | ALL  | NULL          | NULL | NULL   
| NULL | 5183656 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
1 row in set (0,00 sec)

mysql> select count(*) from game_log_ng where match(log) against("+nano"
in boolean mode);
+----------+
| count(*) |
+----------+
|  5127025 |
+----------+
1 row in set (33,93 sec)

mysql> select count(*) from game_log_ng where log like "%nano%";
+----------+
| count(*) |
+----------+
|  5127025 |
+----------+
1 row in set (2,93 sec)

mysql>


Hvordan kan det være, at den version, som bruger index tager mere end 10
gange så lang tid som den version, der IKKE bruger index ?
Jeg har også prøvet med andre ord så jeg kunne være sikker på, at MySQL
ikke brugte query cache eller omskrev mit query.

VH
Robert



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2010-05-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *