ClickHouse / ClickHouse/clickhouse-java

Potential performance issue with SQL parsing in jdbc-v2

Abierto
#2,585 1 comentario 0 reacciones 0 asignados Ver en GitHub
jdbc-v2 performance v2-feedback
Lenguaje dominante
Java
Estrellas
1.6k
Forks
636
Merge medio
2 d 23 h
PR fusionados (30 d)
29

Descripción

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...

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The report identifies org.antlr.v4.runtime.atn.ParserATNSimulator.closureCheckingStopState as the hot method in jdbc-v2; start by reproducing or benchmarking repeated createNativeQuery and PreparedStatement parsing against driver versions 0.9.1 and 0.2.6. Done would require a confirmed regression and an agreed parsing or design change, but the issue names no source file or test.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
clickhouse, java
Área
databases, performance
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.