I have been working with Trino for years, and this is a problem specific to Trino. Each insert takes a long time, and its Bulk Ingestion implementation is executing one insert per row, which in this case is inefficient and extremely slow.
The only way I have achieved acceptable performance is by batching rows for each insert, so I suggest you adopt that strategy and insert multiple rows, adding a customisable parameter ‘number_batches’ such that: INSERT INTO ... VALUES ((1,7,3000),(1,8,3500),(1,9,3900))
I have been working with Trino for years, and this is a problem specific to Trino. Each insert takes a long time, and its Bulk Ingestion implementation is executing one insert per row, which in this case is inefficient and extremely slow.
The only way I have achieved acceptable performance is by batching rows for each insert, so I suggest you adopt that strategy and insert multiple rows, adding a customisable parameter ‘number_batches’ such that: INSERT INTO ... VALUES ((1,7,3000),(1,8,3500),(1,9,3900))