Skip to content

Do not dispatch VALUES in INSERT VALUES to storages

At the moment INSERT node always add a motion node with a segment motion policy under it:

// At the moment we always add a segment motion policy under the
// insertion node, even if the the data can be transferred locally.
// The reason is in the sharding column (`bucket_id` field in terms
// of Tarantool) that should be recalculated for each row. At the
// moment we can perform calculations only on the coordinator node,
// so we need to always deliver the data to coordinator's virtual
// table.

But if the child of the motion node is VALUES node, we can transform it into the virtual table in place rather then dispatch to the storages and gather back as a virtual table. At the moment we surely dispatch it:

2022-11-23 18:01:57.701 [726717] main/146/main D> Execute query parameters: FunctionArgs(Tuple(Array([String(Utf8String { s: Ok("VALUES (?, ?), (?, ?)") }), Array([Integer(PosInt(1)), F64(4.2), Integer(PosInt(2)), Ext(1, [2, 102, 108])]), Map([(String(Utf8String { s: Ok("traceparent") }), String(Utf8String { s: Ok("00-d40cc641cf149d4679ccbea33d1207ee-7da436f93df2c48f-00") })), (String(Utf8String { s: Ok("tracestate") }), String(Utf8String { s: Ok("") }))]), String(Utf8String { s: Ok("kNFxI2qj+EhF9FclgoeQZZWsciSxefYGsxt56Dtm0Ao=") }), Boolean(false), Boolean(false)]))): argument parsing