Hello,
We're using Finder to build an advanced search for our website. This allow us to offer to the user fine tuning search options.
I'm trying to optimize the performance of the finder, by taking a look at the queries.
- My content type, let's say a car, have a lot (+/- 12) of equipments like "Airbag", "ESP", "...".
In my finder form, the user is allowed to search for cars having specific equipments (I exposed this as checkboxes - multiple choices). I noticed that, for each equipment option the user checks, it generates a query like this :
LEFT JOIN drp_field_data_field_equipments_categories finder_table_17 ON node.nid = finder_table_17.entity_id AND (finder_table_17.entity_type = 'node' AND finder_table_17.deleted = '0')
LEFT JOIN drp_field_data_field_equipments_categories finder_table_18 ON node.nid = finder_table_18.entity_id AND (finder_table_18.entity_type = 'node' AND finder_table_18.deleted = '0')and later on, in the WHERE clause :
AND finder_table_17.field_equipments_categories_value = 'ABS' AND finder_table_18.field_equipments_categories_value = 'ESP'
I have the feeling that this slows the query (drp_field_data_field_equipments_categories has something like 4000 rows).
I don't understand why we have to create one LEFT JOIN for each user checked equipment category.
The generated query can take up to 40 minutes to finish when the user select 7 vehicle categories !
Any advise ?
Thank you in advance,
You did a great job for the Finder project
Comments
Comment #0.0
jmichelgarcia commentedremoved question
Comment #0.1
jmichelgarcia commentedimproved question
Comment #1
danielb commentedI guess even though multiple choices are a configuration option I never created a finder like that myself.