Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292216

Combine fields filter won't use indexes

$
0
0

The 'Combine fields filter' assembles a query by concatenating all of the fields to be searched, separated by a single space between each, into a single string. This is then checked using LIKE '%sometargetword%' against the string. Using this approach means that no indexes are used on any of the included fields.

The default 'user_admin_people' view uses this filter by default for the "Name or email contains" exposed filter. An administrator is likely to enter a name, partial name or email address in order to locate a specific user. This means that a full table scan is required with additional concatenation to process the filter. On a large site with hundreds of thousands of users, this can be resource intensive.

For our use case, I'm creating a replacement plugin that creates a new WhereGroup of the appropriate type and operator to reference each of the fields individually. We have individual first and last name fields so can use 'Starts with' to ensure indexes are used on those and can add an exact email address search too.

I'm not sure what the answer is for core as we can't use full text indexes and MATCH without breaking abstraction.


Viewing all articles
Browse latest Browse all 292216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>