Guarding queries on a view from filtering on specific columns #25917
Unanswered
mstowe-digi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a view in Trino that joins a materialized view from an iceberg table for dimensions and a mysql table for facts.
Queries that are submitted to the view need to be anchored with 2 specific columns that the mysql table is indexed by to avoid full table scans. This is a large table with a lot of telemetry data that is indexed by a deviceId and timestamp.
When querying the final view we want to ensure that queries have a where clause that include deviceId at the very least so that the mysql table is not hit for a full table scan, and if that query parameter is missing error out/short-circuit the query, or something of that nature that protects the underlying database from really generic queries.
Can anyone advise on a strategy?
Thanks,
Matt
Beta Was this translation helpful? Give feedback.
All reactions