-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Idea] Limit setting for queries #270
Comments
Hey @VicenteFava, thanks for the suggestion! For the database, it's best to set a statement timeout to limit the impact of individual queries. For the server, it'd be good to benchmark where most of the time is spent for large result sets to help decide what to do and test potential solutions. I think a |
Hi @ankane, we are using Blazer for some visualizations as well as custom reports. We'd also like to have something like a I've looked at the code and there are several ins and outs that make it hard to know the best place to introduce this limit. We're just looking for a limit on what is displayed in a tabular view. Limiting data for charts isn't a focus for us at the moment. Just tabular view, with the ability to then download the full results. Could you give some pointers of where best to look at implementing this? I'm happy to put a PR together. Thanks! |
A nice feature in addition to this would be to impose the row limits on the display version of the results, but allow for downloading the CSV of the full report results. |
#311 PR has already addressed limiting the number of html views only. |
I've come across the problem in my organization, is there plans to introduce this feature? @Workman Is your fork public? |
Until the PRs are merged, I am using the following monkey patch. app/controllers/blazer/queries_controller.rb require Blazer::Engine.root.join('app/controllers/blazer/queries_controller.rb')
module BlazerQueriesControllerExtention
def render_run
if request.format == :html && Blazer.settings['row_limit']
@row_limit ||= Blazer.settings['row_limit']
end
super
end
end
Blazer::QueriesController.prepend(BlazerQueriesControllerExtention) config/blazer.yml row_limit: 5000 |
Hi,
What do you think about having a limit setting that applies to all the queries if it is set? The idea of this is to prevent the database or the server from having performance issues when executing queries that grab a large amount of data.
If you think that this can be helpful I can do a PR with the code. Thanks!
The text was updated successfully, but these errors were encountered: