Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21922

Allow packing addon fields even if they don't honour max_length_for_sort_data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5
    • Fix Version/s: 10.5.2
    • Component/s: Optimizer
    • Labels:
      None

      Description

      When we pick the strategy of using addon fields while doing filesort, we try to check if one can pack the addon fields or not.
      This is done inside the function try_to_pack_addons()
      Inside this function, we have

        const uint sz= Addon_fields::size_of_length_field;
        if (rec_length + sz > max_length_for_sort_data)
          return;
      

      This means if the number of bytes becomes greater than max_length_for_sort_data by adding the size of length field for
      addons, then we should not pack.
      I think we can easily lift this limitation because it would be beneficial to pack even in such cases, so if the addon fields are picked (they already honour the max_length_for_sort_data in the function filesort_uses_addons()) then we should try to pack them in such cases.

      This issue was found during the performance testing for packed sort keys MDEV-21580

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta
              Reporter:
              varun Varun Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: