I have some complex models all materialized as views. There is no issue with simpler views but when it comes to complex views with multiple joins it takes a long to create them.
Looking at the query history, all create view statements are preceded with select statements that seem to be DBT internal (something like __dbt_sbq) with limit 0.
I was expecting a quicker dbt run
, since all models are materialized as views, the query performance will only matter when querying the views and not at the model creation time.
How can this be optimized to run model creation faster? Is there a way to skip the execution of select queries and run just the create view statements
Database - Snowflake
Dbt version 1.1.0
That query is being generated by the get_columns_in_query
macro. Source
It appears dbt-snowflake uses that only when persist_docs
is enabled (this copies descriptions from schema.yml files into comments on the objects in snowflake). See this issue and the code
You should disable persist_docs
and you should see a considerable speedup.