Skip to content

x/pkgsite: optimize database queries #76284

@findleyr

Description

@findleyr

As we've seen in #75959 (comment), there is some low hanging fruit in pkgsite's database queries. Since we've been analyzing our queries recently, we should take this opportunity to implement some tactical optimizations.

Specifically, here are some operations that could be faster:

Worker

Frontend

  • serving documentation is dominated by an index scan to compute the number of imports for a package. But this is completely deterministic at ingestion time, and could be denormalized.
  • loading directories is the other major source of cost in serving a documentation page. We could partially denormalize this information, and/or defer loading all the directories until the user actually expands the directory viewer.

We don't need to do all of these, and we may find others as we optimize away the lowest hanging fruit.

CC @jba @ethanalee-work

Metadata

Metadata

Labels

FeatureRequestIssues asking for a new feature that does not need a proposal.pkgsite

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions