YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
if (items.elements == 0)
{
DBUG_PRINT("info", ("All parameters were removed by optimizer."));
DBUG_VOID_RETURN;
}
/* add result field */
items.push_front(val);
cache_table_param.init(); /* dependent items and result */
cache_table_param.field_count= cache_table_param.func_count= items.elements; /* postpone table creation to index description */
cache_table_param.skip_create_table= 1;
Expression_cache::result Expression_cache_tmptable::check_value(Item **value)
{ int res;
DBUG_ENTER("Expression_cache_tmptable::check_value");
if (cache_table)
{
DBUG_PRINT("info", ("status: %u has_record %u",
(uint)cache_table->status, (uint)ref.has_record)); if ((res= join_read_key2(table_thd, NULL, cache_table, &ref)) == 1)
DBUG_RETURN(ERROR);
if (res)
{ if (((++miss) == EXPCACHE_CHECK_HIT_RATIO_AFTER) &&
((double)hit / ((double)hit + miss)) <
EXPCACHE_MIN_HIT_RATE_FOR_MEM_TABLE)
{
DBUG_PRINT("info",
("Early check: hit rate is not so good to keep the cache"));
disable_cache();
}
if (unlikely((error=
cache_table->file->ha_write_tmp_row(cache_table->record[0]))))
{ /* create_myisam_from_heap will generate error if needed */ if (cache_table->file->is_fatal_error(error, HA_CHECK_DUP) &&
error != HA_ERR_RECORD_FILE_FULL) goto err; else
{ double hit_rate= ((double)hit / ((double)hit + miss));
DBUG_ASSERT(miss > 0); if (hit_rate < EXPCACHE_MIN_HIT_RATE_FOR_MEM_TABLE)
{
DBUG_PRINT("info", ("hit rate is not so good to keep the cache"));
disable_cache();
DBUG_RETURN(FALSE);
} elseif (hit_rate < EXPCACHE_MIN_HIT_RATE_FOR_DISK_TABLE)
{
DBUG_PRINT("info", ("hit rate is not so good to go to disk")); if (cache_table->file->ha_delete_all_rows() ||
cache_table->file->ha_write_tmp_row(cache_table->record[0])) goto err;
} else
{ if (create_internal_tmp_table_from_heap(table_thd, cache_table,
cache_table_param.start_recinfo,
&cache_table_param.recinfo,
error, 1, NULL)) goto err2;
}
}
}
cache_table->status= 0; /* cache_table->record contains an existed record */
ref.has_record= TRUE; /* the same as above */
DBUG_PRINT("info", ("has_record: TRUE status: 0"));
str->append('<');
li++; // skip result field while ((item= li++))
{ if (!is_first)
str->append(',');
item->print(str, query_type);
is_first= FALSE;
}
str->append('>');
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.