You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/11/13 13:55:42 UTC

[GitHub] [incubator-superset] WChCh opened a new issue #8555: Global "prequery" for dashboard

WChCh opened a new issue #8555: Global "prequery" for dashboard
URL: https://github.com/apache/incubator-superset/issues/8555
 
 
   My dashboard has many charts,  the query written by jinja template in every chart has the same sub query like `book in (select book from library group by book order by count(book) desc limit 3) ` or  `book in (select book from library group by book order by count(book) desc limit 1) `. The queries with same sub query  away take long time and easy to be out of memory for big data!  So a "prequery" is very useful for long running query.
   
   "prequery" had worked for Druid in #4163,  but it could not work for all db engine, and other charts could not share the same topN result. 
   
   So a new feature is that, the "prequery" should execute when triggering  filter box, and we get the result of Top 3, then the query in each chart get the result of Top 3  or the Top1 from the  result of Top 3 as the `where in ` condition, example like that:
   ```
   select book from library group by book order by count(book) desc limit 3
   ```
   The result of Top 3 is `book1, book2, book3`
   so we can use `book in ('book1')`  as the Top 1 condition, use `book in ('book1','book2','book3')` as the Top 3 condition, the most Important is that the "prequery" just run one time for all charts, and don`t  need any nested sub query.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org