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 be out of memory easily 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 after 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.
Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.
Most helpful comment
Issue-Label Bot is automatically applying the label
#enhancementto this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!Links: app homepage, dashboard and code for this bot.