Follow the preceding mail,

People of interest are welcomed to join this thread, discuss about this new 
feature and give advice. If no one has opposite opinion, I would like to set 
off to develop this feature.

Best regards,

Tian Jiang

> 在 2019年6月25日,下午8:41,江天 <[email protected]> 写道:
> 
> Hi,
> 
> As some have mentioned, sql parser(antlr) may consume about 40% of time in 
> ingestion, especially when small sqls executed sent frequently. Luckily, 
> IoTDB insertion sqls are currently all alike and simple, there are 4 most 
> meaningful parts of such sqls: deviceId, measurements, values and time. For 
> such a simple structure, using tools like antlr may be just too heavy.
> 
> Intuitively, PreparedStatement in Standard JDBC interface can be just used 
> for reliving parsing overhead when sqls are similar. I will describe how 
> PreparedStatement works as follow (this is still left to be implemented):
> 
> 1. The user wants to create a prepared insert statement and called 
> `connection.prepareStatement(“Insert”)`;
> 2. The connection matches the parameter string with some templates, finds out 
> it is an insertion and returns an IoTDBPreparedInsertStatement pStmt.
> 3. The user calls `pStmt.setDevice(“root.device1”); pStmt.setTime(100); 
> pStmt.setMeasurements(measurementArray); pStmt.setValues(valueArray);` to set 
> parameters for next insertion.
> 4. The user calls `pStmt.execute()` to execute an insertion.
> 5. The PreparedInsertStatement creates a TSInsertionReq, puts deviceId, 
> measurements, values and time into this request and sends this request to the 
> server.
> 6. The server receives the request, extracts parameters from the request and 
> executes an insertion directly through database engine and return a 
> TSInsertionResp to the user.


Reply via email to