I have the following query:
select count(listingmerchandise.ListingID) as Count, CategoryDescription from categoryleaf, listingmerchandise where categoryleaf.LeafID =listingmerchandise.CategoryID and listingmerchandise.ListingDescription matches '%"gold"%' and listingmerchandise.BreadCrumbID matches '%~~281~~%' and categoryleaf.ParentID = 281 and categoryleaf.CategoryID <> 281 group by CategoryDescription order by CategoryDescription
The problem is the query takes too long. I have a compound metamorph index on listingmerchandise BreadCrumbID and ListingDescription. Any ideas on how to optimize this query.
select count(listingmerchandise.ListingID) as Count, CategoryDescription from categoryleaf, listingmerchandise where categoryleaf.LeafID =listingmerchandise.CategoryID and listingmerchandise.ListingDescription matches '%"gold"%' and listingmerchandise.BreadCrumbID matches '%~~281~~%' and categoryleaf.ParentID = 281 and categoryleaf.CategoryID <> 281 group by CategoryDescription order by CategoryDescription
The problem is the query takes too long. I have a compound metamorph index on listingmerchandise BreadCrumbID and ListingDescription. Any ideas on how to optimize this query.