-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Output plugin to PostgreSQL (Copy, Batch insert) #3912
Conversation
29171fd
to
a8d1006
Compare
Hi @nerzhul I saw this PR, I tested the code, and it's too slow for large number of metrics, please, take a look in my tests. |
@otherpirate do you mind updating this branch with master so tests pass (also, we've updated to use |
it would be nice to have the |
85cdb46
to
a304af4
Compare
Hi @glinton, could you review this PR again? |
Can you clarify the discrepancies between this PR and #3428? That PR is a little more active that we may want to go with that one. |
In Globo company, we still using this plugin, but the first is more active. |
Looks like PR #8651 (comment) covers copy. Let's move forward with PR #8651 - feel free to test that PR and offer any feedback. |
Hi,
I created these plugins to handling with large number of metrics.
I'm using Isolated transaction and grouping insert by table/metric name
1. Using Copy
Example: https://medium.com/@amoghagarwal/insert-optimisations-in-golang-26884b183b35
Docs: https://www.postgresql.org/docs/9.1/static/sql-copy.html
2. Using Batch
All values are added in same insert line.
Extra:
I already tried #3428 and it is just too slow when we have a lot of metrics.
This PR also solve #3408.
Benchmark between PostgreSQL(svenklemm), InfluxDB, PostgreSQL Copy and PostgreSQL Batch
Obs1: I'm using (TimeScaleDB)
Obs2: All benchmark are running in cloud (each database in equal and isolated machine)
Obs3: This plugin DO NOT create tables (I'm working on it)
Required for all PRs: