Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Fix Version/s:
None
Component/s:
None
SET optimizer_use_condition_selectivity=3;
SET use_stat_tables = PREFERABLY;
CREATE TABLE t1 (a INT );
INSERT INTO t1 VALUES
(1),(7),(4),(7),(0),(2),(9),(4),(0),(9),(1),(3),(8),(8);
CREATE TABLE t2 (b INT );
INSERT INTO t2 VALUES (4),(5),(2),(5),(1),(1),(2);
ANALYZE TABLE t1, t2;
FLUSH TABLES;
SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4;
#3 <signal handler called>
#4 0x00000000008e5762 in calculate_cond_selectivity_for_table (thd=0x3a70800, table=0x7fcedc02dc70, cond=0x7fcedc12e518) at /data/bzr/maria-10.0-mwl253/sql/opt_range.cc:3377
#5 0x000000000064d8ae in make_join_statistics (join=0x7fcedc12e710, tables_list=..., conds=0x7fcedc12e518, keyuse_array=0x7fcedc12ea18) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:3839
#6 0x0000000000644c03 in JOIN::optimize_inner (this=0x7fcedc12e710) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:1306
#7 0x0000000000643bd2 in JOIN::optimize (this=0x7fcedc12e710) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:1008
#8 0x000000000064b6df in mysql_select (thd=0x3a70800, rref_pointer_array=0x3a73738, tables=0x7fcedc0e93c0, wild_num=1, fields=..., conds=0x7fcedc12e518, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcedc12e6f0, unit=0x3a72e00, select_lex=0x3a734d8) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:3220
#9 0x0000000000642041 in handle_select (thd=0x3a70800, lex=0x3a72d48, result=0x7fcedc12e6f0, setup_tables_done_option=0) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:376
#10 0x000000000061a185 in execute_sqlcom_select (thd=0x3a70800, all_tables=0x7fcedc0e93c0) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:4797
#11 0x000000000061278e in mysql_execute_command (thd=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:2266
#12 0x000000000061ca26 in mysql_parse (thd=0x3a70800, rawbuf=0x7fcedc0e9168 "SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4", length=79, parser_state=0x7fcee739d500) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:5920
#13 0x000000000060fab2 in dispatch_command (command=COM_QUERY, thd=0x3a70800, packet=0x3a75d01 "SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4", packet_length=79) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:1091
#14 0x000000000060ece0 in do_command (thd=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:810
#15 0x00000000007222fe in do_handle_one_connection (thd_arg=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_connect.cc:1266
#16 0x0000000000721ce9 in handle_one_connection (arg=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_connect.cc:1181
#17 0x0000000000c9d5d4 in pfs_spawn_thread (arg=0x3a1d230) at /data/bzr/maria-10.0-mwl253/storage/perfschema/pfs.cc:1015
#18 0x00007fcef2a8ae9a in start_thread (arg=0x7fcee739e700) at pthread_create.c:308
#19 0x00007fcef1d7ecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
revision-id: igor@askmonty.org-20130404211131-w3aybgqc80g7aiaq
revno: 3516
branch-nick: maria-10.0-mwl253
Reproducible with MyISAM, InnoDB, Aria.
EXPLAIN also crashes.
relates to
MDEV-4145
Take into account the selectivity of single-table range predicates on non-indexed columns when searching for the best execution plan
Closed
{"report":{"fcp":1588.3000001907349,"ttfb":213.59999990463257,"pageVisibility":"visible","entityId":23559,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"40e5f157-c2a2-4a03-bdf2-505582665322","navigationType":0,"readyForUser":1699,"redirectCount":0,"resourceLoadedEnd":1681.5,"resourceLoadedStart":220.19999980926514,"resourceTiming":[{"duration":421.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":220.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":220.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":421.90000009536743,"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":220.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":220.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":441.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":220.69999980926514,"connectEnd":220.69999980926514,"connectStart":220.69999980926514,"domainLookupEnd":220.69999980926514,"domainLookupStart":220.69999980926514,"fetchStart":220.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":220.69999980926514,"responseEnd":662,"responseStart":662,"secureConnectionStart":220.69999980926514},{"duration":585.2999997138977,"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":220.90000009536743,"connectEnd":220.90000009536743,"connectStart":220.90000009536743,"domainLookupEnd":220.90000009536743,"domainLookupStart":220.90000009536743,"fetchStart":220.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":220.90000009536743,"responseEnd":806.1999998092651,"responseStart":806.1999998092651,"secureConnectionStart":220.90000009536743},{"duration":596.2000002861023,"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":221.09999990463257,"connectEnd":221.09999990463257,"connectStart":221.09999990463257,"domainLookupEnd":221.09999990463257,"domainLookupStart":221.09999990463257,"fetchStart":221.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":221.09999990463257,"responseEnd":817.3000001907349,"responseStart":817.3000001907349,"secureConnectionStart":221.09999990463257},{"duration":597.1999998092651,"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":221.30000019073486,"connectEnd":221.30000019073486,"connectStart":221.30000019073486,"domainLookupEnd":221.30000019073486,"domainLookupStart":221.30000019073486,"fetchStart":221.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":221.30000019073486,"responseEnd":818.5,"responseStart":818.5,"secureConnectionStart":221.30000019073486},{"duration":601.0999999046326,"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":221.5,"connectEnd":221.5,"connectStart":221.5,"domainLookupEnd":221.5,"domainLookupStart":221.5,"fetchStart":221.5,"redirectEnd":0,"redirectStart":0,"requestStart":221.5,"responseEnd":822.5999999046326,"responseStart":822.5999999046326,"secureConnectionStart":221.5},{"duration":707.2000002861023,"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":221.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":221.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":601.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":221.80000019073486,"connectEnd":221.80000019073486,"connectStart":221.80000019073486,"domainLookupEnd":221.80000019073486,"domainLookupStart":221.80000019073486,"fetchStart":221.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":221.80000019073486,"responseEnd":823.5,"responseStart":823.5,"secureConnectionStart":221.80000019073486},{"duration":706.9000000953674,"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":222,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":602,"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":222.09999990463257,"connectEnd":222.09999990463257,"connectStart":222.09999990463257,"domainLookupEnd":222.09999990463257,"domainLookupStart":222.09999990463257,"fetchStart":222.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":222.09999990463257,"responseEnd":824.0999999046326,"responseStart":824.0999999046326,"secureConnectionStart":222.09999990463257},{"duration":920.5999999046326,"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":223.09999990463257,"connectEnd":223.09999990463257,"connectStart":223.09999990463257,"domainLookupEnd":223.09999990463257,"domainLookupStart":223.09999990463257,"fetchStart":223.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":223.09999990463257,"responseEnd":1143.6999998092651,"responseStart":1143.6999998092651,"secureConnectionStart":223.09999990463257},{"duration":1458.4000000953674,"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":223.09999990463257,"connectEnd":223.09999990463257,"connectStart":223.09999990463257,"domainLookupEnd":223.09999990463257,"domainLookupStart":223.09999990463257,"fetchStart":223.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":223.09999990463257,"responseEnd":1681.5,"responseStart":1681.5,"secureConnectionStart":223.09999990463257},{"duration":190.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":962.8000001907349,"connectEnd":962.8000001907349,"connectStart":962.8000001907349,"domainLookupEnd":962.8000001907349,"domainLookupStart":962.8000001907349,"fetchStart":962.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":962.8000001907349,"responseEnd":1153.3000001907349,"responseStart":1153.3000001907349,"secureConnectionStart":962.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":63,"responseStart":213,"responseEnd":215,"domLoading":217,"domInteractive":1807,"domContentLoadedEventStart":1807,"domContentLoadedEventEnd":1893,"domComplete":3794,"loadEventStart":3794,"loadEventEnd":3795,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1779.5},{"name":"bigPipe.sidebar-id.end","time":1780.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1780.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1783.5999999046326},{"name":"activityTabFullyLoaded","time":1911.5}],"measures":[],"correlationId":"a494bf295a9ce3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":88,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}