From 9aac9d34f799931259ad1f4e47de5df36735fc38 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 25 Jun 2024 16:28:43 -0400 Subject: [PATCH] perf(spans): Remove transaction_id from PREWHERE for spans (#6065) There is no index on `transaction_id` nor is it part of the table's ORDER BY. Because of this, promoting conditions on the `transaction_id` to the PREWHERE clause actually slows down the query quite significantly. --- snuba/datasets/configuration/spans/storages/spans.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snuba/datasets/configuration/spans/storages/spans.yaml b/snuba/datasets/configuration/spans/storages/spans.yaml index 5a06b7ee64..faf8683c87 100644 --- a/snuba/datasets/configuration/spans/storages/spans.yaml +++ b/snuba/datasets/configuration/spans/storages/spans.yaml @@ -168,7 +168,7 @@ query_processors: - processor: PrewhereProcessor args: prewhere_candidates: - [transaction_id, span_id, trace_id, segment_name] + [span_id, trace_id, segment_name] - processor: TableRateLimit - processor: TupleUnaliaser