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
31811cf8
Commit
31811cf8
authored
May 22, 2022
by
Michael Widenius
Committed by
Sergei Petrunia
Jun 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make join->key_dependent up to date for derived tables
Main-author: Sergei Petrunia
parent
432a4ebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
sql/sql_select.cc
sql/sql_select.cc
+8
-1
No files found.
sql/sql_select.cc
View file @
31811cf8
...
...
@@ -7641,7 +7641,7 @@ double cost_for_index_read(const THD *thd, const TABLE *table, uint key,
Adjust cost from table->quick_costs calculated by
multi_range_read_info_const() to be comparable with cost_for_index_read()
This functions is needed because best_access_pat
ch
doesn't add
This functions is needed because best_access_pat
h()
doesn't add
TIME_FOR_COMPARE to it's costs until very late.
Preferably we should fix so that all costs are comparably.
(All compared costs should include TIME_FOR_COMPARE for all found
...
...
@@ -8251,6 +8251,9 @@ best_access_path(JOIN *join,
if (s->key_start_dependent)
key_dependent= s->key_dependent;
}
/* Check that s->key_dependent contains all used_tables found in s->keyuse */
key_dependent&= ~PSEUDO_TABLE_BITS;
DBUG_ASSERT((key_dependent & s->key_dependent) == key_dependent);
/*
If there is no key to access the table, but there is an equi-join
...
...
@@ -12600,6 +12603,7 @@ bool generate_derived_keys_for_table(KEYUSE *keyuse, uint count, uint keys)
(uchar *) &first_keyuse))
{
JOIN_TAB *tab;
first_keyuse= save_first_keyuse;
if (table->add_tmp_key(table->s->keys, parts,
get_next_field_for_derived_key,
...
...
@@ -12607,6 +12611,9 @@ bool generate_derived_keys_for_table(KEYUSE *keyuse, uint count, uint keys)
FALSE))
return TRUE;
table->reginfo.join_tab->keys.set_bit(table->s->keys);
tab= table->reginfo.join_tab;
for (uint i=0; i < parts; i++)
tab->key_dependent|= save_first_keyuse[i].used_tables;
}
else
{
...
...
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