GitHub user Macielos edited a discussion: Allow manual configuration of filter 
values for dashboard filters

**Is your feature request related to a problem? Please describe.**
I've recently had to prepare a superset-based report for our business 
consisting of a table chart and a set of filters and spent quite a lot of time 
to configure fetching filter values so that it happens fast and is not costly 
for DB. 

**Describe the solution you'd like**
It would be great to add additional option in filter configuration for text 
filter type: just input filter values in dashboard filter configuration. 
Sometimes all values are known at start and are rarely changed, so why not just 
input them manually and avoid querying the database for them at all? I think it 
would be natural solution for filters on dictionary/enum based fields like 
types and statuses which is rather frequent use case. 

**Describe alternatives you've considered**
Right now Superset retrieves filter values by something like _select distinct 
myfield from mydataset where condition_, so it adds unnecessary stress to the 
database, even despite caching. I added a prefilter condition to only search 
items from one hour and added an index on my field, but:
1. The search is performed on original dataset which contains multiple joins on 
big tables, so it can still take about 10-15 seconds. Results are cached, but 
it still has negative impact on UX, because user cannot input his values while 
filter values are first being loaded. 
2. If I narrow the search too much, I risk missing some less frequent filter 
values. 
3. I can disable fetching values at all by adding condition as false, but then 
user would have to input them by hand every time. 
4. I also thought about using subquery in a prefilter condition to fetch 1 id 
for each field value in a union, but it wasn't working, I suppose you don't 
allow subqueries for security reasons - probably it's a good approach.

GitHub link: https://github.com/apache/superset/discussions/34841

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to