From 28be6b1fc695addcb8b0b517c26ca244295f3790 Mon Sep 17 00:00:00 2001 From: Colin Chartier Date: Tue, 17 Sep 2024 11:32:44 -0400 Subject: [PATCH] fix: perf --- snuba/web/rpc/trace_item_values.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snuba/web/rpc/trace_item_values.py b/snuba/web/rpc/trace_item_values.py index 38273c24f4..539000cdc9 100644 --- a/snuba/web/rpc/trace_item_values.py +++ b/snuba/web/rpc/trace_item_values.py @@ -65,7 +65,11 @@ def _build_query(request: AttributeValuesRequest) -> Query: ), groupby=[column("attr_value", alias="attr_value")], order_by=[ - OrderBy(direction=OrderByDirection.ASC, expression=column("attr_value")) + OrderBy( + direction=OrderByDirection.ASC, expression=column("organization_id") + ), + OrderBy(direction=OrderByDirection.ASC, expression=column("attr_key")), + OrderBy(direction=OrderByDirection.ASC, expression=column("attr_value")), ], limit=request.limit, offset=request.offset,