Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Filter on jsonb hash so planner can use index
Browse files Browse the repository at this point in the history
Recent changes in the promscale extension introduced index on jsonb hash.
  • Loading branch information
niksajakovljevic committed May 3, 2022
1 parent 0d30f11 commit 75c2ac4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/jaeger/query/get_operations.go
Expand Up @@ -26,7 +26,7 @@ WHERE
FROM _ps_trace.tag
WHERE key = 'service.name'
AND key_id = 1
AND value = to_jsonb($1::text)
AND _prom_ext.jsonb_digest(value) = _prom_ext.jsonb_digest(to_jsonb($1::text))
)
AND %s
`
Expand Down
2 changes: 1 addition & 1 deletion pkg/jaeger/query/trace_query.go
Expand Up @@ -156,7 +156,7 @@ func buildTraceIDSubquery(q *spanstore.TraceQueryParameters) (string, []interfac
FROM _ps_trace.tag
WHERE key = 'service.name'
AND key_id = 1
AND value = to_jsonb($%d::text)
AND _prom_ext.jsonb_digest(value) = _prom_ext.jsonb_digest(to_jsonb($%d::text))
)`, len(params))
operation_clauses = append(operation_clauses, qual)
}
Expand Down

0 comments on commit 75c2ac4

Please sign in to comment.