Arnau Font
01/19/2024, 8:03 AMvars:
disable_dbt_artifacts_autoupload: true
The amount of queries have reduced, but the time has not reduced significantly. We are still facing a >1min extra execution time for the insert in invocations, run_results and test results tables. How many rows are there inserted so that it takes 1 minute? I have added the total of the queries and it only should take 15 seconds, but the run of the model, on average, takes one minute more with elementary. I attach one image of the queries below.
2. We have already added elementary to another project, and we are facing quite long (13 minute insert) queries that are doing the insert into the dbt_run_results table:
/* {"app": "dbt", "dbt_version": "1.5.2", "dbt_databricks_version": "1.5.5", "databricks_sql_connector_version": "2.7.0", "profile_name": "dataplatform", "target_name": "databricks", "connection_name": "master"} */
insert into
`hive_metastore`.`quality`.`dbt_run_results` (
model_execution_id,
unique_id,
invocation_id,
generated_at,
created_at,
name,
message,
status,
resource_type,
execution_time,
execute_started_at,
execute_completed_at,
compile_started_at,
compile_completed_at,
rows_affected,
full_refresh,
compiled_code,
failures,
query_id,
thread_id,
materialization
)
values
(
'2aa75e16-875e-454e-b231-cc751c5509ec.model.Datalake.slv_dim_prd_fac_stock_unificado',
'model.Datalake.slv_dim_prd_fac_stock_unificado',
'2aa75e16-875e-454e-b231-cc751c5509ec',
'2024-01-19 04:43:08',
current_timestamp :: timestamp,
'slv_dim_prd_fac_stock_unificado',
'OK',
'success',
'model',
418.8722710609436,
'2024-01-19T04:35:58.159210Z',
'2024-01-19T04:42:56.957968Z',
'2024-01-19T04:35:58.142517Z',
'2024-01-19T04:35:58.157508Z',
NULL,
True,
'\n\nwith dim_prd_fac_stock_unificado_tmp_vw as (\n select\n dlk_raw_file_timestamp,\n dlk_raw_filename,\n fec_carga,\n fec_dia,\n id_centro_stock,\n cast(id_item as int) as id_item,\n cast(val_saldo as int) as val_saldo,\n cast(val_ubicado as int) as val_ubicado,\n cast(val_reserva as int) as val_reserva,\n cast(val_stock2 as int) as val_stock2,\n cast(val_transito_pd as int) as val_transito_pd,\n cast(val_transito_ol as int) as val_transito_ol,\n cast(val_stock_disp_llica as int) as val_stock_disp_llica\n from `hive_metastore`.`bronze`.`dim_prd_fac_stock_unificado`\n)\n\n\n\nselect \n dlk_slv_insert_timestamp,\n dlk_raw_file_timestamp,\n dlk_raw_filename,\n fec_carga,\n fec_dia,\n id_centro_stock,\n id_item,\n val_saldo,\n val_ubicado,\n val_reserva,\n val_stock2,\n val_transito_pd,\n val_transito_ol,\n val_stock_disp_llica\nfrom (\n\n \n select\n current_timestamp as dlk_slv_insert_timestamp,\n \n \n md5(cast(concat() as string))\n as dlk_slv_unique_key,\n \n v.*\n from dim_prd_fac_stock_unificado_tmp_vw v\n ) T',
NULL,
'01eeb684-3e34-1402-ba9a-665fa6b9c34b',
'Thread-1 (worker)',
'table'
)
It is a completely different project so execution times of the model are now different.
My question is: how can we improve elementary's performance? Is it normal a 13 minute insert (Medium size SQL serverless warehouse)?
Let me know if you need more information,
Thanks in advance! :)Noy Arie
01/21/2024, 3:03 PMArnau Font
01/22/2024, 8:09 AMNoy Arie
01/22/2024, 3:51 PMon-run-end is running for dbt run as well.
You can read about this hook here.
I don’t recommend disabling the artifact collections, some of the features won’t work after this.
You can read about the performance impact of the on-run-end hook (you are already using dbt version +1.4.0)