spatie / laravel-query-builder

Easily build Eloquent queries from API requests
https://spatie.be/docs/laravel-query-builder
MIT License
4.02k stars 395 forks source link

FiltersPartial index miss #820

Closed oceanapplications closed 1 year ago

oceanapplications commented 1 year ago

FiltersPartial is using LOWER() which causes index misses. Many collations are case insensitive so LOWER() is not necessary.

The LIKE expression uses % before the search value which also cases index misses. This is necessary at times but if it could be used optionally that would be ideal.

Perhaps instead of just FiltersPartial, we add FiltersBeginsWith and FiltersEndsWith as options to place % only at the beginning or end.