Skip to content

Improve locality for INSERT SELECT

Currently we gather all the data from storages on the router even if we can make a local insertion. The reason is that previously we had a runtime only on the router and it was the only place where we could calculate bucket_id for each tuple. As far as we have a storage runtime as well, we can support local insertions.

Pay attention that this task is not so easy as we can expect from the first look: to recalculate "bucket_id" on storages we would possible need to change the communication protocol of the router and storage. Router should send some additional flag to the storage to deserialize results from the lua stack and calculate the bucket_id from the sharding columns (their positions should be sent from the router as well).

Edited by Denis Smirnov