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
0c7b0189
Commit
0c7b0189
authored
May 11, 2021
by
Monty
Committed by
Sergei Golubchik
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove not used IPC_COND_USED_INDEX
parent
acf282c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
21 deletions
+4
-21
sql/opt_index_cond_pushdown.cc
sql/opt_index_cond_pushdown.cc
+4
-21
No files found.
sql/opt_index_cond_pushdown.cc
View file @
0c7b0189
...
@@ -152,7 +152,6 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
...
@@ -152,7 +152,6 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
}
}
}
}
#define ICP_COND_USES_INDEX_ONLY 10
/*
/*
Get a part of the condition that can be checked using only index fields
Get a part of the condition that can be checked using only index fields
...
@@ -161,8 +160,8 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
...
@@ -161,8 +160,8 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
make_cond_for_index()
make_cond_for_index()
cond The source condition
cond The source condition
table The table that is partially available
table The table that is partially available
keyno The index in the above table. Only fields covered by the
index
keyno The index in the above table. Only fields covered by the
are available
index
are available
other_tbls_ok TRUE <=> Fields of other non-const tables are allowed
other_tbls_ok TRUE <=> Fields of other non-const tables are allowed
DESCRIPTION
DESCRIPTION
...
@@ -189,7 +188,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
...
@@ -189,7 +188,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
return
cond
;
return
cond
;
if
(
cond
->
type
()
==
Item
::
COND_ITEM
)
if
(
cond
->
type
()
==
Item
::
COND_ITEM
)
{
{
uint
n_marked
=
0
;
if
(((
Item_cond
*
)
cond
)
->
functype
()
==
Item_func
::
COND_AND_FUNC
)
if
(((
Item_cond
*
)
cond
)
->
functype
()
==
Item_func
::
COND_AND_FUNC
)
{
{
table_map
used_tables
=
0
;
table_map
used_tables
=
0
;
...
@@ -206,14 +204,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
...
@@ -206,14 +204,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
new_cond
->
argument_list
()
->
push_back
(
fix
,
thd
->
mem_root
);
new_cond
->
argument_list
()
->
push_back
(
fix
,
thd
->
mem_root
);
used_tables
|=
fix
->
used_tables
();
used_tables
|=
fix
->
used_tables
();
}
}
if
(
item
->
marker
==
ICP_COND_USES_INDEX_ONLY
)
{
n_marked
++
;
item
->
marker
=
0
;
}
}
}
if
(
n_marked
==
((
Item_cond
*
)
cond
)
->
argument_list
()
->
elements
)
cond
->
marker
=
ICP_COND_USES_INDEX_ONLY
;
switch
(
new_cond
->
argument_list
()
->
elements
)
{
switch
(
new_cond
->
argument_list
()
->
elements
)
{
case
0
:
case
0
:
return
(
COND
*
)
0
;
return
(
COND
*
)
0
;
...
@@ -239,14 +230,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
...
@@ -239,14 +230,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
if
(
!
fix
)
if
(
!
fix
)
return
(
COND
*
)
0
;
return
(
COND
*
)
0
;
new_cond
->
argument_list
()
->
push_back
(
fix
,
thd
->
mem_root
);
new_cond
->
argument_list
()
->
push_back
(
fix
,
thd
->
mem_root
);
if
(
item
->
marker
==
ICP_COND_USES_INDEX_ONLY
)
{
n_marked
++
;
item
->
marker
=
0
;
}
}
}
if
(
n_marked
==
((
Item_cond
*
)
cond
)
->
argument_list
()
->
elements
)
cond
->
marker
=
ICP_COND_USES_INDEX_ONLY
;
new_cond
->
quick_fix_field
();
new_cond
->
quick_fix_field
();
new_cond
->
used_tables_cache
=
((
Item_cond_or
*
)
cond
)
->
used_tables_cache
;
new_cond
->
used_tables_cache
=
((
Item_cond_or
*
)
cond
)
->
used_tables_cache
;
new_cond
->
top_level_item
();
new_cond
->
top_level_item
();
...
@@ -256,7 +240,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
...
@@ -256,7 +240,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
if
(
!
uses_index_fields_only
(
cond
,
table
,
keyno
,
other_tbls_ok
))
if
(
!
uses_index_fields_only
(
cond
,
table
,
keyno
,
other_tbls_ok
))
return
(
COND
*
)
0
;
return
(
COND
*
)
0
;
cond
->
marker
=
ICP_COND_USES_INDEX_ONLY
;
return
cond
;
return
cond
;
}
}
...
...
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