php - Optimizing a MySQL search query with MATCH() AGAINST() -
i have query:
select `o`.`fruits_id` `fruits` `o` join `fruits_categories` `oc` on `o`.`fruits_id` = `oc`.`fruits_id` join `categories` `c` on `c`.`cat_id` = `oc`.`cat_id` join `fruits_location` `ol` on `o`.`fruits_id` = `ol`.`fruits_id` join `location` `l` on `l`.`location_id` = `ol`.`location_id` join `fruits_price` `op` on `o`.`fruits_id` = `op`.`fruits_id` join `price` `p` on `p`.`price_id` = `op`.`price_id` ( (match (c.cat_name) against ('apple') or match (l.location_name) against ('apple') or match (o.fruits_name, o.fruits_description, o.address, o.instagram_tag) against ('apple') or match (p.price_name) against ('apple') ) , (match (c.cat_name) against ('orange') or match (l.location_name) against ('orange') match (o.fruits_name, o.fruits_description, o.address, o.instagram_tag) against ('orange') or or match (p.price_name) against ('orange') ) ) limit 9
when run in phpmyadmin, takes 3 seconds process, think good.
but when run inside php file (results paginated), takes 11 seconds finished.
i'm guessing there still more optimized query can achieve result.
thanks , appreciate help.
b
Comments
Post a Comment