Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for fulltext query optimizer
Search options not deleted user 877
8 votes

Is there a way to hint to query optimizer to MySQL which constraints should be done first?

I have rather bad news for you in this regard MySQL Query Optimizer tends to stray away for further optimization once it sees a FULLTEXT index. … Optimizer detects a FULLTEXT search along with the conjunction AND followed by an expression within the same WHERE clause (thus, the same level of evaluation within an EXPLAIN plan), the MySQL Query Optimizer
RolandoMySQLDBA's user avatar
6 votes
Accepted

slow query with fulltext and left join

The problem lies in the fact that MySQL's Query Optimizer gets very confused when used in conjunction with other tables in an EXPLAIN plan's compliation. … optimization (Jan 26, 2012) MySQL EXPLAIN doesn't show 'use index' for FULLTEXT (May 07, 2012) My suggestion: Try Refactoring the Query By Getting the FULLTEXT Search to occur before JOINs SELECT * …
RolandoMySQLDBA's user avatar
5 votes
Accepted

Fulltext search using multiple indexes

Unfortunately, this is how MySQL Query Optimizer treats FULLTEXT indexes. When a MATCH clause is the only clause in the WHERE, the index will be used. … I wrote about this behavior before in Mysql fulltext search my.cnf optimization SUGGESTION : Rewrite the query as the union of two FULLTEXT searches SELECT * FROM content WHERE MATCH(a, b, c) AGAINST …
RolandoMySQLDBA's user avatar
9 votes
Accepted

Mysql fulltext search my.cnf optimization

QUERY Here is a little known fact about MySQL queries using a Full Table Index: There are occasions when the MySQL Query Optimizer stops using FULLTEXT indexes altogether and perform full table scans. … The MySQL Query optimizer basically barfed at it. …
RolandoMySQLDBA's user avatar
2 votes

Why is LIKE more than 4x faster than MATCH...AGAINST on a FULLTEXT index in MySQL?

Every time there is a query involving a FULLTEXT index, the MySQL Query Optimizer tends to whack the query into a full table scan. I have seen this over the years. … As I mentioend earlier, using FULLTEXT indexes tends to nullify any benefits attempted and contributed by the MySQL Query Optimizer. …
RolandoMySQLDBA's user avatar
2 votes

Mysql fulltext boolean ignore phrase

I tend to be a little conservative and cautious when using FULLTEXT indexes because FULLTEXT indexes has a nasty habit of playing head games with the MySQL Query Optimizer. … Go with the first query. Give it a Try !!! …
RolandoMySQLDBA's user avatar
4 votes

Less restrictive query return less result due to simple removing one additional constraint

The FULLTEXT index acts very funny with regard to the MySQL Query Optimizer. … my.cnf optimization (Jan 26, 2012) MySQL EXPLAIN doesn't show 'use index' for FULLTEXT (May 07, 2012) Try refactoring your first query so that the FULLTEXT clause and the Spatial clause are not performed …
RolandoMySQLDBA's user avatar
2 votes

MySQL EXPLAIN doesn't show 'use index' for FULLTEXT

Query Optimizer will not use the index and will go with a table scan or an index scan instead. … FULLTEXT indexes tends to get thrown the Query Optimizer under the bus at the most inconvenient times. I wrote about that back in Jan 26, 2012. …
RolandoMySQLDBA's user avatar
4 votes
Accepted

How to make a FULLTEXT search with ORDER BY fast?

The Query Optimizer's reaction to a FULLTEXT index. Why ? (Now imagine the start of a STAR WARS movie with scrolling words...) … A very long time ago, I discovered that FULLTEXT indexes will nullify the MySQL Query Optimizer's use of other indexes Jun 10, 2011 : Mysql fulltext boolean ignore phrase Oct 25, 2011 : FULLTEXT index …
RolandoMySQLDBA's user avatar
4 votes
Accepted

FULLTEXT index ignored in BOOLEAN MODE with 'number of words' conditional

The MySQL Query Optimizer tends to get sidetracked very easily when using a FULLTEXT index. I also have very good news for you. I wrote about this in StackOverflow on how to get around it. … You may have to nest your original query in a subquery and return the MATCH function as a column. Then, evaluate the MATCH column outside of the subquery. …
RolandoMySQLDBA's user avatar
2 votes

How can I rewrite the following removing the date_format function?

Leaving the t1.when on the left side of the comparison (left side of the equal sign) obligates the MySQL Query Optimizer to try using the index. … other posts going back to 2011 that discuss how searching a FULLTEXT index cause the MySQL Query Optimizer to stop using other indexes (since you have to use the MATCH function on the left side). …
RolandoMySQLDBA's user avatar
6 votes
Accepted

Multi-Column Full Text Search Going Very Slow

PROBLEM From the posts in your question, I see 3 FULLTEXT indexes. There is one for each column. Why did the query work at all ? MySQL worked with whatever it had. … That's what the MySQL Query optimizer decided on. …
RolandoMySQLDBA's user avatar
1 vote

Joining two Mysql VIEWs takes a very long time

While FULLTEXT index searches do work, the MySQL Query optimizer tends to suggest full table scans if you do not express the query properly. … How do I optimize this? Given the information I just mentioned let's take your query and refactor it to handle the FULLTEXT and stilldo a good join. …
RolandoMySQLDBA's user avatar
1 vote

Is inserting in a MySQL table with a Full-Text index really slow?

If it calls for a FULLTEXT index, make sure you have the with combination of columns. You will also need to focus on structuring your queries so that using a FULLTEXT index is worth it. … Sometimes, the MySQL Query Optimizer tends to butt heads with FULLTEXT indexes and ends up ignoring them unless you design the query properly. …
RolandoMySQLDBA's user avatar
6 votes

Full text search results in a large amount of time spent in 'FULLTEXT initialization'

Status : No Feedback SELECT query hang in state FULLTEXT initialization Oct 17, 2014 MySQL 5.6.19 Status : Won't Fix Since the MySQL Documentation is very terse on this thread state FULLTEXT … I have recommended this many times before May 14, 2012 : slow query with fulltext and left join Mar 18, 2012 : Why is LIKE more than 4x faster than MATCH...AGAINST on a FULLTEXT index in MySQL? …
RolandoMySQLDBA's user avatar

15 30 50 per page