Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1bb2d7ff
Commit
1bb2d7ff
authored
Jul 12, 2024
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27419 [demo/check-ci] choose desc ordering in test_if_cheaper_ordering
parent
579450c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
sql/sql_select.cc
sql/sql_select.cc
+5
-4
No files found.
sql/sql_select.cc
View file @
1bb2d7ff
...
@@ -25576,10 +25576,10 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -25576,10 +25576,10 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
changed_key= true;
changed_key= true;
}
}
check_reverse_order:
check_reverse_order:
DBUG_ASSERT(order_direction != 0);
DBUG_ASSERT(order_direction != 0);
if (order_direction == -1) // If ORDER BY ... DESC
if (order_direction == -1) // If ORDER BY ... DESC
for ASC key or ORDER BY ... ASC for DESC key
{
{
int quick_type;
int quick_type;
if (select && select->quick)
if (select && select->quick)
...
@@ -25694,7 +25694,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -25694,7 +25694,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
}
}
} // best_key >= 0
} // best_key >= 0
if (order_direction == -1) // If ORDER BY ... DESC
if (order_direction == -1) // If ORDER BY ... DESC
for ASC key or ORDER BY ... ASC for DESC key
{
{
if (select && select->quick)
if (select && select->quick)
{
{
...
@@ -31119,6 +31119,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
...
@@ -31119,6 +31119,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
(select_limit <= MY_MIN(quick_records,best_records) ?
(select_limit <= MY_MIN(quick_records,best_records) ?
keyinfo->user_defined_key_parts < best_key_parts :
keyinfo->user_defined_key_parts < best_key_parts :
quick_records < best_records) ||
quick_records < best_records) ||
direction > best_key_direction ||
(!is_best_covering && is_covering))
(!is_best_covering && is_covering))
{
{
possible_key.add("chosen", true);
possible_key.add("chosen", true);
...
@@ -31128,7 +31129,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
...
@@ -31128,7 +31129,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
*saved_best_key_parts= used_key_parts;
*saved_best_key_parts= used_key_parts;
best_records= quick_records;
best_records= quick_records;
is_best_covering= is_covering;
is_best_covering= is_covering;
best_key_direction= direction;
best_key_direction= direction;
best_select_limit= select_limit;
best_select_limit= select_limit;
if ((thd->variables.optimizer_adjust_secondary_key_costs &
if ((thd->variables.optimizer_adjust_secondary_key_costs &
OPTIMIZER_ADJ_DISABLE_FORCE_INDEX_GROUP_BY) && group)
OPTIMIZER_ADJ_DISABLE_FORCE_INDEX_GROUP_BY) && group)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment