-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Slow inserts into Array(lowcardinality(...)) #6935
Comments
I've tried to disable
|
Hi @filimonov, what is the status of this ticket? |
Hi @alexey-milovidov , Iworking on this issue and captured flamegraph and visualize it on speedscope . |
@HeenaBansal2009 you are probably using your self-built ClickHouse version with less inlining or built with debug mode. |
And the |
@filimonov why did you change the |
Yes @alexey, I have taken the graph with clickhouse profiling settings ON and ClickHouse is built with Debug Mode. |
te_next_event_compute is part of jemalloc submodule : contrib/jemalloc/src/thread_event.c |
We had a similar problem at Instana. We never profiled it, but our assumption (it's just an assumption - we never verified it) was, that a) b) During insert the hash table is rebuilt with every new line. This is what makes it slow. Our workaround was to create a table with For the mentioned example, this could look like this:
Running the different INSERTs gives these results on my MacBook:
|
This assumption is incorrect. It behaves as expected (array on top of LowCardinality column).
This assumption is also incorrect. The hash table is built for every inserted block. |
@filimonov Your Perl script is missing |
The issue does not reproduce:
28 + 17 > 41 |
Also checked on c6g.16xlarge Graviton2 machine just in case: Also, everything is just perfect. |
Hi @alexey-milovidov ,
|
Query log only shows the time spend on the server side. It does not show the time spent by the client parsing the data. |
Hi @alexey-milovidov ,
Since , the merge tree settings are same for one client session in both scenarios , Is this expected ? |
Direct insert into table with lot of
Array(LowCardinality(String))
columns:Insert into table with
Array(String)
columns + copy data to the table with lot ofArray(LowCardinality(String))
columns:8.89 + 13.91 = 22.8 is much better than 32.04
Details of the test: https://gist.github.com/filimonov/8f47f575bee742fe8997b5a9366ff541
The text was updated successfully, but these errors were encountered: