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

Destination Postgres: normalization is slow (CPU-bound, using 1 core) #25426

Closed
ggam opened this issue Apr 24, 2023 · 1 comment
Closed

Destination Postgres: normalization is slow (CPU-bound, using 1 core) #25426

ggam opened this issue Apr 24, 2023 · 1 comment

Comments

@ggam
Copy link

ggam commented Apr 24, 2023

Tell us about the problem you're trying to solve

I'm replicating some Oracle tables to Postgres destination. One of them has 160 columns and normalization becomes a bottleneck as Postgres only uses one core to process it.

Normalizing 930k records took more that 24 minutes:
2023-04-23 14:38:06 �[42mnormalization�[0m > 16 of 16 OK created table model xxxx.xxxx................................................................. [�[32mSELECT 930527�[0m in 1445.07s]

Describe the solution you’d like

Postgres won't parallelize the query as it's a full table select, so I guess the easiest solution would be to:

  • Convert the raw source table into multiple staging tables, so dbt can execute concurrently.
  • Combine the temporary tables into the final one.
  • Drop the staging tables

Describe the alternative you’ve considered or used

If and when #25194 gets done, that should solve the root problem.

Additional context

I can privately send the workspace dir and more information about the tables if needed.

Are you willing to submit a PR?

I don't realistically think I could offer my help on this one.

@ggam ggam added needs-triage type/enhancement New feature or request labels Apr 24, 2023
@igrankova igrankova changed the title Postgres destination normalization is slow (CPU-bound, using 1 core) Destination Postgres: normalization is slow (CPU-bound, using 1 core) Jun 6, 2023
@evantahler
Copy link
Contributor

Closing this issue because normalization as we know it is going away shortly - learn more @ #26028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants