473,382 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 1514

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
5
by: Mad Scientist Jr | last post by:
Has anyone worked on code that that can parse evaluation expressions (could be numbers or strings) like ( ( "dog" = "dog" ) or "foo" = "bar" ) and ("cow" = "bat" and "bye" = "hi") or ("math" =...
5
by: Matt | last post by:
I have a simple JS function that I want to return a true or false value based on the parameter passed in. At this point of time I receive the error "'True' is undefined". Here is my code below. ...
2
by: Matt | last post by:
I have a simple JS function that I want to return a true or false value based on the parameter passed in. At this point of time I receive the error "'True' is undefined". Here is my code below. ...
2
by: name | last post by:
The piece of code is for a Web Form Page. Who can tell me why? Thanks a lot! ------------------------------------------------ VB.Net Code: Protected Overrides Sub AddParsedSubObject(ByVal obj As...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
0
by: phillip.s.powell | last post by:
SELECT id, student_first_name, student_last_name, major, minor , MATCH(major, minor) AGAINST ('"mechanical engineering"') AS score FROM students WHERE MATCH(major, minor) AGAINST ('"mechanical...
3
by: bob | last post by:
Hi I have a long regex string that needs to match the quote char. It is matching a CSV text file where all data fields are encased in quotes. Some fields are empty ie double quotes. I want to make...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.