[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

FullText & Join index

Asked by Stevod2 in MySQL Server

Tags: mysql fulltext index join

I have one table with a full text index, and another table to which I need to join, based on an ID field in the fulltext table. I can't get the join query to use non-fulltext table's index to do a ref join; it insists on doing an index scan on the second table. Is there any way to avoid the index scan?

The query is
SELECT
dm.MessageID, sm.DBID
FROM
tdistinctmessages dm,
tSite_messages sm
WHERE MATCH (dm.message) AGAINST ('"microsoft support"' IN BOOLEAN MODE)
AND dm.MessageID=sm.MessageID

Table definitions are:

CREATE TABLE `tdistinctmessages` (
  `message` VARCHAR(150) COLLATE latin1_general_ci NOT NULL,
  `MessageID` INT(10) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY  (`message`,`MessageID`),
  FULLTEXT KEY `FTIX_Message` (`message`)
) ENGINE=MYISAM AUTO_INCREMENT=26935581 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci


CREATE TABLE `tsite_messages` (
  `DBID` INT(10) NOT NULL,
  `wordID` BIGINT(20) UNSIGNED DEFAULT NULL,
  `MessageID` INT(10) DEFAULT NULL,
  `Repetition` INT(10) NOT NULL DEFAULT '0',
  `Emphasis` INT(10) NOT NULL DEFAULT '0',
  KEY `IX_DBID_WordID_MessageID_Repetition` (`DBID`,`wordID`,`MessageID`,`Repetition`),
  KEY `NewIndex1` (`MessageID`,`DBID`,`Repetition`)
) ENGINE=MYISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci

EXPLAIN IS

      possible_keys      key      key_len      ref      rows      Extra
1      SIMPLE      dm      fulltext      FTIX_Message      FTIX_Message      0            1      Using where
1      SIMPLE      sm      index      NewIndex1      NewIndex1      13      \N      27892950      Using where; Using index
[+][-]11/02/09 04:08 PM, ID: 25725086Accepted Solution

Your question has an Asker Certified™ answer! Stevod2 verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zone: MySQL Server
Tags: mysql fulltext index join
Sign Up Now!
Solution Provided By: virmaior
Participating Experts: 1
Solution Grade: A
 
[+][-]12/04/09 03:09 PM, ID: 25976518Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100315-EE-VQP-143 - Hierarchy / EE_QW_3_20080625