piby
07/10/2024, 10:29 AMXiang Fu
piby
07/10/2024, 12:19 PMXiang Fu
piby
07/10/2024, 4:46 PMSELECT * FROM my_table
WHERE processing_time > CAST(ago(”P7D") AS TIMESTAMP)
I assume this then queries only the files from last week and hence the query should take same time whether the data in the table is from last 6 months or last 6 years as it should not depend on table size.
Now, for this table for example, I now want to make the query
SELECT * FROM my_table
WHERE begin BETWEEN "2022-01-01“ AND ”2022-01-08“
This query results in timeout where table size is 50GB. Here the data could be present across multiple files which were stored after 2022-01-01. I have tried to add a range index on begin column but it didn't improve things.
Now we are thinking to repartition data using begin as partion key in S3 and create a separate table with this duplicate data. We will maintain one parquet file per day (of begin column). When we receive new data for that begin date again, we append to that file and regenerate segment for that file.