Why does the input function used in an INSERT statement have the best performance?
Hi @zhicwu
This is a not bug report but just a question.
Previously we noticed that from 0.3.2, a 'SELECT ... FROM table WHERE 0' is issued before every INSERT to retrieve the table info. And the latest ClickHouse doc states that the input function used in a INSERT statement has the best performance.
https://clickhouse.com/docs/en/integrations/java#insert-1
I just want to know how the input function used in the statement improves the performance. is it only because in such case the 'SELECT ... FROM table WHERE 0' sql is not issued from client? are any other rationale behind the implementation?
I think this question is more related to the JDBC side, so I post this question here. I didn't check the jdbc implementation very carefully, if you could leave me some explanations, I will appreciate.
In my tests, the input function is significantly slower than placeholders. For a table with 14 columns, the max throughput I could get was 1400 RPS vs 3500 RPS with placeholders. Wondering, how I can get a better throughput with this library. I am using setObject for all columns in all tests.
UPD. Actually, it was a bug in our code, it is possible to get a decent throughput with the input function.