Skip to content

Build: reducing query count, prefetching, or intermediate tables #11631

@agjohnson

Description

@agjohnson

After a few different attempts, it seems like the query complexity added with prefetching causes queries to take much longer than without prefetching (however query count is much much lower, 30 vs 120 queries).

For more background on the removal, see:

The most expensive queries here are getting the latest build (which I think can be external) and getting the latest, non-external, successful build.

Some options here are:

  • Use caching after database query. Saves some lookups but initial is still expensive and savings inconsistent.
  • Use materialized views to cache at the database level. Managing these views is harder and outside ORM
  • Use an intermediate table for latest/latest successful build on Project. This requires updating the relationship after each build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions