Mysql Performance Issue with Group By/Order By The Next CEO of Stack OverflowEXPLAIN output...

A hang glider, sudden unexpected lift to 25,000 feet altitude, what could do this?

What day is it again?

How to coordinate airplane tickets?

Could a dragon use its wings to swim?

Does the Idaho Potato Commission associate potato skins with healthy eating?

What is the difference between 'contrib' and 'non-free' packages repositories?

Is it okay to majorly distort historical facts while writing a fiction story?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Could you use a laser beam as a modulated carrier wave for radio signal?

Find the majority element, which appears more than half the time

That's an odd coin - I wonder why

How should I connect my cat5 cable to connectors having an orange-green line?

pgfplots: How to draw a tangent graph below two others?

logical reads on global temp table, but not on session-level temp table

Is it OK to decorate a log book cover?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Airship steam engine room - problems and conflict

Does int main() need a declaration on C++?

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

My boss doesn't want me to have a side project

How to find if SQL server backup is encrypted with TDE without restoring the backup

"Eavesdropping" vs "Listen in on"

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

How does a dynamic QR code work?



Mysql Performance Issue with Group By/Order By



The Next CEO of Stack OverflowEXPLAIN output suggests that my index is not being usedfind and insert row to another table using mysql triggerMySQL looking up more rows than needed (indexing issue)Adding index to large mysql tablesUpdating a table with a single UPDATE statement vs several UPDATE statementsMysql join not workingMySQL COUNT(*) performanceSlow SELECT examining whole tableselect MAX() from MySQL view (2x INNER JOIN) is slowPerformance of mysql equi-join observed in HDD and SSD












0















I am using Mysql 5.7 I have table which having 7006500 rows. My query performing group by and fetching row which has maximum count with each group on column which is already indexed but still takes time for execution. Below is my query,execution plan and table schema.



