Skip to content

Search backend: optimize and/or queries for commit jobs

Administrator requested to merge cc/optimize-commit-jobs into main

Created by: camdencheek

This adds the Commit search job to this supported jobs that natively handle and/or queries. Commit search job construction already handles tree-like queries, so all I had to do was add it to the list of jobs that can be optimized.

For context, searches with type:commit or type:diff are executed by gitserver, and gitserver can handle queries with a tree-shaped pattern expression like a or b. However, we're currently not sending gitserver that tree, and instead we're splitting it up into an a query and a b query, then merging the results in frontend. This is much slower than just letting gitserver handle and/or queries. We recently added this optimization for zoekt, so this just extends it to also apply to commit and diff searches.

Test plan

Manually tested and checked the traces that we generate optimized commit search queries. Also added some autogold tests and checked that they look right.

Merge request reports

Loading