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(