[Bug]: Long Dropdown Loading time when several values are selected by default
Describe the bug
When working with many distinct values and dropdown filters, the loading time is impacted, making the dashboard impossible to use. See loom video
Steps to Reproduce
https://www.loom.com/share/6d5e4bbee84c49d9a677b55c16111107
Related to inlining all the default values in the array into the where clause
Would changing the behavior of selectAllByDefault or allowing a selectNoneByDefault that returns null or a value that lets us write SQL to skip the where clause when nothing is selected in a multi-select dropdown solve the performance issue? I'm experiencing a similar issue from a usability perspective. I'd rather have the multi select uncheck everything by default, which means return all data, and then filter it down with a few selections when needed.
However, the current behavior on first load with nothing selected causes the queries to hang:
Making a selection, and then deselecting, still returns (select null where 0) without the comment, but now the queries process: