Skip to content

Conversation

@dimitrovmaksim
Copy link
Member

@dimitrovmaksim dimitrovmaksim commented Oct 20, 2025

Resolves #5470

What this PR does:

  1. Exposes (sum of) the deployments table sizes and rows through SubgraphIndexingStatus. The data is collected from the subgraph_sizes materialized view.
Screenshot 2025-10-20 at 15 25 41
  1. Makes the subgraphs argument for ther indexingStatuses query required. After the changes in handle empty array in indexing status query #6143, calling the query without an argument is redundant because it will always return an empty array.

@dimitrovmaksim dimitrovmaksim changed the title Feat: Expose table sizes in SubgraphIndexingStatus Feat: Expose subgraph table sizes in SubgraphIndexingStatus Oct 20, 2025
@dimitrovmaksim dimitrovmaksim force-pushed the feat/add-table-sizes-to-indexing-status branch from 987c599 to 6c786c0 Compare October 20, 2025 13:44
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
@dimitrovmaksim dimitrovmaksim force-pushed the feat/add-table-sizes-to-indexing-status branch from 6c786c0 to b1b19cc Compare October 21, 2025 11:10
Copy link
Member

@incrypto32 incrypto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


let rows = match result {
Ok(rows) => rows,
Err(e) if e.to_string().contains("has not been populated") => Vec::new(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick: Is there no typed error for this? string matching might be fragile if diesel changes the error message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore if there is no typed error for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a postgre error, and it is returned as Unknown

Unknown(materialized view "subgraph_sizes" has not been populated)

So I don't think there's another way

@dimitrovmaksim
Copy link
Member Author

Let's wait for this PR #6194 to be merged before this one, so I can update to async logic

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.

expose table sizes in the indexing status endpoint

2 participants