Skip to content

Query optimization - #677

Merged
stephenfin merged 7 commits into
mainfrom
query-optimization
Oct 16, 2026
Merged

stephenfin merged 7 commits into
mainfrom
query-optimization

Conversation

@stephenfin

Copy link
Copy Markdown
Member

Add a synthetic data generator to help us test performance at scale. This highlights a number of obvious API and model changes to improve performance.

Commits:

  • Add synthetic data generator for performance testing
  • api: Reuse embedded serializers
  • api: Avoid fetching patch bodies when listing series
  • api: Optimize patch list pagination and ordering
  • api: Avoid per-reply parent queries
  • models: Index project patch filtering and name ordering
  • models: Index project series ordering

Add a new 'generate_perf_data' management command that allows us to
generate projects, series and patches for testing purposes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
Reuse each bound field's serializer instead of rebuilding its fields for
every related object.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
Defer the content, diff and headers fields when prefetching embedded
patches: these are not used or needed.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Page over patch IDs before loading joined rows, and add indexes for
project-scoped ID and date ordering.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
Load comment parents and projects when archive URLs are exposed, without
fetching unused parent message bodies.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
Cover project/submitter lookups and project/name ordering and
substring-search counts.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
Support project-scoped name and date ordering without sorting all
series.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Assisted-by: OpenAI gpt-6.1-sol (via pi)
@stephenfin
stephenfin added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit bd0d6ae Oct 16, 2026
11 checks passed
@stephenfin
stephenfin deleted the query-optimization branch October 16, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant