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

SQL: Optimize CREATE INDEX and BPlusTree interaction

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • cache, sql

    Description

      Currently index is built as follows:
      1) Get next entry from partition's tree
      2) Read it's key (copy to heap)
      3) Acquire lock on GridCacheMapEntry
      4) Lookup the same key in the tree from the top
      5) Read it's value (copy to heap)
      6) Add to index.

      This is very complex flow. We can optimize two things - tree lookup and value deserialization as follows:
      1) Every data page will have update counter, which is incremented every time anything is changed.
      2) When lock on GridCacheMapEntry is acquired, we will acquire lock on the data page and re-check update counter.
      3) If page was changed between iterator read and lock acquisition then use old flow.
      4) Otherwise - set read lock on the page, read value as offheap object, apply it to index.

      Attachments

        Activity

          People

            tledkov-gridgain Taras Ledkov
            vozerov Vladimir Ozerov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: