Filter box slow
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [x] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
Superset version
0.18.5
Expected results
Fast filter box fields
Actual results
Slow (more than 20 seconds)
Steps to reproduce
This this actually simple, I just have a table with channel, username and content. When I use my own query to get unique channel in my side, it tooks around 10ms.
SELECT channel AS channel
FROM activity
GROUP BY channel;
The superset query:
SUM(activity.id) AS sum__id
FROM activity
WHERE datetime >= '2016-08-01 08:38:48'
AND datetime <= '2017-08-01 08:38:48'
GROUP BY channel
ORDER BY sum__id DESC
LIMIT 50000
In superset, we must use a metrics (count, avg ..), but in this case, the query is slow for nothing..SUM is irrelevant in this case but it's just to show you (I tried count, this doesn't help at all).
Is this normal ? Is the metric required ? Maybe another way to do it better ?
Try using the not group by columns to construct your table
@fufjvnvnf that's not an option in the Filter Box viz
@vschoener note that you can build a Filter Box by pointing to a smaller dimension table, the filter will still apply as long as the column name are the same on both datasources.
Indeed, I created a view containing unique channels name and it's working like a charm but I didn't find out why cause I use different source / table. But I though right about the name column :) It's perfect. Thank you !
The other problem with filter box causing it to be slow is that it triggers multiple queries for each filter control. I raised a similar issue here https://github.com/apache/incubator-superset/issues/3073
Notice: this issue has been closed because it has been inactive for 261 days. Feel free to comment and request for this issue to be reopened.