471,073 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Easy SELECT with OR takes a very long time. Why?

We've got a database with about 1000000 books. A query in the table
BOOKS for the TITLE 'java' is very fast. We have a fulltext index on
the column TITLE.

However, if we want to do a exact same query and include the rule that
the book with ISBN '0131016210' always should be included - then the
query take several seconds to finish:

SELECT * FROM C_BOOK WHERE MATCH(NAME) AGAINST ('java') AND (ISBN LIKE
'0%' OR ISBN LIKE '1%') OR ISBN = '0131016210'

ISBN is the PRIMARY KEY.

Is there anything I can do about this?

Leif
Jul 19 '05 #1
0 1739

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Tino Lange | last post: by
1 post views Thread by Robin Becker | last post: by
reply views Thread by Leif Wessman | last post: by
3 posts views Thread by Tcs | last post: by
5 posts views Thread by parwal.sandeep | 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.