Improve performance of INSERT statement #9218
Replies: 5 comments 1 reply
-
Since Trino distributes writes across multiple nodes it follows something similar to a 2-phase implementation. Data is inserted into a randomly named staging table and once all tasks have written data the staging table, another task moves all data from staging table into final table. The 2nd step is where the majority of time is spent. If you don't want the strong transactional guarantees you can disable it by setting the config property I'll also try to get a profile where most of the time is spent to see places for improvement. |
Beta Was this translation helpful? Give feedback.
-
HI @hashhar - thanks for the response. I suppose this parameter goes into
Unfortunately, this gives me the following issue with MySQL for example:
|
Beta Was this translation helpful? Give feedback.
-
@walter-weinmann You should add to connectors' properties file, not config.properties. |
Beta Was this translation helpful? Give feedback.
-
With this parameter, there is a serious improvement. But even so, the performance of trino is still inferior to the worst case of all other databases (Firebird):
The same problem exists with Oracle, PostgreSQL and Microsoft SQL Server. insert.non-transactional-insert.enabled=false:
insert.non-transactional-insert.enabled=true:
pure MySQL:
Total overview: |
Beta Was this translation helpful? Give feedback.
-
I am very happy to help with this problem as far as it is within my means. According to my observations, all processing at COMMIT is extremely CPU intensive. Interestingly, PostgreSQL seems to be by far the fastest and Oracle by far the worst. |
Beta Was this translation helpful? Give feedback.
-
We are pleased to release version 3.0.3 of DBSeeder (https://github.com/KonnexionsGmbH/db_seeder).
DBSeeder also supports the latest version of trino available on Docker Hub (DBMS 361) and Maven Repository (JDBC 361).
Unfortunately, the performance of INSERT operations is still very unsatisfactory.
Beta Was this translation helpful? Give feedback.
All reactions