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

[CT-3150] [Implementation] allow source freshness to be calculated in batch, when using warehouse metadata tables #8705

Closed
1 task done
Tracked by #9425
graciegoheen opened this issue Sep 25, 2023 · 2 comments · Fixed by #9749
Closed
1 task done
Tracked by #9425
Assignees
Labels
enhancement New feature or request Impact: CA user docs [docs.getdbt.com] Needs better documentation
Milestone

Comments

@graciegoheen
Copy link
Contributor

graciegoheen commented Sep 25, 2023

Housekeeping

  • I am a maintainer of dbt-core

Short description

From #7012

For sources marked for freshness via metadata, dbt should issue a single query instead of one per source. It would massively speed up compiling of source freshness.

It may also be possible to batch queries together to get performance improvements:

  • source freshness checks using a loaded_at_field
  • unit tests
  • etc.

There's some precedent for this — that's the pattern dbt follows right now for docs generate. We know that can lead to significant time/memory consumption at scale, so we'd want this implementation to still respect node selection (--select): If I'm only checking the freshness for a handful of sources, filter down the information schema. Node selection is already supported with dbt source freshness, so we should maintain this behavior. https://docs.getdbt.com/reference/commands/source

Acceptance criteria

  • For sources marked for freshness via metadata, dbt should issue a single query instead of one per source.
  • We respect node selection (--select) for source freshness command (already supported today)

Impact to Other Teams

None

Will backports be required?

None

Context

No response

@graciegoheen graciegoheen added enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation labels Sep 25, 2023
@github-actions github-actions bot changed the title [Implementation] allow source freshness to be calculated in batch, when using warehouse metadata tables [CT-3150] [Implementation] allow source freshness to be calculated in batch, when using warehouse metadata tables Sep 25, 2023
@graciegoheen
Copy link
Contributor Author

graciegoheen commented Oct 2, 2023

Considerations during TR:

  • Maybe they have some that are being checked via metadata, and others that are being checked by the loaded_at_field. Will depend on whether loaded_at_field is specified for the source/table.
  • Frequent permission issues with querying information schema tables, especially on sources (not owned by dbt)
  • If a batch query fails, and per-table queries succeed - we would want to gracefully handle, similar to how we're doing catalog generation during docs generate right now
  • We'd want to filter down information schema queries, especially if there are <100 source tables in a schema with many thousands of objects. (That's a fine cutoff to start with.)

@FishtownBuildBot
Copy link
Collaborator

Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#5276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Impact: CA user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants