Is there a way to speed up DBT test runs using ele...
# ask-elementary-ai
n
Is there a way to speed up DBT test runs using elementary with multi-threading or similar? Currently my DBT run takes 1.5 mins and my elementary run takes 4 mins
k
A message from kapa.ai
Based on the knowledge sources, there are several approaches to improve the performance of Elementary Data in your dbt test runs: ## Performance Optimization Options 1. Disable Column Autoupload: Setting
disable_dbt_columns_autoupload: true
in your variables can significantly reduce processing time. One user reported that with column uploading enabled, their process was taking almost 30 minutes, and disabling it resolved the issue [Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1707997271403599). 2. Disable Artifacts Autoupload: You can set
disable_dbt_artifacts_autoupload: true
in your project variables to reduce the processing overhead [Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1705567419922439). 3. Adjust Test Sample Row Count: Setting
test_sample_row_count: 0
can improve performance. This will mean you won't see sample rows for failed tests, but it can reduce runtime [Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1695649576308329). 4. Use Chunked Inserts: For large datasets, you can instruct Elementary to upload results in chunks by adding these variables to your `dbt_project.yml`:
Copy code
vars:      insert_rows_method: chunk      dbt_artifacts_chunk_size: 500
[Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1703928287718209) 5. Disable Failed Count Calculation: Setting
calculate_failed_count: false
can speed up processing, though you'll lose the count of failed results [Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1695328060256599). ## Multi-threading Elementary does utilize the threading configuration from your dbt profile. The tests run in parallel in a threaded manner, though some of the logging might make it appear sequential [Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1658915396893639). You might want to check your
profiles.yml
to ensure you have an appropriate thread count set (e.g.,
threads: 8
). ## Additional Considerations - The on-run-end hooks are a known performance bottleneck, especially with larger projects - Upgrading to newer versions of Elementary might help, as performance improvements are regularly released - Consider running Elementary artifacts upload separately if you only need them for specific purposes:
dbt run --select elementary.edr.dbt_artifacts
[Slack forum discussion](https://slack.com/archives/C02CTC89LAX/p1717515678662739) If these optimizations don't provide sufficient improvement, you might want to consider opening an issue on the Elementary GitHub repository with details about your specific setup for more targeted assistance.
n
Hey @Nitesh Sharoff! I'd suggest adding this to shorten your Elementary run time:
Copy code
vars:
  columns_upload_strategy: none
n
Thanks @Noya Offer, I'll read up on this now and I'll add it in, thank you!
I don't see this referenced in the docs @Noya Offer, is this the same as
disable_dbt_columns_autoupload: true
? https://docs.elementary-data.com/dbt/on-run-end_hooks#disable-metadata-models-updates
n
You're right, I see that it wasn't updated 🙂 You can see it here now - https://docs.elementary-data.com/oss/general/troubleshooting#elementary-on-run-end-hooks-are-taking-a-long-time
n
perfect, thank you!