Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency table loads for quite long for some channels #4045

Open
premun opened this issue Oct 14, 2024 · 5 comments
Open

Dependency table loads for quite long for some channels #4045

premun opened this issue Oct 14, 2024 · 5 comments

Comments

@premun
Copy link
Member

premun commented Oct 14, 2024

Example: https://product-construction-prod.wittysky-0c79e3cc.westus2.azurecontainerapps.io/channel/5173/github:dotnet:sdk/build/latest

@oleksandr-didyk
Copy link
Contributor

oleksandr-didyk commented Nov 5, 2024

We seem to be spending a lot of time waiting for a response from the API, I'll check if we can do something about it
Image

@oleksandr-didyk
Copy link
Contributor

Since Maestro's BarViz is behaving the same and this issue seems to be on the API side, will remove the BarViz prefix

@oleksandr-didyk oleksandr-didyk changed the title [BarViz] Dependency table loads for quite long for some channels Dependency table loads for quite long for some channels Nov 6, 2024
@oleksandr-didyk
Copy link
Contributor

Ran local instance of BarViz against production database and confirmed that the extended duration of the call comes from the service waiting for a response from the database for certain builds that have a large graph (like the one in the example).

To speed up the request we would need to optimize the database query we perform, which I am not sure we want to spend time on now

CC: @premun

@premun
Copy link
Member Author

premun commented Nov 11, 2024

@oleksandr-didyk can you paste an example query so that we have that on hand whenever we decide to address this?

@oleksandr-didyk
Copy link
Contributor

oleksandr-didyk commented Nov 11, 2024

Query ID: 918460

(@id int)WITH traverse AS (
        SELECT
            BuildId,
            DependentBuildId,
            IsProduct,
            TimeToInclusionInMinutes,
            0 as Depth
        from BuildDependencies
        WHERE BuildId = @id
    UNION ALL
        SELECT
            BuildDependencies.BuildId,
            BuildDependencies.DependentBuildId,
            BuildDependencies.IsProduct,
            BuildDependencies.TimeToInclusionInMinutes,
            traverse.Depth + 1
        FROM BuildDependencies
        INNER JOIN traverse
        ON BuildDependencies.BuildId = traverse.DependentBuildId
        WHERE traverse.IsProduct = 1 -- The thing we previously traversed was a product dependency
            AND traverse.Depth < 10 -- Don't load all the way back because of incorrect isProduct columns
)
SELECT DISTINCT BuildId, DependentBuildId, IsProduct, TimeToInclusionInMinutes
FROM traverse

Example times

  • Repo: dotnet/sdk
  • Channel: .NET 10.0.1xx SDK
  • BAR Build ID: 245591
  • Query time: 9.2 seconds

@oleksandr-didyk oleksandr-didyk removed their assignment Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants