Show
added a comment - - edited In this SQL script:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
k INTEGER UNSIGNED DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t1 (k, c, pad) VALUES (10, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (11, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (12, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (13, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (14, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (15, 'a', 'xxx');
INSERT INTO t1 (k, c, pad) VALUES (16, 'a', 'xxx');
SELECT * FROM t1 WHERE id=13;
Item_func::type() is called 16 times from JOIN::optimizer() and its callees during the above SELECT query:
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x00000000006357ec in build_equal_items_for_cond(THD*, Item*, COND_EQUAL*, bool) ()
#2 0x0000000000636333 in build_equal_items(JOIN*, Item*, COND_EQUAL*, List<TABLE_LIST>*, bool, COND_EQUAL**, bool) [clone .constprop.266] ()
#3 0x0000000000636890 in JOIN::optimize_inner() ()
#4 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000635802 in build_equal_items_for_cond(THD*, Item*, COND_EQUAL*, bool) ()
#2 0x0000000000636333 in build_equal_items(JOIN*, Item*, COND_EQUAL*, List<TABLE_LIST>*, bool, COND_EQUAL**, bool) [clone .constprop.266] ()
#3 0x0000000000636890 in JOIN::optimize_inner() ()
#4 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000635853 in build_equal_items_for_cond(THD*, Item*, COND_EQUAL*, bool) ()
#2 0x0000000000636333 in build_equal_items(JOIN*, Item*, COND_EQUAL*, List<TABLE_LIST>*, bool, COND_EQUAL**, bool) [clone .constprop.266] ()
#3 0x0000000000636890 in JOIN::optimize_inner() ()
#4 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x000000000063634f in build_equal_items(JOIN*, Item*, COND_EQUAL*, List<TABLE_LIST>*, bool, COND_EQUAL**, bool) [clone .constprop.266] ()
#2 0x0000000000636890 in JOIN::optimize_inner() ()
#3 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000636361 in build_equal_items(JOIN*, Item*, COND_EQUAL*, List<TABLE_LIST>*, bool, COND_EQUAL**, bool) [clone .constprop.266] ()
#2 0x0000000000636890 in JOIN::optimize_inner() ()
#3 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000615b8a in propagate_cond_constants(THD*, I_List<COND_CMP>*, Item*, Item*) ()
#2 0x00000000006368a3 in JOIN::optimize_inner() ()
#3 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000620d54 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#2 0x00000000006368b5 in JOIN::optimize_inner() ()
#3 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x000000000061fe5a in internal_remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#2 0x0000000000620d69 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#3 0x00000000006368b5 in JOIN::optimize_inner() ()
#4 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x000000000061fd4d in cond_is_datetime_is_null(Item*) ()
#2 0x000000000061fe6d in internal_remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#3 0x0000000000620d69 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#4 0x00000000006368b5 in JOIN::optimize_inner() ()
#5 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x00000000006368c9 in JOIN::optimize_inner() ()
#2 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000615e97 in add_key_fields(JOIN*, key_field_t**, unsigned int*, Item*, unsigned long long, st_sargable_param**) ()
#2 0x000000000061773a in update_ref_and_keys(THD*, st_dynamic_array*, st_join_table*, unsigned int, Item*, unsigned long long, st_select_lex*, st_sargable_param**) [clone .isra.257] ()
#3 0x000000000053f1e7 in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#4 0x0000000000636b00 in JOIN::optimize_inner() ()
#5 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000615ea9 in add_key_fields(JOIN*, key_field_t**, unsigned int*, Item*, unsigned long long, st_sargable_param**) ()
#2 0x000000000061773a in update_ref_and_keys(THD*, st_dynamic_array*, st_join_table*, unsigned int, Item*, unsigned long long, st_select_lex*, st_sargable_param**) [clone .isra.257] ()
#3 0x000000000053f1e7 in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#4 0x0000000000636b00 in JOIN::optimize_inner() ()
#5 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000615ebf in add_key_fields(JOIN*, key_field_t**, unsigned int*, Item*, unsigned long long, st_sargable_param**) ()
#2 0x000000000061773a in update_ref_and_keys(THD*, st_dynamic_array*, st_join_table*, unsigned int, Item*, unsigned long long, st_select_lex*, st_sargable_param**) [clone .isra.257] ()
#3 0x000000000053f1e7 in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#4 0x0000000000636b00 in JOIN::optimize_inner() ()
#5 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x0000000000620d54 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#2 0x000000000053facf in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#3 0x0000000000636b00 in JOIN::optimize_inner() ()
#4 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x000000000061fe5a in internal_remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#2 0x0000000000620d69 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#3 0x000000000053facf in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#4 0x0000000000636b00 in JOIN::optimize_inner() ()
#5 0x0000000000638eed in JOIN::optimize() ()
#0 0x00000000005b4a70 in Item_func::type() const ()
#1 0x000000000061fd4d in cond_is_datetime_is_null(Item*) ()
#2 0x000000000061fe6d in internal_remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#3 0x0000000000620d69 in remove_eq_conds(THD*, Item*, Item::cond_result*) ()
#4 0x000000000053facf in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) ()
#5 0x0000000000636b00 in JOIN::optimize_inner() ()
#6 0x0000000000638eed in JOIN::optimize() ()
In this SQL script:
Item_func::type() is called 16 times from JOIN::optimizer() and its callees during the above SELECT query: