Juliano Garcia
01/04/2024, 1:45 PMtest_result_rows
Essentially, it is consuming quite a lot of read bytes from my BigQuery.
We run the edr report and alerts every hour and based on the logs I see that it runs quite often the following query:
select
elementary_test_results_id,
result_row
from
`elementary`.`test_result_rows`
where
timestamp_diff(current_timestamp, cast(detected_at as TIMESTAMP), day) < 7
As what I could gather, this table stores the test result samples therefore it can get quite big the more tests we run (and we do have plenty!)
The problem is that, although this table is indeed partitioned on the detected_at field by day, with the above WHERE clause syntax BigQuery doesn't identify the partitions to read and ends up reading the whole table.
I faced this issue some weeks ago and truncated the table and added the following variable to my `dbt_project.yaml`:
vars:
test_sample_row_count: 0
However that didn't seem to work as the table is once again big and consuming quite a lot of bytes read in BigQuery.
Is there any way to resolve that other than constantly truncate this table?Ofek Weiss
01/08/2024, 2:31 PMJuliano Garcia
01/15/2024, 2:25 PMFredrik Örn
10/02/2024, 11:53 AMcast(detected_at as TIMESTAMP) that prevents BigQuery from using the partitions properly (+ that the table was initially created without partitions)
Running where detected_at >= timestamp_sub(current_timestamp(), interval 1 day) works like a charmThomas Langton
12/30/2024, 3:20 PMJoost Boonzajer Flaes
12/31/2024, 11:23 AMThomas Langton
06/24/2025, 8:55 AMJoost Boonzajer Flaes
06/24/2025, 8:57 AM