Skip to content

Improve performance of REFRESH MATERIALIZED VIEW #2253

Closed

Description

@mhuangpivotal

What challenge are you facing?

On our wings deployment, our SLI pipeline had accumulated over 500,000 builds. Running the query REFRESH MATERIALIZED VIEW CONCURRENTLY transition_builds_per_job (the longest of the three) was taking more than 30 seconds. With lots of builds finishing in quick succession, we were seeing the db in locked-up state due to the slow queries.

A Modest Proposal

  • Investigate ways to optimize the query
  • Instead of using materialized view, could we use a column on the builds table instead to keep track of the transition build?

Activity

  1. jama22 commented on Jun 4, 2018

    @jama22

    Let's investigate this now that @xtremerui fixed our slowness. This might have been a red herring because the entire system was slow

  2. nader-ziada commented on Jun 13, 2018

    @nader-ziada
    Contributor

    After clearing out the builds table and removing the check_order index, this query is way faster and has not since slowed down. We're calling this issue a red herring.

  3. modified the milestone: v4.0.0 on Jul 16, 2018
  4. removed this from the v4.0.0 milestone on Jul 16, 2018
  5. keithkroeger commented on Mar 22, 2019

    @keithkroeger

    Hello @vito,

    This looks like it won't be fixed based on tagging.

    Is there any index that can be added while we wait to upgrade to 5.0.0?

    Thank you

  6. xtremerui commented on Mar 22, 2019

    @xtremerui
    Contributor

    @keithkroeger what version of concourse are you running? These views transition_builds_per_job for example, is not used after v4.2 and thus I believe this issue is not valid anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions