From cd2bed0f1716b0485f0394dd661130531c1804b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Tue, 1 Oct 2024 17:54:20 +0200 Subject: [PATCH] fix(batch-exports): Enable aggregation in order optimization (#25312) --- posthog/temporal/batch_exports/batch_exports.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/posthog/temporal/batch_exports/batch_exports.py b/posthog/temporal/batch_exports/batch_exports.py index 5fa8825dfff5d..4c1114cfb2cdf 100644 --- a/posthog/temporal/batch_exports/batch_exports.py +++ b/posthog/temporal/batch_exports/batch_exports.py @@ -59,7 +59,8 @@ -- This is half of configured MAX_MEMORY_USAGE for batch exports. -- TODO: Make the setting available to all queries. max_bytes_before_external_group_by=50000000000, - max_bytes_before_external_sort=50000000000 + max_bytes_before_external_sort=50000000000, + optimize_aggregation_in_order=1 """ SELECT_FROM_EVENTS_VIEW = Template(