hi,
I am using the following query to retrieve records from the table:
SELECT *
FROM `table_name`
WHERE insertion_date = (
SELECT MIN(insertion_date)
FROM `table_name`
WHERE insertion_date <= '2025-03-22'
)
However, this query does not optimize the partitioning in the backend, resulting in a high resource consumption of 2.57 TB. When I use SET or DECLARE commands, the query partitions correctly and consumes only 180 GB. Unfortunately, I am unable to use SET or DECLARE in Look ML, which requires a solution to optimize partitioning without these commands.
For reference, the table size is 2.57 GB, and I need this query to be used in LookML.