Table Schema



        CREATE TABLE templog (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
userid bigint(12) unsigned NOT NULL,
type tinyint(3) NOT NULL DEFAULT '0',
os tinyint(4) NOT NULL DEFAULT '0',
day date DEFAULT NULL,
activetime smallint(5) unsigned NOT NULL DEFAULT '0',
createdat datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
timegroupid tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY templog_type_IDX (`type`,`day`,`userid`,`timegroupid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7006500 DEFAULT CHARSET=utf8;


My Query:-



            SELECT SQL_NO_CACHE y.userid, y.timegroupid as besttime,y.cnt
FROM(
SELECT @row_number:=CASE WHEN @userid=x.userid THEN @row_number+1 ELSE 1 END AS row_number
,@userid:= x.userid AS userid
,x.cnt,x.timegroupid
FROM(
SELECT userid, timegroupid ,COUNT(userid) as cnt
from templog
where type = 3
AND day BETWEEN '2020-01-01' and '2020-01-20'
AND userid < 771267
GROUP by userid, timegroupid
ORDER by userid DESC ,cnt DESC
)x,(SELECT @row_number:=0,@userid:='') AS t
)y
where y.row_number = 1
ORDER by y.userid DESC
LIMIT 1000;


Query Explain format:



                {
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "12.00"
},
"ordering_operation": {
"using_filesort": true,
"table": {
"table_name": "y",
"access_type": "ref",
"possible_keys": [
"<auto_key0>"
],
"key": "<auto_key0>",
"used_key_parts": [
"row_number"
],
"key_length": "9",
"ref": [
"const"
],
"rows_examined_per_scan": 10,
"rows_produced_per_join": 10,
"filtered": "100.00",
"cost_info": {
"read_cost": "10.00",
"eval_cost": "2.00",
"prefix_cost": "12.00",
"data_read_per_join": "320"
},
"used_columns": [
"row_number",
"userid",
"cnt",
"timegroupid"
],
"attached_condition": "((`y`.`row_number` <=> 1))",
"materialized_from_subquery": {
"using_temporary_table": true,
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 2,
"cost_info": {
"query_cost": "6441.25"
},
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "system",
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.20",
"prefix_cost": "0.00",
"data_read_per_join": "16"
},
"used_columns": [
"@row_number:=0",
"@userid:=''"
],
"materialized_from_subquery": {
"using_temporary_table": true,
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 4,
"message": "No tables used"
}
}
}
},
{
"table": {
"table_name": "x",
"access_type": "ALL",
"rows_examined_per_scan": 25725,
"rows_produced_per_join": 25725,
"filtered": "100.00",
"cost_info": {
"read_cost": "1296.25",
"eval_cost": "5145.00",
"prefix_cost": "6441.25",
"data_read_per_join": "602K"
},
"used_columns": [
"userid",
"timegroupid",
"cnt"
],
"materialized_from_subquery": {
"using_temporary_table": true,
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 3,
"cost_info": {
"query_cost": "140807.11"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"table": {
"table_name": "templog",
"access_type": "range",
"possible_keys": [
"templog_type_IDX"
],
"key": "templog_type_IDX",
"used_key_parts": [
"type",
"day"
],
"key_length": "13",
"rows_examined_per_scan": 694718,
"rows_pr
oduced_per_join": 25725,
"filtered": "33.33",
"using_index": true,
"cost_info": {
"read_cost": "1863.51",
"eval_cost": "5145.03",
"prefix_cost": "140807.11",
"data_read_per_join": "803K"
},
"used_columns": [
"id",
"userid",
"type",
"day",
"timegroupid"
],
"attached_condition": "((`templog`.`type` = 3) and (`templog`.`day` between '2020-01-01' and '2020-01-20') and (`templog`.`userid` < 771267))"
}
}
}
}
}
}
}
]
}
}
}
}
}
}


Is there any other to optimize query or change index order or rewrite query in another way for better performance?









share



























    0















    I am using Mysql 5.7 I have table which having 7006500 rows. My query performing group by and fetching row which has maximum count with each group on column which is already indexed but still takes time for execution. Below is my query,execution plan and table schema.



    Table Schema



            CREATE TABLE templog (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    userid bigint(12) unsigned NOT NULL,
    type tinyint(3) NOT NULL DEFAULT '0',
    os tinyint(4) NOT NULL DEFAULT '0',
    day date DEFAULT NULL,
    activetime smallint(5) unsigned NOT NULL DEFAULT '0',
    createdat datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    timegroupid tinyint(4) NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`),
    KEY templog_type_IDX (`type`,`day`,`userid`,`timegroupid`) USING BTREE
    ) ENGINE=InnoDB AUTO_INCREMENT=7006500 DEFAULT CHARSET=utf8;


    My Query:-



                SELECT SQL_NO_CACHE y.userid, y.timegroupid as besttime,y.cnt
    FROM(
    SELECT @row_number:=CASE WHEN @userid=x.userid THEN @row_number+1 ELSE 1 END AS row_number
    ,@userid:= x.userid AS userid
    ,x.cnt,x.timegroupid
    FROM(
    SELECT userid, timegroupid ,COUNT(userid) as cnt
    from templog
    where type = 3
    AND day BETWEEN '2020-01-01' and '2020-01-20'
    AND userid < 771267
    GROUP by userid, timegroupid
    ORDER by userid DESC ,cnt DESC
    )x,(SELECT @row_number:=0,@userid:='') AS t
    )y
    where y.row_number = 1
    ORDER by y.userid DESC
    LIMIT 1000;


    Query Explain format:



                    {
    "query_block": {
    "select_id": 1,
    "cost_info": {
    "query_cost": "12.00"
    },
    "ordering_operation": {
    "using_filesort": true,
    "table": {
    "table_name": "y",
    "access_type": "ref",
    "possible_keys": [
    "<auto_key0>"
    ],
    "key": "<auto_key0>",
    "used_key_parts": [
    "row_number"
    ],
    "key_length": "9",
    "ref": [
    "const"
    ],
    "rows_examined_per_scan": 10,
    "rows_produced_per_join": 10,
    "filtered": "100.00",
    "cost_info": {
    "read_cost": "10.00",
    "eval_cost": "2.00",
    "prefix_cost": "12.00",
    "data_read_per_join": "320"
    },
    "used_columns": [
    "row_number",
    "userid",
    "cnt",
    "timegroupid"
    ],
    "attached_condition": "((`y`.`row_number` <=> 1))",
    "materialized_from_subquery": {
    "using_temporary_table": true,
    "dependent": false,
    "cacheable": true,
    "query_block": {
    "select_id": 2,
    "cost_info": {
    "query_cost": "6441.25"
    },
    "nested_loop": [
    {
    "table": {
    "table_name": "t",
    "access_type": "system",
    "rows_examined_per_scan": 1,
    "rows_produced_per_join": 1,
    "filtered": "100.00",
    "cost_info": {
    "read_cost": "0.00",
    "eval_cost": "0.20",
    "prefix_cost": "0.00",
    "data_read_per_join": "16"
    },
    "used_columns": [
    "@row_number:=0",
    "@userid:=''"
    ],
    "materialized_from_subquery": {
    "using_temporary_table": true,
    "dependent": false,
    "cacheable": true,
    "query_block": {
    "select_id": 4,
    "message": "No tables used"
    }
    }
    }
    },
    {
    "table": {
    "table_name": "x",
    "access_type": "ALL",
    "rows_examined_per_scan": 25725,
    "rows_produced_per_join": 25725,
    "filtered": "100.00",
    "cost_info": {
    "read_cost": "1296.25",
    "eval_cost": "5145.00",
    "prefix_cost": "6441.25",
    "data_read_per_join": "602K"
    },
    "used_columns": [
    "userid",
    "timegroupid",
    "cnt"
    ],
    "materialized_from_subquery": {
    "using_temporary_table": true,
    "dependent": false,
    "cacheable": true,
    "query_block": {
    "select_id": 3,
    "cost_info": {
    "query_cost": "140807.11"
    },
    "ordering_operation": {
    "using_filesort": true,
    "grouping_operation": {
    "using_temporary_table": true,
    "using_filesort": false,
    "table": {
    "table_name": "templog",
    "access_type": "range",
    "possible_keys": [
    "templog_type_IDX"
    ],
    "key": "templog_type_IDX",
    "used_key_parts": [
    "type",
    "day"
    ],
    "key_length": "13",
    "rows_examined_per_scan": 694718,
    "rows_pr
    oduced_per_join": 25725,
    "filtered": "33.33",
    "using_index": true,
    "cost_info": {
    "read_cost": "1863.51",
    "eval_cost": "5145.03",
    "prefix_cost": "140807.11",
    "data_read_per_join": "803K"
    },
    "used_columns": [
    "id",
    "userid",
    "type",
    "day",
    "timegroupid"
    ],
    "attached_condition": "((`templog`.`type` = 3) and (`templog`.`day` between '2020-01-01' and '2020-01-20') and (`templog`.`userid` < 771267))"
    }
    }
    }
    }
    }
    }
    }
    ]
    }
    }
    }
    }
    }
    }


    Is there any other to optimize query or change index order or rewrite query in another way for better performance?









    share

























      0












      0








      0








      I am using Mysql 5.7 I have table which having 7006500 rows. My query performing group by and fetching row which has maximum count with each group on column which is already indexed but still takes time for execution. Below is my query,execution plan and table schema.



      Table Schema



              CREATE TABLE templog (
      id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      userid bigint(12) unsigned NOT NULL,
      type tinyint(3) NOT NULL DEFAULT '0',
      os tinyint(4) NOT NULL DEFAULT '0',
      day date DEFAULT NULL,
      activetime smallint(5) unsigned NOT NULL DEFAULT '0',
      createdat datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
      timegroupid tinyint(4) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`),
      KEY templog_type_IDX (`type`,`day`,`userid`,`timegroupid`) USING BTREE
      ) ENGINE=InnoDB AUTO_INCREMENT=7006500 DEFAULT CHARSET=utf8;


      My Query:-



                  SELECT SQL_NO_CACHE y.userid, y.timegroupid as besttime,y.cnt
      FROM(
      SELECT @row_number:=CASE WHEN @userid=x.userid THEN @row_number+1 ELSE 1 END AS row_number
      ,@userid:= x.userid AS userid
      ,x.cnt,x.timegroupid
      FROM(
      SELECT userid, timegroupid ,COUNT(userid) as cnt
      from templog
      where type = 3
      AND day BETWEEN '2020-01-01' and '2020-01-20'
      AND userid < 771267
      GROUP by userid, timegroupid
      ORDER by userid DESC ,cnt DESC
      )x,(SELECT @row_number:=0,@userid:='') AS t
      )y
      where y.row_number = 1
      ORDER by y.userid DESC
      LIMIT 1000;


      Query Explain format:



                      {
      "query_block": {
      "select_id": 1,
      "cost_info": {
      "query_cost": "12.00"
      },
      "ordering_operation": {
      "using_filesort": true,
      "table": {
      "table_name": "y",
      "access_type": "ref",
      "possible_keys": [
      "<auto_key0>"
      ],
      "key": "<auto_key0>",
      "used_key_parts": [
      "row_number"
      ],
      "key_length": "9",
      "ref": [
      "const"
      ],
      "rows_examined_per_scan": 10,
      "rows_produced_per_join": 10,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "10.00",
      "eval_cost": "2.00",
      "prefix_cost": "12.00",
      "data_read_per_join": "320"
      },
      "used_columns": [
      "row_number",
      "userid",
      "cnt",
      "timegroupid"
      ],
      "attached_condition": "((`y`.`row_number` <=> 1))",
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 2,
      "cost_info": {
      "query_cost": "6441.25"
      },
      "nested_loop": [
      {
      "table": {
      "table_name": "t",
      "access_type": "system",
      "rows_examined_per_scan": 1,
      "rows_produced_per_join": 1,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "0.00",
      "eval_cost": "0.20",
      "prefix_cost": "0.00",
      "data_read_per_join": "16"
      },
      "used_columns": [
      "@row_number:=0",
      "@userid:=''"
      ],
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 4,
      "message": "No tables used"
      }
      }
      }
      },
      {
      "table": {
      "table_name": "x",
      "access_type": "ALL",
      "rows_examined_per_scan": 25725,
      "rows_produced_per_join": 25725,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "1296.25",
      "eval_cost": "5145.00",
      "prefix_cost": "6441.25",
      "data_read_per_join": "602K"
      },
      "used_columns": [
      "userid",
      "timegroupid",
      "cnt"
      ],
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 3,
      "cost_info": {
      "query_cost": "140807.11"
      },
      "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": false,
      "table": {
      "table_name": "templog",
      "access_type": "range",
      "possible_keys": [
      "templog_type_IDX"
      ],
      "key": "templog_type_IDX",
      "used_key_parts": [
      "type",
      "day"
      ],
      "key_length": "13",
      "rows_examined_per_scan": 694718,
      "rows_pr
      oduced_per_join": 25725,
      "filtered": "33.33",
      "using_index": true,
      "cost_info": {
      "read_cost": "1863.51",
      "eval_cost": "5145.03",
      "prefix_cost": "140807.11",
      "data_read_per_join": "803K"
      },
      "used_columns": [
      "id",
      "userid",
      "type",
      "day",
      "timegroupid"
      ],
      "attached_condition": "((`templog`.`type` = 3) and (`templog`.`day` between '2020-01-01' and '2020-01-20') and (`templog`.`userid` < 771267))"
      }
      }
      }
      }
      }
      }
      }
      ]
      }
      }
      }
      }
      }
      }


      Is there any other to optimize query or change index order or rewrite query in another way for better performance?









      share














      I am using Mysql 5.7 I have table which having 7006500 rows. My query performing group by and fetching row which has maximum count with each group on column which is already indexed but still takes time for execution. Below is my query,execution plan and table schema.



      Table Schema



              CREATE TABLE templog (
      id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      userid bigint(12) unsigned NOT NULL,
      type tinyint(3) NOT NULL DEFAULT '0',
      os tinyint(4) NOT NULL DEFAULT '0',
      day date DEFAULT NULL,
      activetime smallint(5) unsigned NOT NULL DEFAULT '0',
      createdat datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
      timegroupid tinyint(4) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`),
      KEY templog_type_IDX (`type`,`day`,`userid`,`timegroupid`) USING BTREE
      ) ENGINE=InnoDB AUTO_INCREMENT=7006500 DEFAULT CHARSET=utf8;


      My Query:-



                  SELECT SQL_NO_CACHE y.userid, y.timegroupid as besttime,y.cnt
      FROM(
      SELECT @row_number:=CASE WHEN @userid=x.userid THEN @row_number+1 ELSE 1 END AS row_number
      ,@userid:= x.userid AS userid
      ,x.cnt,x.timegroupid
      FROM(
      SELECT userid, timegroupid ,COUNT(userid) as cnt
      from templog
      where type = 3
      AND day BETWEEN '2020-01-01' and '2020-01-20'
      AND userid < 771267
      GROUP by userid, timegroupid
      ORDER by userid DESC ,cnt DESC
      )x,(SELECT @row_number:=0,@userid:='') AS t
      )y
      where y.row_number = 1
      ORDER by y.userid DESC
      LIMIT 1000;


      Query Explain format:



                      {
      "query_block": {
      "select_id": 1,
      "cost_info": {
      "query_cost": "12.00"
      },
      "ordering_operation": {
      "using_filesort": true,
      "table": {
      "table_name": "y",
      "access_type": "ref",
      "possible_keys": [
      "<auto_key0>"
      ],
      "key": "<auto_key0>",
      "used_key_parts": [
      "row_number"
      ],
      "key_length": "9",
      "ref": [
      "const"
      ],
      "rows_examined_per_scan": 10,
      "rows_produced_per_join": 10,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "10.00",
      "eval_cost": "2.00",
      "prefix_cost": "12.00",
      "data_read_per_join": "320"
      },
      "used_columns": [
      "row_number",
      "userid",
      "cnt",
      "timegroupid"
      ],
      "attached_condition": "((`y`.`row_number` <=> 1))",
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 2,
      "cost_info": {
      "query_cost": "6441.25"
      },
      "nested_loop": [
      {
      "table": {
      "table_name": "t",
      "access_type": "system",
      "rows_examined_per_scan": 1,
      "rows_produced_per_join": 1,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "0.00",
      "eval_cost": "0.20",
      "prefix_cost": "0.00",
      "data_read_per_join": "16"
      },
      "used_columns": [
      "@row_number:=0",
      "@userid:=''"
      ],
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 4,
      "message": "No tables used"
      }
      }
      }
      },
      {
      "table": {
      "table_name": "x",
      "access_type": "ALL",
      "rows_examined_per_scan": 25725,
      "rows_produced_per_join": 25725,
      "filtered": "100.00",
      "cost_info": {
      "read_cost": "1296.25",
      "eval_cost": "5145.00",
      "prefix_cost": "6441.25",
      "data_read_per_join": "602K"
      },
      "used_columns": [
      "userid",
      "timegroupid",
      "cnt"
      ],
      "materialized_from_subquery": {
      "using_temporary_table": true,
      "dependent": false,
      "cacheable": true,
      "query_block": {
      "select_id": 3,
      "cost_info": {
      "query_cost": "140807.11"
      },
      "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": false,
      "table": {
      "table_name": "templog",
      "access_type": "range",
      "possible_keys": [
      "templog_type_IDX"
      ],
      "key": "templog_type_IDX",
      "used_key_parts": [
      "type",
      "day"
      ],
      "key_length": "13",
      "rows_examined_per_scan": 694718,
      "rows_pr
      oduced_per_join": 25725,
      "filtered": "33.33",
      "using_index": true,
      "cost_info": {
      "read_cost": "1863.51",
      "eval_cost": "5145.03",
      "prefix_cost": "140807.11",
      "data_read_per_join": "803K"
      },
      "used_columns": [
      "id",
      "userid",
      "type",
      "day",
      "timegroupid"
      ],
      "attached_condition": "((`templog`.`type` = 3) and (`templog`.`day` between '2020-01-01' and '2020-01-20') and (`templog`.`userid` < 771267))"
      }
      }
      }
      }
      }
      }
      }
      ]
      }
      }
      }
      }
      }
      }


      Is there any other to optimize query or change index order or rewrite query in another way for better performance?







      mysql query-performance group-by order-by





      share












      share










      share



      share










      asked 4 mins ago









      5a01d01P5a01d01P

      61




      61






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f233702%2fmysql-performance-issue-with-group-by-order-by%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f233702%2fmysql-performance-issue-with-group-by-order-by%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...