Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-22480

Sql. Optimize performance of multistatement with simple inserts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • sql

    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

          Activity

            People

              xtern Pavel Pereslegin
              jooger Iurii Gerzhedovich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m