diff --git a/posthog/models/async_deletion/async_deletion.py b/posthog/models/async_deletion/async_deletion.py index d86ca18e8697a..a851fa513f526 100644 --- a/posthog/models/async_deletion/async_deletion.py +++ b/posthog/models/async_deletion/async_deletion.py @@ -1,9 +1,6 @@ from django.db import models -MAX_QUERY_SIZE = 2_621_440 - - class DeletionType(models.IntegerChoices): Team = 0 Person = 1 diff --git a/posthog/models/async_deletion/delete_cohorts.py b/posthog/models/async_deletion/delete_cohorts.py index 3593365657325..cbc6de0b75fd0 100644 --- a/posthog/models/async_deletion/delete_cohorts.py +++ b/posthog/models/async_deletion/delete_cohorts.py @@ -1,7 +1,7 @@ from typing import Any from posthog.client import sync_execute -from posthog.models.async_deletion import AsyncDeletion, DeletionType, MAX_QUERY_SIZE +from posthog.models.async_deletion import AsyncDeletion, DeletionType from posthog.models.async_deletion.delete import AsyncDeletionProcess, logger @@ -29,7 +29,7 @@ def process(self, deletions: list[AsyncDeletion]): WHERE {" OR ".join(conditions)} """, args, - settings={"max_query_size": MAX_QUERY_SIZE}, + settings={}, ) def _verify_by_group(self, deletion_type: int, async_deletions: list[AsyncDeletion]) -> list[AsyncDeletion]: @@ -50,7 +50,7 @@ def _verify_by_column(self, distinct_columns: str, async_deletions: list[AsyncDe WHERE {" OR ".join(conditions)} """, args, - settings={"max_query_size": MAX_QUERY_SIZE}, + settings={}, ) return {tuple(row) for row in clickhouse_result} diff --git a/posthog/models/async_deletion/delete_events.py b/posthog/models/async_deletion/delete_events.py index ed72ba59f0dfb..c794b3d54fe8b 100644 --- a/posthog/models/async_deletion/delete_events.py +++ b/posthog/models/async_deletion/delete_events.py @@ -3,7 +3,7 @@ from prometheus_client import Counter from posthog.client import sync_execute -from posthog.models.async_deletion import AsyncDeletion, DeletionType, MAX_QUERY_SIZE +from posthog.models.async_deletion import AsyncDeletion, DeletionType from posthog.models.async_deletion.delete import AsyncDeletionProcess, logger from posthog.settings.data_stores import CLICKHOUSE_CLUSTER @@ -66,7 +66,7 @@ def process(self, deletions: list[AsyncDeletion]): WHERE {str_predicate} """, next_args, - settings={"max_query_size": MAX_QUERY_SIZE}, + settings={}, ) # Reset the query predicate and predicate args args = rest_args @@ -80,7 +80,7 @@ def process(self, deletions: list[AsyncDeletion]): WHERE {str_predicate} """, args, - settings={"max_query_size": MAX_QUERY_SIZE}, + settings={}, ) # Team data needs to be deleted from other models as well, groups/persons handles deletions on a schema level @@ -106,7 +106,7 @@ def process(self, deletions: list[AsyncDeletion]): WHERE {" OR ".join(conditions)} """, args, - settings={"max_query_size": MAX_QUERY_SIZE}, + settings={}, ) def _verify_by_group(self, deletion_type: int, async_deletions: list[AsyncDeletion]) -> list[AsyncDeletion]: @@ -129,7 +129,7 @@ def _verify_by_column(self, distinct_columns: str, async_deletions: list[AsyncDe WHERE {" OR ".join(conditions)} """, args, - settings={"max_query_size": MAX_QUERY_SIZE, "max_execution_time": 30 * 60}, + settings={"max_execution_time": 30 * 60}, ) return {tuple(row) for row in clickhouse_result} diff --git a/posthog/models/async_deletion/delete_person.py b/posthog/models/async_deletion/delete_person.py index 5b906a761b604..92768e4e151d4 100644 --- a/posthog/models/async_deletion/delete_person.py +++ b/posthog/models/async_deletion/delete_person.py @@ -1,12 +1,10 @@ from posthog.clickhouse.client import sync_execute -from posthog.models.async_deletion import MAX_QUERY_SIZE - from posthog.clickhouse.client.connection import Workload def remove_deleted_person_data(mutations_sync=False): - settings = {"mutations_sync": 1 if mutations_sync else 0, "max_query_size": MAX_QUERY_SIZE} + settings = {"mutations_sync": 1 if mutations_sync else 0} sync_execute( """ ALTER TABLE person