Why Looker filter field with suggestion run a query for each letter entered?

In Looker, when using a filter field with suggestions (e.g., company_name), placing the cursor in the box immediately triggers a database query to fetch distinct values. As I start typing a value, like "google", Looker continues to issue queries with incremental filters:

  • company LIKE '%g%'
  • company LIKE '%go%'
  • company LIKE '%goo%'
  • ...

These queries stack up in my database queue. Is this expected behavior? You can imagine the number of unnecessary queries being sent to the database, which becomes a significant burden, especially with larger tables. The queries remain active and are not canceled until the browser is closed.

If we cannot change this behavior, what is the best practice for using filter suggestions? It seems we should only enable suggestions (with database queries) if: (a) The database table is small, or (b) Suggestions are really crucial for user experience.

What are your thoughts on this?

 

 

0 1 132
1 REPLY 1

Hi @jack95008 

I have just tried on my end and I really only see one filter suggestion query under Admin - Queries. I dont see behavior you described on the DB side either.

Can you please clarify a few things:

  • What are you connecting to?
  • What type of filter have you created (is,contains,etc)
  • Is that happening on explore or dashboard level?
  • Are you using a suggest_dimension in the dim definition?
  • Are you persisting the suggestion?

Thanks
Marc

Top Labels in this Space
Top Solution Authors