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

GROUP_CONCAT with ORDER BY inside takes a lot of memory while it's executed

Details

    • 10.1.14, 10.1.18, 10.1.19

    Description

      A query like

      SELECT GROUP_CONCAT( seq, seq, seq, seq, seq, seq, seq, seq ORDER BY 2,1,3,4,6,5,8,7 ) AS cfield1 FROM seq_1_to_50000000

      easily uses up to 4-5 Gb memory while it's running.

      <montywi> everything has limits
      <montywi> even for filesort; For bigger things it should always hit disk, never memory
      ...
      <montywi> the problem is that when doing a sort, we create a sorted tree in memory
      <montywi> however there is no memory check for this
      <montywi> so this can be any size
      <montywi> Normally it would make sense to limit this to group_concat_max_length, but I fear that would break things, as we sort records there, which can have a notable overhead
      <montywi> So I have limit it to max_heap_table_size

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Oleksandr Byelkin made transition -
            Open In Progress
            78d 21h 37m 1
            Oleksandr Byelkin made transition -
            In Progress In Review
            7d 3h 20m 1
            Sergei Golubchik made transition -
            Stalled In Progress
            34d 17h 21m 3
            Sergei Golubchik made transition -
            In Progress Stalled
            629d 1h 20m 3
            Sergei Golubchik made transition -
            Stalled In Review
            277d 17h 19m 3
            Oleksandr Byelkin made transition -
            In Review Stalled
            143d 40m 4
            Sergei Golubchik made transition -
            Stalled Closed
            1d 1h 29m 1

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.