#2 0x00000000007c1b14 in handle_fatal_signal (sig=11) at maria-5.5/sql/signal_handler.cc:262
|
#3 <signal handler called>
|
#4 0x00000000007e0ae2 in Item_field::print (this=0x3c5b9d0, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item.cc:6554
|
#5 0x000000000081bbc0 in Item_func::print_op (this=0x3c61698, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item_func.cc:490
|
#6 0x00000000008034e7 in Item_bool_func2::print (this=0x3c61698, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item_cmpfunc.h:384
|
#7 0x00000000007fe987 in Item_cond::print (this=0x3c5cf70, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item_cmpfunc.cc:4559
|
#8 0x0000000000674443 in st_select_lex::print (this=0x3be3cd0, thd=0x3abb300, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/sql_select.cc:22446
|
#9 0x000000000085d272 in subselect_single_select_engine::print (this=0x3be7778, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item_subselect.cc:3695
|
#10 0x000000000085560c in Item_subselect::print (this=0x3be7640, str=0x7f83f41bb030, query_type=QT_ORDINARY) at maria-5.5/sql/item_subselect.cc:874
|
#11 0x000000000066e935 in change_to_use_tmp_fields (thd=0x3abb300, ref_pointer_array=0x3c43cf8, res_selected_fields=..., res_all_fields=..., elements=2, all_fields=...) at maria-5.5/sql/sql_select.cc:20637
|
#12 0x000000000064219d in JOIN::exec (this=0x3c43780) at maria-5.5/sql/sql_select.cc:2421
|
#13 0x00000000006444c7 in mysql_select (thd=0x3abb300, rref_pointer_array=0x3bd66c8, tables=0x3be2a40, wild_num=0, fields=..., conds=0x0, og_num=3, order=0x3c42ee0, group=0x3be77b8, having=0x0, proc_param=0x0, select_options=2416184064, result=0x3c43690, unit=0x3bd5d98, select_lex=0x3bd6470) at maria-5.5/sql/sql_select.cc:3055
|
#14 0x00000000005e82d1 in mysql_derived_fill (thd=0x3abb300, lex=0x3abd680, derived=0x3bbc4c0) at maria-5.5/sql/sql_derived.cc:885
|
#15 0x00000000005e6f76 in mysql_handle_single_derived (lex=0x3abd680, derived=0x3bbc4c0, phases=96) at maria-5.5/sql/sql_derived.cc:179
|
#16 0x0000000000656477 in st_join_table::preread_init (this=0x3c6dff8) at maria-5.5/sql/sql_select.cc:10380
|
#17 0x0000000000663a51 in sub_select (join=0x3c43178, join_tab=0x3c6dff8, end_of_records=false) at maria-5.5/sql/sql_select.cc:16083
|
#18 0x00000000006634b3 in do_select (join=0x3c43178, fields=0x3abdf18, table=0x0, procedure=0x0) at maria-5.5/sql/sql_select.cc:15785
|
#19 0x0000000000643cca in JOIN::exec (this=0x3c43178) at maria-5.5/sql/sql_select.cc:2835
|
#20 0x00000000006444c7 in mysql_select (thd=0x3abb300, rref_pointer_array=0x3abe060, tables=0x3bbc4c0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x3c43158, unit=0x3abd730, select_lex=0x3abde08) at maria-5.5/sql/sql_select.cc:3055
|
#21 0x000000000063b019 in handle_select (thd=0x3abb300, lex=0x3abd680, result=0x3c43158, setup_tables_done_option=0) at maria-5.5/sql/sql_select.cc:316
|
#22 0x00000000006142b5 in execute_sqlcom_select (thd=0x3abb300, all_tables=0x3bbc4c0) at maria-5.5/sql/sql_parse.cc:4615
|
#23 0x000000000060cdc4 in mysql_execute_command (thd=0x3abb300) at maria-5.5/sql/sql_parse.cc:2182
|
#24 0x0000000000616b1d in mysql_parse (thd=0x3abb300, rawbuf=0x3bbc2e8 "SELECT * FROM v", length=15, parser_state=0x7f83f41bc500) at maria-5.5/sql/sql_parse.cc:5730
|
#25 0x000000000060a337 in dispatch_command (command=COM_QUERY, thd=0x3abb300, packet=0x3c3dee1 "", packet_length=15) at maria-5.5/sql/sql_parse.cc:1055
|
#26 0x00000000006095ee in do_command (thd=0x3abb300) at maria-5.5/sql/sql_parse.cc:794
|
#27 0x000000000070be7b in do_handle_one_connection (thd_arg=0x3abb300) at maria-5.5/sql/sql_connect.cc:1253
|
#28 0x000000000070b866 in handle_one_connection (arg=0x3abb300) at maria-5.5/sql/sql_connect.cc:1168
|
#29 0x0000000000b8e10f in pfs_spawn_thread (arg=0x3c3cc40) at maria-5.5/storage/perfschema/pfs.cc:1015
|
#30 0x00007f83ff81aefc in start_thread (arg=0x7f83f41bd700) at pthread_create.c:304
|
branch: maria/5.5
|
bzr version-info
|
revision-id: wlad@montyprogram.com-20121120142439-zvx42vxhc8lurmnv
|
date: 2012-11-20 15:24:39 +0100
|
revno: 3576
|
branch-nick: maria-5.5
|
Built with BUILD/compile-pentium-debug-max-no-ndb
Reproducible with MyISAM, Aria, InnoDB.
Reproducible on current 5.5 and 10.0.
Could not reproduce on 5.3 and on MySQL 5.6 (in both cases it throws a warning "View merge algorithm can't be used here for now (assumed undefined algorithm)").
Minimal optimizer_switch: materialization=on,semijoin=on
Default optimizer_switch:
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
|
EXPLAIN with the default optimizer_switch:
EXPLAIN EXTENDED
|
SELECT * FROM v;
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 100.00
|
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using temporary
|
2 DERIVED table1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
7 SUBQUERY <subquery8> const distinct_key distinct_key 8 const,const 1 100.00
|
7 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
8 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
|
8 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
5 SUBQUERY <subquery6> const distinct_key distinct_key 8 const,const 1 100.00
|
5 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
6 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
|
6 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
3 SUBQUERY <subquery4> const distinct_key distinct_key 8 const,const 1 100.00
|
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
4 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
|
4 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
Warnings:
|
Note 1003 select `v`.`field1` AS `field1`,`v`.`field2` AS `field2` from `test`.`v`
|
Test case:
SET optimizer_switch = 'materialization=on,semijoin=on';
|
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES (1),(7);
|
|
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
INSERT INTO t2 VALUES (4),(6);
|
|
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
|
INSERT INTO t3 VALUES (1),(2);
|
|
|
CREATE ALGORITHM=MERGE VIEW v AS SELECT
|
( SELECT a FROM t1 WHERE ( 1, 1 ) IN (
|
SELECT b, c FROM t2, t3 HAVING c > 2 ) ) AS field1,
|
b + c AS field2
|
FROM t2, t3 AS table1
|
GROUP BY field1, field2 ORDER BY field1;
|
|
SELECT * FROM v;
|
{"report":{"fcp":1511,"ttfb":641.6999998092651,"pageVisibility":"visible","entityId":22009,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"88a3c989-d893-4344-9cfd-933e75ba295c","navigationType":0,"readyForUser":1624.5999999046326,"redirectCount":0,"resourceLoadedEnd":1844.5,"resourceLoadedStart":651.5999999046326,"resourceTiming":[{"duration":145.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":651.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":651.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":797.5,"responseStart":0,"secureConnectionStart":0},{"duration":146,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":651.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":651.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":797.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":208.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":652.1999998092651,"connectEnd":652.1999998092651,"connectStart":652.1999998092651,"domainLookupEnd":652.1999998092651,"domainLookupStart":652.1999998092651,"fetchStart":652.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":652.1999998092651,"responseEnd":860.5,"responseStart":860.5,"secureConnectionStart":652.1999998092651},{"duration":322.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":652.3000001907349,"connectEnd":652.3000001907349,"connectStart":652.3000001907349,"domainLookupEnd":652.3000001907349,"domainLookupStart":652.3000001907349,"fetchStart":652.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":652.3000001907349,"responseEnd":974.8000001907349,"responseStart":974.8000001907349,"secureConnectionStart":652.3000001907349},{"duration":337.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":652.5,"connectEnd":652.5,"connectStart":652.5,"domainLookupEnd":652.5,"domainLookupStart":652.5,"fetchStart":652.5,"redirectEnd":0,"redirectStart":0,"requestStart":652.5,"responseEnd":990.3000001907349,"responseStart":990.3000001907349,"secureConnectionStart":652.5},{"duration":338.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":652.8000001907349,"connectEnd":652.8000001907349,"connectStart":652.8000001907349,"domainLookupEnd":652.8000001907349,"domainLookupStart":652.8000001907349,"fetchStart":652.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":652.8000001907349,"responseEnd":990.9000000953674,"responseStart":990.9000000953674,"secureConnectionStart":652.8000001907349},{"duration":338,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":653.3000001907349,"connectEnd":653.3000001907349,"connectStart":653.3000001907349,"domainLookupEnd":653.3000001907349,"domainLookupStart":653.3000001907349,"fetchStart":653.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":653.3000001907349,"responseEnd":991.3000001907349,"responseStart":991.3000001907349,"secureConnectionStart":653.3000001907349},{"duration":367.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":653.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":653.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1021.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":338.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":653.6999998092651,"connectEnd":653.6999998092651,"connectStart":653.6999998092651,"domainLookupEnd":653.6999998092651,"domainLookupStart":653.6999998092651,"fetchStart":653.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":653.6999998092651,"responseEnd":991.9000000953674,"responseStart":991.9000000953674,"secureConnectionStart":653.6999998092651},{"duration":368.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":653.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":653.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1022,"responseStart":0,"secureConnectionStart":0},{"duration":339.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":654,"connectEnd":654,"connectStart":654,"domainLookupEnd":654,"domainLookupStart":654,"fetchStart":654,"redirectEnd":0,"redirectStart":0,"requestStart":654,"responseEnd":993.0999999046326,"responseStart":993,"secureConnectionStart":654},{"duration":1187.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":654.9000000953674,"connectEnd":654.9000000953674,"connectStart":654.9000000953674,"domainLookupEnd":654.9000000953674,"domainLookupStart":654.9000000953674,"fetchStart":654.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":654.9000000953674,"responseEnd":1842.3000001907349,"responseStart":1842.3000001907349,"secureConnectionStart":654.9000000953674},{"duration":1189.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":655,"connectEnd":655,"connectStart":655,"domainLookupEnd":655,"domainLookupStart":655,"fetchStart":655,"redirectEnd":0,"redirectStart":0,"requestStart":655,"responseEnd":1844.5,"responseStart":1844.5,"secureConnectionStart":655},{"duration":772.2999997138977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1070.4000000953674,"connectEnd":1070.4000000953674,"connectStart":1070.4000000953674,"domainLookupEnd":1070.4000000953674,"domainLookupStart":1070.4000000953674,"fetchStart":1070.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1070.4000000953674,"responseEnd":1842.6999998092651,"responseStart":1842.6999998092651,"secureConnectionStart":1070.4000000953674},{"duration":462.80000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1458,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1458,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1920.8000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":468,"responseStart":641,"responseEnd":646,"domLoading":647,"domInteractive":1947,"domContentLoadedEventStart":1947,"domContentLoadedEventEnd":2009,"domComplete":3114,"loadEventStart":3114,"loadEventEnd":3116,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1932.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1933.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1933.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1936.9000000953674},{"name":"activityTabFullyLoaded","time":2019.0999999046326}],"measures":[],"correlationId":"e46df4828d21d2","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}