superset icon indicating copy to clipboard operation
superset copied to clipboard

Filter box slow

Open vschoener opened this issue 9 years ago • 6 comments

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 ?

vschoener avatar Aug 01 '17 08:08 vschoener

Try using the not group by columns to construct your table

fufjvnvnf avatar Aug 02 '17 06:08 fufjvnvnf

@fufjvnvnf that's not an option in the Filter Box viz

mistercrunch avatar Aug 02 '17 15:08 mistercrunch

@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.

mistercrunch avatar Aug 02 '17 15:08 mistercrunch

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 !

vschoener avatar Aug 03 '17 09:08 vschoener

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

vibinsv09 avatar Aug 04 '17 20:08 vibinsv09

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.

mistercrunch avatar Apr 23 '18 07:04 mistercrunch