Skip to content
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

limit select queries via session properties #24896

Open
paragor opened this issue Feb 4, 2025 · 3 comments
Open

limit select queries via session properties #24896

paragor opened this issue Feb 4, 2025 · 3 comments

Comments

@paragor
Copy link

paragor commented Feb 4, 2025

In our company we use trino with redash.
Sometimes people try to fetch large dataset from trino and it is crash redash. Because redash try to persist all query result to postgresql.

There is issue getredash/redash#7309 for redash. But due complex query in trino (with CTE, UNIONs, etc...) it will not be work for all cases (see trick for detect select query in redash https://github.com/getredash/redash/blob/2776992101a93ef205daee4cc6bc68c42d77f114/redash/query_runner/__init__.py#L294).

So i suggest to add new properties for session that add can force limit for select queries.

I think this is will be useful for another dashboards system too (like grafana, tableau).

@wendigo wendigo changed the title feature requests for limit select queries via session properties limit select queries via session properties Feb 4, 2025
@wendigo
Copy link
Contributor

wendigo commented Feb 4, 2025

@martint is this something we can consider to implement?

@raunaqmorarka
Copy link
Member

I didn't find clear examples where other engines have added the ability to inject a LIMIT clause automatically into the submitted query. It seems common practise to do this in the client submitting the query or through some proxy sits between client and the engine (pg_rewrite).

@paragor
Copy link
Author

paragor commented Feb 21, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants