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

SQL: Index should be updated only when relevant values changed

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • sql

    Description

      See GridH2Table.update method. Whenever value is updated, we propagate it to all indexes. Consider the following case:
      1) Old row is not null, so this is "update", not "create".
      2) Link hasn't changed
      3) Indexed fields haven't changed

      If all conditions are met, we can skip index update completely, as state before and after will be the same. This is especially important when persistence is enabled because currently we generate unnecessary dirty pages what increases IO pressure.

      Suggested fix:
      1) Iterate over index columns, skipping key and affinity columns (as they are guaranteed to be the same);
      2) Compare relevant index columns of both old and new rows
      3) If all columns are equal, do nothing.

      Fields should be read through GridH2KeyValueRowOnheap#getValue, because in this case we will re-use value cache transparently.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vozerov Vladimir Ozerov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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