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

[RFC] Minimizing quary build work when have --cached-views #196

Open
1 of 4 tasks
benfdking opened this issue May 14, 2024 · 2 comments
Open
1 of 4 tasks

[RFC] Minimizing quary build work when have --cached-views #196

benfdking opened this issue May 14, 2024 · 2 comments
Assignees
Labels
component/cli component/core enhancement New feature or request rfc rust Pull requests that update Rust code

Comments

@benfdking
Copy link
Collaborator

benfdking commented May 14, 2024

Background

When running quary build, the operations it pushes are quite disruptive:

  • dropping and recreating views
  • dropping and recreating tables
  • dropping and recreating materialized views

In the case of systems that track view dependencies at the moment we also run DROP <view_name> CASCADE.

This:

  • breaks downstream systems
  • can be un-necessary cost

In order to avoid this, we can use the --cached-views systems to do the minimum amount of work to 1 speed up CI jobs by only changing what is necessary and 2 be more reliable. At the moment it is only being used by the extension to speed up queries when developing.

Proposal

When running quary build --cached-views, we pull the cached views and for instances where it makes sense, we try to do the least disruptive work if the models have not changed.

Cache Status View Table Materialized View
Cached and matching Leave Rerun Refresh Data
Not matching Recreate Rerun Recreate

Abandoned Ideas

See some discussion here: #88

Sections

Implementation

Steps:

  • Pull the views
  • In the create/drop view functions allow for optional return
  • In the create/drop view functions return appropriately for all the things
  • Tie up to the quary build command

UX

From a UX perspective this won't look all that different.

@benfdking benfdking added enhancement New feature or request rust Pull requests that update Rust code component/cli component/core rfc labels May 14, 2024
@benfdking benfdking self-assigned this May 14, 2024
@benfdking
Copy link
Collaborator Author

benfdking commented May 14, 2024

@kraftaa this is my current proposal, WDYT?

@benfdking
Copy link
Collaborator Author

@louisjoecodes any thoughts, I think we should move issues here ...

@benfdking benfdking assigned louisjoecodes and unassigned benfdking May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli component/core enhancement New feature or request rfc rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

2 participants