ClickHouse / ClickHouse/clickhouse-java
Potential performance issue with SQL parsing in jdbc-v2
- Ngôn ngữ chính
- Java
- Star
- 1.6k
- Fork
- 636
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 29
Mô tả
Reporting against v.0.9.1. We are using ClickHouse JDBC via Hibernate - our code is calling createNativeQuery a lot - which means creating (and throwing away) a great number of PreparedStatements. As a result we're seeing in close to 6% of CPU time being spent in the driver's statement parsing with production loads (as evaluated with asprof), more specifically in the method org.antlr.v4.runtime.atn.ParserATNSimulator.closureCheckingStopState.
While I'm aware that this is partly a problem of our usage pattern (PreparedStatements should be cached, which is what we're going to address next at our end), we did not have this issue with the old version (0.2.6) of the driver. In short, the SQL parsing has become slow(er).
I'm writing this to alert you in case no performance benchmarks were performed for that area of code.
I'm also wondering why ANTLR is at all necessary in the driver - I'd assume the actual 'heavyweight' parsing to detect syntax errors and the like is done on the server anyhow, so why have such overheads in the client? But this is likely a deeper design issue not fixable by profiling...
Hướng dẫn đóng góp
Hướng nghiên cứu
Báo cáo xác định org.antlr.v4.runtime.atn.ParserATNSimulator.closureCheckingStopState là phương thức gây tải cao nhất trong jdbc-v2; trước tiên hãy tái hiện hoặc benchmark việc phân tích lặp lại createNativeQuery và PreparedStatement trên các phiên bản driver 0.9.1 và 0.2.6. Để được xem là hoàn tất, cần xác nhận một regression và thống nhất về thay đổi trong parsing hoặc design, nhưng issue không nêu tệp nguồn hay test nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- clickhouse, java
- Lĩnh vực
- databases, performance
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100