Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1995 05/06/30 14:50:44 marko@stripped +1 -0
InnoDB: Optimize [and clarify] a condition in build_template()
sql/ha_innodb.cc
1.222 05/06/30 14:50:35 marko@stripped +20 -10
build_template(): Optimize (and make more human-readable)
the condition for skipping a field.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: marko
# Host: hundin.mysql.fi
# Root: /home/marko/mysql-5.0-current
--- 1.221/sql/ha_innodb.cc Tue Jun 21 11:49:46 2005
+++ 1.222/sql/ha_innodb.cc Thu Jun 30 14:50:35 2005
@@ -2955,19 +2955,29 @@
templ = prebuilt->mysql_template + n_requested_fields;
field = table->field[i];
- ibool index_contains_field=
- dict_index_contains_col_or_prefix(index, i);
+ if (templ_type == ROW_MYSQL_REC_FIELDS) {
+ if (!dict_index_contains_col_or_prefix(index, i)) {
+ if (!prebuilt->read_just_key) {
- if (templ_type == ROW_MYSQL_REC_FIELDS &&
- ((prebuilt->read_just_key && !index_contains_field) ||
- (!(fetch_all_in_key && index_contains_field) &&
- !(fetch_primary_key_cols &&
- dict_table_col_in_clustered_key(index->table, i)) &&
- thd->query_id != field->query_id))) {
+ goto might_skip_field;
+ }
- /* This field is not needed in the query, skip it */
+ goto skip_field;
+ }
- goto skip_field;
+ if (!fetch_all_in_key) {
+might_skip_field:
+ if (thd->query_id != field->query_id &&
+ (!fetch_primary_key_cols ||
+ !dict_table_col_in_clustered_key(
+ index->table, i))) {
+
+ /* This field is not needed
+ in the query, skip it */
+
+ goto skip_field;
+ }
+ }
}
n_requested_fields++;
| Thread |
|---|
| • bk commit into 5.0 tree (marko:1.1995) | Marko Mäkelä | 30 Jun |