MySQL Forums
Forum List  »  Optimizer & Parser

selects with multiple categories
Posted by: Marek Podmaka
Date: March 12, 2008 09:28AM

We are using application (which is quite optimized, but not in this particular case) which stores posts in various categories.
The category field contains comma-separated list of category-ids and so the select query looks like this:
SELECT ... WHERE category regexp '[[:<:]](124|15|18)[[:>:]]'
which of course can't use any indexes.

Is it somehow possible to optimize/rewrite this query without changing the table structure? I know the best would be to have special table with multiple rows of post_id+categ_id, but that would require a lot of work.

Options: ReplyQuote


Subject
Views
Written By
Posted
selects with multiple categories
4048
March 12, 2008 09:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.