Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are performing the filterings on a joined table 'SearchArea', no wonder it takes so long. </p> <p>What your query does is, get all Products, join all the tables and then only keep what matches your filter. Your query should do the following, search SearchArea that have what your looking for and then only join the tables.</p> <p>You should rewrite your query like so:</p> <pre><code>SELECT Product.*, MainImage.*, Currency.rate, Category.green_tax, CategoriesCategory.full_alias, (Product.price*Currency.rate + Category.green_tax)*1.24 as real_price, MATCH (SearchArea.Cname,SearchArea.Mname,SearchArea.Pname,SearchArea.description,SearchArea.special_description,SearchArea.model,SearchArea.part_number,SearchArea.series,SearchArea.color,SearchArea.big_string) AGAINST ('+search term' IN BOOLEAN MODE) as score FROM search_areas AS `SearchArea` LEFT JOIN `products` AS `Product` ON (`SearchArea`.`id` = `Product`.`id`) LEFT JOIN currencies AS `Currency` ON (`Product`.`currency` = `Currency`.`code`) LEFT JOIN categories AS `Category` ON (`Product`.`category_id` = `Category`.`id`) LEFT JOIN manufacturers AS `Manufacturer` ON (`Product`.`manufacturer_id` = `Manufacturer`.`id`) LEFT JOIN categories_categories AS `CategoriesCategory` ON (`Product`.`category_id` = `CategoriesCategory`.`category_id`) LEFT JOIN `product_images` AS `MainImage` ON (`MainImage`.`product_id` = `Product`.`id` AND `MainImage`.`main` = 1) WHERE MATCH (`SearchArea`.`Cname`,`SearchArea`.`Mname`,`SearchArea`.`Pname`,`SearchArea`.`description`,`SearchArea`.`special_description`,`SearchArea`.`model`,`SearchArea`.`part_number`,`SearchArea`.`series`,`SearchArea`.`color`,`SearchArea`.`big_string`) AGAINST ('+search term' IN BOOLEAN MODE) AND `Product`.`active` = 1 LIMIT 15 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload