mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 06:05:32 +02:00
MDEV-415: Back-port of the WL task #1393 from the mysql-5.6 code line.
The task adds a more efficient handling of the queries with ORDER BY order LIMIT n, such that n is small enough and no indexes are used for order.
This commit is contained in:
parent
5a86a61219
commit
a6b88f1431
29 changed files with 2600 additions and 221 deletions
|
|
@ -498,13 +498,15 @@ int mysql_update(THD *thd,
|
|||
uint length= 0;
|
||||
SORT_FIELD *sortorder;
|
||||
ha_rows examined_rows;
|
||||
ha_rows found_rows;
|
||||
|
||||
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
|
||||
MYF(MY_FAE | MY_ZEROFILL));
|
||||
if (!(sortorder=make_unireg_sortorder(order, &length, NULL)) ||
|
||||
(table->sort.found_records= filesort(thd, table, sortorder, length,
|
||||
select, limit, 1,
|
||||
&examined_rows))
|
||||
select, limit,
|
||||
true,
|
||||
&examined_rows, &found_rows))
|
||||
== HA_POS_ERROR)
|
||||
{
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue