469,645 Members | 1,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Searching in Boolean mode with double quotes far too slow

Hello there,

We got a problem atm with our 20k database. Everytime we search for sth. with double quotes it takes much more longer than without.

Here is what we did:

mysql> SELECT COUNT(*) FROM `Pages` WHERE MATCH (`Text`) AGAINST ('"term"' IN BOOLEAN MODE);
+----------+
| COUNT(*) |
+----------+
| 3572 |
+----------+
1 row in set (6.58 sec)

mysql> SELECT COUNT(*) FROM `Pages` WHERE MATCH (`Text`) AGAINST ('term' IN BOOLEAN MODE);
+----------+
| COUNT(*) |
+----------+
| 3572 |
+----------+
1 row in set (0.13 sec)
CREATE TABLE `Pages` (
`ID` int(11) NOT NULL default '0',
`Title` varchar(255) NOT NULL default '',
`Text` mediumtext NOT NULL,
PRIMARY KEY (`ID`),
FULLTEXT KEY `Text` (`Text`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
mysql> EXPLAIN SELECT COUNT(*) FROM `Pages` WHERE MATCH (`Text`) AGAINST ('term' IN BOOLEAN MODE);
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | Pages | fulltext | Text | Text | 0 | | 1 | Using where |
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
1 row in set (0.01 sec)

mysql> EXPLAIN SELECT COUNT(*) FROM `Pages` WHERE MATCH (`Text`) AGAINST ('"term"' IN BOOLEAN MODE);
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | Pages | fulltext | Text | Text | 0 | | 1 | Using where |
+----+-------------+-------+----------+---------------+------+---------+------+------+-------------+
1 row in set (0.01 sec)
We know that in that case we didn't need to search with quotes; this e.g. has been used for comparison reasons.

If some of you got any idea how to fasten up the search please let us know!

With best regards,
Malte Fiala
Jun 26 '06 #1
0 1393

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Jakanapes | last post: by
5 posts views Thread by Mad Scientist Jr | last post: by
2 posts views Thread by Matt | last post: by
33 posts views Thread by Geoff Jones | last post: by
reply views Thread by phillip.s.powell | last post: by
3 posts views Thread by bob | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.