472,142 Members | 1,109 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

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 1450

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.