472,126 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Dual FULLTEXT index search: am I out of luck?

I read a while back that MySQL will only use one index per query. (If this
is not so, please tell me and point me to a doc that gives a good
explanation of MySQL's current index usage policy). I'm using MySQL 4.2.x.

Here's my dilemma.

1) ---------

I have two tables that have records with a FULLTEXT index text field in each
of them. The problem is the relationship between the tables is a
one-to-many relationship. I'll make some dummy info to make it easier to
describe the problem:

Table 1: "tableOne"

field: "user_info", text - FULLTEXT indexed

Table 2: "tableMany"

field: "user_comment", text - FULLTEXT indexed

There are many "tableMany.user_comment" records per "tableOne.user_info"
record. So if I want to offer a FULLTEXT search of all the across all the
"user_info" records and all the "user_comment" records, my guess is that
MySQL will reduce it to a fast FULLTEXT search of one of the tables, and
then sequentially search the second? Is that correct?

If so, with the size of my database and the number of requests per day my
server handles, I could not reasonably support that search on my server.

Any thoughts or creative ideas here?

2) -------------------

Just to clarify my knowledge:

If I have a query like:

SELECT * FROM dummy_table WHERE MATCH(some_text_field) AGAINST ("+some
words" IN BOOLEAN MODE) AND user_id=9898989;

Then even if "some_text_field" is FULLTEXT indexed AND user_id is regular
indexed, only one of these indices will be used during the query, is that

3) -----------------

Also, if an SQL query accesses multiple tables, like in a JOIN, does the one
index per query rule still apply? Or is it one index per table per query (I

Aug 25 '05 #1
0 1343

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Phil Powell | last post: by
reply views Thread by Peter Engström | last post: by
reply views Thread by Matt W | last post: by
reply views Thread by Phil Powell | last post: by
1 post views Thread by Robert Oschler | last post: by
1 post views Thread by saavedrajj | 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.