Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23042

Merge queries to a single one for updating MIN_OPEN_TXNS table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • Transactions
    • None

    Description

      When opening a new transaction we issue 2 queries to update the MIN_OPEN_TXN table.

      <SELECT MIN("TXN_ID") FROM "TXNS" WHERE "TXN_STATE" = 'o'>
      <insert into "MIN_HISTORY_LEVEL" ("MHL_TXNID", "MHL_MIN_OPEN_TXNID") values(763, 763)>
      

      This could be archived with a single query faster, if we do not open transactions in batch, like:

      <INSERT INTO "MIN_HISTORY_LEVEL" ("MHL_TXNID", "MHL_MIN_OPEN_TXNID")
        SELECT ?, MIN("TXN_ID") FROM "TXNS" WHERE "TXN_STATE" = 'o'>
      

      Attachments

        1. HIVE-23042.patch
          13 kB
          Peter Vary
        2. HIVE-23042.4.patch
          13 kB
          Peter Vary
        3. HIVE-23042.3.patch
          13 kB
          Peter Vary
        4. HIVE-23042.2.patch
          13 kB
          Peter Vary

        Activity

          People

            pvary Peter Vary
            pvary Peter Vary
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: