F
Filament15mo ago
ciorici

Cache/speed up large select options array

I have a select where the user searches through the database and chooses from a list of 144000 cities, and usually the query takes around 2 seconds or so for a Select field query. Is there a way/any recommendations on how I could speed this up?
4 Replies
awcodes
awcodes15mo ago
have you indexed the db column?
ciorici
ciorici15mo ago
Which one? Can you please explain this a bit more? Actually yes, sorry... I added the name of the city as an index, but I just found that there is a 1000ms debounce setting for the selects which only trigger the search after 1s, the query and result take les than 300ms.
Kenneth Sese
Kenneth Sese15mo ago
You can change the debounce on the select using ->searchDebounce() and then whatever number. I use 200
ciorici
ciorici14mo ago
Excellent, thank you!