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

[exporter/clickhouse] Why are batch inserts not used in clickhouse exporter? #28905

Closed
takyoni opened this issue Nov 6, 2023 · 6 comments
Closed
Labels
exporter/clickhouse question Further information is requested

Comments

@takyoni
Copy link

takyoni commented Nov 6, 2023

Component(s)

exporter/clickhouse

Describe the issue you're reporting

It seems that using batch insert is much more performant than just a large number of records.
Example: https://github.com/SigNoz/signoz-otel-collector/blob/main/exporter/clickhouselogsexporter/exporter.go#L129

@takyoni takyoni added the needs triage New item requiring triage label Nov 6, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1 crobert-1 added the question Further information is requested label Nov 6, 2023
@cwegener
Copy link
Contributor

cwegener commented Nov 6, 2023

Can you explain why you think that the clickhouse exporter is not using batched inserts? As far as I can tell it is batching the insert statements, but I might be wrong.

@takyoni
Copy link
Author

takyoni commented Nov 7, 2023

In the code you can see that the insertion is performed by adding a large number of ordinary inserts to the transaction.
Batch insert example https://github.com/ClickHouse/clickhouse-go/blob/main/examples/clickhouse_api/batch.go#L52

@cwegener
Copy link
Contributor

cwegener commented Nov 7, 2023

I see. I think maybe your question then is why is the Clickhouse exporter using the standard database/sql interface and not the native clickhouse API interface of the clickhouse-go driver?

I'm not sure why why standard database/sql interface was chosen.

@takyoni
Copy link
Author

takyoni commented Nov 7, 2023

Yes you are right. This is not clear to me either.

@hanjm
Copy link
Member

hanjm commented Nov 9, 2023

@Frapschen Frapschen removed the needs triage New item requiring triage label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/clickhouse question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants