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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4eba9892
Commit
4eba9892
authored
Jul 01, 2005
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: Optimize [and clarify] a condition in build_template()
parent
d115c0d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
sql/ha_innodb.cc
sql/ha_innodb.cc
+32
-9
No files found.
sql/ha_innodb.cc
View file @
4eba9892
...
@@ -2955,21 +2955,44 @@ build_template(
...
@@ -2955,21 +2955,44 @@ build_template(
templ
=
prebuilt
->
mysql_template
+
n_requested_fields
;
templ
=
prebuilt
->
mysql_template
+
n_requested_fields
;
field
=
table
->
field
[
i
];
field
=
table
->
field
[
i
];
ibool
index_contains_field
=
if
(
UNIV_LIKELY
(
templ_type
==
ROW_MYSQL_REC_FIELDS
))
{
dict_index_contains_col_or_prefix
(
index
,
i
);
/* Decide which columns we should fetch
and which we can skip. */
register
const
ibool
index_contains_field
=
dict_index_contains_col_or_prefix
(
index
,
i
);
if
(
templ_type
==
ROW_MYSQL_REC_FIELDS
&&
if
(
!
index_contains_field
&&
prebuilt
->
read_just_key
)
{
((
prebuilt
->
read_just_key
&&
!
index_contains_field
)
||
/* If this is a 'key read', we do not need
(
!
(
fetch_all_in_key
&&
index_contains_field
)
&&
columns that are not in the key */
!
(
fetch_primary_key_cols
&&
dict_table_col_in_clustered_key
(
index
->
table
,
i
))
&&
goto
skip_field
;
thd
->
query_id
!=
field
->
query_id
)))
{
}
if
(
index_contains_field
&&
fetch_all_in_key
)
{
/* This field is needed in the query */
goto
include_field
;
}
if
(
thd
->
query_id
==
field
->
query_id
)
{
/* This field is needed in the query */
goto
include_field
;
}
if
(
fetch_primary_key_cols
&&
dict_table_col_in_clustered_key
(
index
->
table
,
i
))
{
/* This field is needed in the query */
goto
include_field
;
}
/* This field is not needed in the query, skip it */
/* This field is not needed in the query, skip it */
goto
skip_field
;
goto
skip_field
;
}
}
include_field:
n_requested_fields
++
;
n_requested_fields
++
;
templ
->
col_no
=
i
;
templ
->
col_no
=
i
;
...
...
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