fix: Don't list Postgres tables during insert#13323
Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom Aug 25, 2023
Merged
fix: Don't list Postgres tables during insert#13323kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
Conversation
erezrokah
commented
Aug 25, 2023
| var sb strings.Builder | ||
| tName := table.Name | ||
| tableName := pgx.Identifier{tName}.Sanitize() | ||
| tableName := table.Name |
Member
Author
There was a problem hiding this comment.
Renamed these since I initially used tableName for the dictionary key which is wrong since it had the sanitized value
yevgenypats
approved these changes
Aug 25, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Aug 25, 2023
🤖 I have created a release *beep* *boop* --- ## [5.0.6](plugins-destination-postgresql-v5.0.5...plugins-destination-postgresql-v5.0.6) (2023-08-25) ### Bug Fixes * **deps:** Update `github.com/cloudquery/plugin-sdk/v4` to v4.5.5 ([#13297](#13297)) ([38d4d59](38d4d59)) * **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 5b83d4f ([#13203](#13203)) ([b0a4b8c](b0a4b8c)) * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.5.1 ([#13195](#13195)) ([a184c37](a184c37)) * Don't list Postgres tables during insert ([#13323](#13323)) ([6dee8bc](6dee8bc)) * Properly handle trailing zeroes in uint64 values when reading ([38d4d59](38d4d59)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
| } | ||
| } | ||
|
|
||
| pkConstraintName := tableName + "_cqpk" |
Contributor
There was a problem hiding this comment.
shouldn't it actually use the c.pgTablesToPKConstraints value if that's available?
Member
Author
There was a problem hiding this comment.
This is inside createTableIfNotExist so there should not be any value available
This was referenced Aug 25, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Aug 25, 2023
#### Summary Follow up to #13323 to handle `--no-migrate`. Thanks @candiduslynx for pointing it out <!--
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracted from #13318. Witnessed the bottleneck using
pprof.With default batch settings I'm getting
2m29ssync time instead of ~11m,With
batch_size_bytes: 100000000andbatch_timeout: 60sI'm getting1m40s. (Fixed in #13324)Used spec: