summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-03-23 18:22:39 +0200
committerMichael Widenius <monty@askmonty.org>2012-03-23 18:22:39 +0200
commitc36bdf1c889539413d5369ae628aff97d044b276 (patch)
treed53d59e615088a42a15e4eaae85b20acf6e2fe2a /sql/sql_join_cache.cc
parent8e825a2249440e7df0fce0123f6d543b09b29194 (diff)
downloadmariadb-git-c36bdf1c889539413d5369ae628aff97d044b276.tar.gz
Speedup:
- Don't call update_virtual_fields() if table->vfield is not set - Don't prealloc memory for in open_tables() as this is very seldom used. sql/records.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_base.cc: Don't prealloc memory for in open_tables() as this is very seldom used. Don't call update_virtual_fields() if table->vfield is not set sql/sql_delete.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_handler.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_join_cache.cc: Don't call update_virtual_fields() if table->vfield is not set Move some frequent values to local variables sql/sql_table.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_update.cc: Don't call update_virtual_fields() if table->vfield is not set sql/table.cc: Assert if update_virtual_fields is called with wrong parameters
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index a960c63e782..d49be2e446c 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -3344,23 +3344,26 @@ int JOIN_TAB_SCAN::next()
int skip_rc;
READ_RECORD *info= &join_tab->read_record;
SQL_SELECT *select= join_tab->cache_select;
+ TABLE *table= join_tab->table;
+ THD *thd= join->thd;
+
if (is_first_record)
is_first_record= FALSE;
else
err= info->read_record(info);
- if (!err)
- update_virtual_fields(join->thd, join_tab->table);
- while (!err && select && (skip_rc= select->skip_record(join->thd)) <= 0)
+ if (!err && table->vfield)
+ update_virtual_fields(thd, table);
+ while (!err && select && (skip_rc= select->skip_record(thd)) <= 0)
{
- if (join->thd->killed || skip_rc < 0)
+ if (thd->killed || skip_rc < 0)
return 1;
/*
Move to the next record if the last retrieved record does not
meet the condition pushed to the table join_tab.
*/
err= info->read_record(info);
- if (!err)
- update_virtual_fields(join->thd, join_tab->table);
+ if (!err && table->vfield)
+ update_virtual_fields(thd, table);
}
return err;
}
@@ -3874,7 +3877,8 @@ int JOIN_TAB_SCAN_MRR::next()
*/
DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) &&
(uchar *) (*ptr) <= cache->end_pos);
- update_virtual_fields(join->thd, join_tab->table);
+ if (join_tab->table->vfield)
+ update_virtual_fields(join->thd, join_tab->table);
}
return rc;
}