Description
Execution multistatement contains a big amount of INSERT statements take to much time. For example, world.sql from AI2 contains about 5k insert statements that took more than 2 minutes on my local machine. However, if the multistatement rewrite to a few inserts contains multi values (e.g. insert into t(a,b) values(1,2) values (2,3) values.....) then it took just a few seconds.
The fast check shows that most of the time consuptions by expression compilation.
We have a few options for how it could be resolved:
1. Use expression interpretation for simple cases instead of compilation to java class.
2. Dynamically rewrite such inserts to prepared statements.
3. On AST level extract values (it will work just for literals) and create tuple for inserting by hands.
Options ordered by the hardness of implementation. Let's start from 3rd, as the simplest to implement, and check how it will work.
Attachments
Issue Links
- links to