Jons Cyriac
01/27/2023, 8:11 AMPeyton Runyan
01/28/2023, 12:40 AMJons Cyriac
01/31/2023, 4:43 AMBRIN stands for Block Range Index. BRIN is designed for handling very large tables in which certain columns have some natural correlation with their physical location within the table.
since logs are usually appended to storage, i think this would be a good fir for the index.
I have replaced the btree index on timestamp and used BRIN instead in the log table having around 40 million records. before it used to time out everytime. And with BRIN, query response is well below a second.Peyton Runyan
01/31/2023, 1:53 PMPeyton Runyan
01/31/2023, 2:38 PMJons Cyriac
02/01/2023, 9:49 AMSELECT log.id, log.created, log.updated, log.name, log.level, log.flow_run_id, log.task_run_id, log.message, log.timestamp
FROM log
WHERE log.level >= 1::integer AND log.flow_run_id IN ('5f0ee065-7e29-41d4-8513-1327b186ddd8'::uuid) ORDER BY log.timestamp DESC
LIMIT 500::integer OFFSET 0::integer