I observed a similar-looking "hanging" on a custom tree based on MySQL 5.6.10 (with a different query) - of course, without selectivity, but possibly they have the same origin, and selectivity just reveals the problem on the small test case.
The stack trace from MySQL shows some movement,
From MySQL:
8 |
root |
127.0.0.1:37745 |
test |
Query |
671 |
statistics |
SELECT alias2 . `col_varchar_10_latin1` AS field1 FROM BB AS alias1 RIGHT JOIN M AS alias2 LE |
9 |
root |
127.0.0.1:37747 |
test |
Query |
325 |
statistics |
SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , a |
Thread 3 (Thread 0x7f40f238a700 (LWP 15293)):
#0 __lll_unlock_wake () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:368
#1 0x00007f41085c72fc in pthread_rwlock_rdlock () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:136
#2 0x0000000000db7096 in read_lock_stack (cs=0x7f40b00009a0) at dbug/dbug.c:424
#3 0x0000000000db9982 in db_return (line=1059, stack_frame=0x7f40f2382910) at dbug/dbug.c:1300
#4 0x000000000099321b in Optimize_table_order::best_access_path (this=0x7f40f2387160, s=0x7f40b01e6df8, remaining_tables=26626, idx=14, disable_jbuf=false, record_count=1.2884080000000001e+30, pos=0x7f40b01e8ef8, loose_scan_pos=0x7f40f2382d60) at sql/sql_planner.cc:1059
#5 0x00000000009948f8 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=26626, idx=14, record_count=1.2884080000000001e+30, read_time=9.2016425319781671e+29, current_search_depth=48) at sql/sql_planner.cc:1841
#6 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=27138, idx=13, record_count=1.6105100000000001e+29, read_time=3.2773243197816783e+28, current_search_depth=49) at sql/sql_planner.cc:1976
#7 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=27170, idx=12, record_count=1.6105100000000001e+26, read_time=2.1245205836670787e+26, current_search_depth=50) at sql/sql_planner.cc:1976
#8 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=158242, idx=11, record_count=1.4641000000000001e+25, read_time=1.9190858366707861e+25, current_search_depth=51) at sql/sql_planner.cc:1976
#9 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223778, idx=10, record_count=1.3310000000000001e+24, read_time=1.6216583667078606e+24, current_search_depth=52) at sql/sql_planner.cc:1976
#10 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223786, idx=9, record_count=1.2100000000000001e+23, read_time=2.4458366707860238e+22, current_search_depth=53) at sql/sql_planner.cc:1976
#11 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223850, idx=8, record_count=1.21e+20, read_time=2.4429558812383281e+19, current_search_depth=54) at sql/sql_planner.cc:1976
#12 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=227946, idx=7, record_count=1.21e+17, read_time=24562627080547260, current_search_depth=55) at sql/sql_planner.cc:1976
#13 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228202, idx=6, record_count=121000000000000, read_time=158600209819661.25, current_search_depth=56) at sql/sql_planner.cc:1976
#14 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228203, idx=5, record_count=11000000000000, read_time=13400209819661.268, current_search_depth=57) at sql/sql_planner.cc:1976
#15 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=260971, idx=4, record_count=1000000000000, read_time=200209819661.2677, current_search_depth=58) at sql/sql_planner.cc:1976
#16 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=261099, idx=3, record_count=1000000000, read_time=200206564.1583252, current_search_depth=59) at sql/sql_planner.cc:1976
#17 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262123, idx=2, record_count=1000000, read_time=200324.34875488281, current_search_depth=60) at sql/sql_planner.cc:1976
#18 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262139, idx=1, record_count=1000, read_time=260, current_search_depth=61) at sql/sql_planner.cc:1976
#19 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262143, idx=0, record_count=1, read_time=0, current_search_depth=62) at sql/sql_planner.cc:1976
#20 0x0000000000993e07 in Optimize_table_order::greedy_search (this=0x7f40f2387160, remaining_tables=262143) at sql/sql_planner.cc:1466
#21 0x0000000000993626 in Optimize_table_order::choose_table_order (this=0x7f40f2387160) at sql/sql_planner.cc:1139
#22 0x000000000096eb0e in make_join_statistics (join=0x7f40b01e0e00, tables_arg=0x7f40b000bb20, conds=0x7f40b01e3378, keyuse_array=0x7f40b01e1028, first_optimization=true) at sql/sql_optimizer.cc:3740
#23 0x0000000000965b84 in JOIN::optimize (this=0x7f40b01e0e00) at sql/sql_optimizer.cc:379
#24 0x00000000007cdb56 in mysql_execute_select (thd=0x28af1c0, select_lex=0x28b19a8, free_join=true) at sql/sql_select.cc:1086
#25 0x00000000007cde8c in mysql_select (thd=0x28af1c0, tables=0x7f40b000bb20, wild_num=0, fields=..., conds=0x7f40b01e0ad0, order=0x28b1b70, group=0x28b1aa8, having=0x0, select_options=2148272640, result=0x7f40b01e0dd8, unit=0x28b1368, select_lex=0x28b19a8) at sql/sql_select.cc:1221
#26 0x00000000007cbfda in handle_select (thd=0x28af1c0, result=0x7f40b01e0dd8, setup_tables_done_option=0) at sql/sql_select.cc:110
#27 0x00000000007a8697 in execute_sqlcom_select (thd=0x28af1c0, all_tables=0x7f40b000bb20) at sql/sql_parse.cc:5019
#28 0x00000000007a1509 in mysql_execute_command (thd=0x28af1c0) at sql/sql_parse.cc:2589
#29 0x00000000007aaafb in mysql_parse (thd=0x28af1c0, rawbuf=0x7f40b000a250 "SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W A"..., length=2336, parser_state=0x7f40f2389110) at sql/sql_parse.cc:6149
#30 0x000000000079e822 in dispatch_command (command=COM_QUERY, thd=0x28af1c0, packet=0x28b2e11 " SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W"..., packet_length=2340) at sql/sql_parse.cc:1334
#31 0x000000000079d972 in do_command (thd=0x28af1c0) at sql/sql_parse.cc:1036
#32 0x0000000000768af5 in do_handle_one_connection (thd_arg=0x28af1c0) at sql/sql_connect.cc:969
#33 0x000000000076851a in handle_one_connection (arg=0x28af1c0) at sql/sql_connect.cc:885
#34 0x0000000000d8a168 in pfs_spawn_thread (arg=0x286e530) at storage/perfschema/pfs.cc:1853
#35 0x00007f41085c3e9a in start_thread (arg=0x7f40f238a700) at pthread_create.c:308
#36 0x00007f4107adecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#37 0x0000000000000000 in ?? ()
A couple min later:
Thread 3 (Thread 0x7f40f238a700 (LWP 15293)):
#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132
#1 0x00007f41085c72e1 in pthread_rwlock_rdlock () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:120
#2 0x0000000000db7096 in read_lock_stack (cs=0x7f40b00009a0) at dbug/dbug.c:424
#3 0x0000000000db96d1 in db_enter (func=0xfcdb78 "Optimize_table_order::best_access_path", file=0xfcdb48 "sql/sql_planner.cc", line=429, stack_frame=0x7f40f2382500) at dbug/dbug.c:1229
#4 0x0000000000991266 in Optimize_table_order::best_access_path (this=0x7f40f2387160, s=0x7f40b01e7ff8, remaining_tables=213024, idx=14, disable_jbuf=false, record_count=1.6105100000000001e+29, pos=0x7f40b01e8ef8, loose_scan_pos=0x7f40f2382950) at sql/sql_planner.cc:429
#5 0x00000000009948f8 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=213024, idx=14, record_count=1.6105100000000001e+29, read_time=3.2823793261380907e+28, current_search_depth=48) at sql/sql_planner.cc:1841
#6 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=213026, idx=13, record_count=1.6105100000000001e+26, read_time=3.2948573270550628e+25, current_search_depth=49) at sql/sql_planner.cc:1976
#7 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=217122, idx=12, record_count=1.6105100000000001e+23, read_time=1.9624900518502574e+23, current_search_depth=50) at sql/sql_planner.cc:1976
#8 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225314, idx=11, record_count=1.4641e+22, read_time=2.9878051850257181e+21, current_search_depth=51) at sql/sql_planner.cc:1976
#9 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225570, idx=10, record_count=1.4641e+19, read_time=2.076641167977035e+19, current_search_depth=52) at sql/sql_planner.cc:1976
#10 0x0000000000995ac6 in Optimize_table_order::eq_ref_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225570, idx=10, record_count=1.4641e+19, read_time=2.076641167977035e+19, current_search_depth=52) at sql/sql_planner.cc:2286
#11 0x0000000000994d63 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=226082, idx=9, record_count=1.4641e+19, read_time=1.7838211679770339e+19, current_search_depth=53) at sql/sql_planner.cc:1950
#12 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228130, idx=8, record_count=1.331e+18, read_time=2.6901167977034016e+17, current_search_depth=54) at sql/sql_planner.cc:1976
#13 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228258, idx=7, record_count=1331000000000000, read_time=270358511795177, current_search_depth=55) at sql/sql_planner.cc:1976
#14 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229282, idx=6, record_count=1331000000000, read_time=1621760162426.585, current_search_depth=56) at sql/sql_planner.cc:1976
#15 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229290, idx=5, record_count=121000000000, read_time=24560162426.585083, current_search_depth=57) at sql/sql_planner.cc:1976
#16 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229354, idx=4, record_count=121000000, read_time=158600324.34875488, current_search_depth=58) at sql/sql_planner.cc:1976
#17 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229355, idx=3, record_count=11000000, read_time=13400324.348754883, current_search_depth=59) at sql/sql_planner.cc:1976
#18 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262123, idx=2, record_count=1000000, read_time=200324.34875488281, current_search_depth=60) at sql/sql_planner.cc:1976
#19 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262139, idx=1, record_count=1000, read_time=260, current_search_depth=61) at sql/sql_planner.cc:1976
#20 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262143, idx=0, record_count=1, read_time=0, current_search_depth=62) at sql/sql_planner.cc:1976
#21 0x0000000000993e07 in Optimize_table_order::greedy_search (this=0x7f40f2387160, remaining_tables=262143) at sql/sql_planner.cc:1466
#22 0x0000000000993626 in Optimize_table_order::choose_table_order (this=0x7f40f2387160) at sql/sql_planner.cc:1139
#23 0x000000000096eb0e in make_join_statistics (join=0x7f40b01e0e00, tables_arg=0x7f40b000bb20, conds=0x7f40b01e3378, keyuse_array=0x7f40b01e1028, first_optimization=true) at sql/sql_optimizer.cc:3740
#24 0x0000000000965b84 in JOIN::optimize (this=0x7f40b01e0e00) at sql/sql_optimizer.cc:379
#25 0x00000000007cdb56 in mysql_execute_select (thd=0x28af1c0, select_lex=0x28b19a8, free_join=true) at sql/sql_select.cc:1086
#26 0x00000000007cde8c in mysql_select (thd=0x28af1c0, tables=0x7f40b000bb20, wild_num=0, fields=..., conds=0x7f40b01e0ad0, order=0x28b1b70, group=0x28b1aa8, having=0x0, select_options=2148272640, result=0x7f40b01e0dd8, unit=0x28b1368, select_lex=0x28b19a8) at sql/sql_select.cc:1221
#27 0x00000000007cbfda in handle_select (thd=0x28af1c0, result=0x7f40b01e0dd8, setup_tables_done_option=0) at sql/sql_select.cc:110
#28 0x00000000007a8697 in execute_sqlcom_select (thd=0x28af1c0, all_tables=0x7f40b000bb20) at sql/sql_parse.cc:5019
#29 0x00000000007a1509 in mysql_execute_command (thd=0x28af1c0) at sql/sql_parse.cc:2589
#30 0x00000000007aaafb in mysql_parse (thd=0x28af1c0, rawbuf=0x7f40b000a250 "SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W A"..., length=2336, parser_state=0x7f40f2389110) at sql/sql_parse.cc:6149
#31 0x000000000079e822 in dispatch_command (command=COM_QUERY, thd=0x28af1c0, packet=0x28b2e11 " SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W"..., packet_length=2340) at sql/sql_parse.cc:1334
#32 0x000000000079d972 in do_command (thd=0x28af1c0) at sql/sql_parse.cc:1036
#33 0x0000000000768af5 in do_handle_one_connection (thd_arg=0x28af1c0) at sql/sql_connect.cc:969
#34 0x000000000076851a in handle_one_connection (arg=0x28af1c0) at sql/sql_connect.cc:885
#35 0x0000000000d8a168 in pfs_spawn_thread (arg=0x286e530) at storage/perfschema/pfs.cc:1853
#36 0x00007f41085c3e9a in start_thread (arg=0x7f40f238a700) at pthread_create.c:308
#37 0x00007f4107adecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
I observed a similar-looking "hanging" on a custom tree based on MySQL 5.6.10 (with a different query) - of course, without selectivity, but possibly they have the same origin, and selectivity just reveals the problem on the small test case.
The stack trace from MySQL shows some movement,
From MySQL:
Thread 3 (Thread 0x7f40f238a700 (LWP 15293)):
#0 __lll_unlock_wake () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:368
#1 0x00007f41085c72fc in pthread_rwlock_rdlock () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:136
#2 0x0000000000db7096 in read_lock_stack (cs=0x7f40b00009a0) at dbug/dbug.c:424
#3 0x0000000000db9982 in db_return (line=1059, stack_frame=0x7f40f2382910) at dbug/dbug.c:1300
#4 0x000000000099321b in Optimize_table_order::best_access_path (this=0x7f40f2387160, s=0x7f40b01e6df8, remaining_tables=26626, idx=14, disable_jbuf=false, record_count=1.2884080000000001e+30, pos=0x7f40b01e8ef8, loose_scan_pos=0x7f40f2382d60) at sql/sql_planner.cc:1059
#5 0x00000000009948f8 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=26626, idx=14, record_count=1.2884080000000001e+30, read_time=9.2016425319781671e+29, current_search_depth=48) at sql/sql_planner.cc:1841
#6 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=27138, idx=13, record_count=1.6105100000000001e+29, read_time=3.2773243197816783e+28, current_search_depth=49) at sql/sql_planner.cc:1976
#7 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=27170, idx=12, record_count=1.6105100000000001e+26, read_time=2.1245205836670787e+26, current_search_depth=50) at sql/sql_planner.cc:1976
#8 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=158242, idx=11, record_count=1.4641000000000001e+25, read_time=1.9190858366707861e+25, current_search_depth=51) at sql/sql_planner.cc:1976
#9 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223778, idx=10, record_count=1.3310000000000001e+24, read_time=1.6216583667078606e+24, current_search_depth=52) at sql/sql_planner.cc:1976
#10 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223786, idx=9, record_count=1.2100000000000001e+23, read_time=2.4458366707860238e+22, current_search_depth=53) at sql/sql_planner.cc:1976
#11 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=223850, idx=8, record_count=1.21e+20, read_time=2.4429558812383281e+19, current_search_depth=54) at sql/sql_planner.cc:1976
#12 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=227946, idx=7, record_count=1.21e+17, read_time=24562627080547260, current_search_depth=55) at sql/sql_planner.cc:1976
#13 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228202, idx=6, record_count=121000000000000, read_time=158600209819661.25, current_search_depth=56) at sql/sql_planner.cc:1976
#14 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228203, idx=5, record_count=11000000000000, read_time=13400209819661.268, current_search_depth=57) at sql/sql_planner.cc:1976
#15 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=260971, idx=4, record_count=1000000000000, read_time=200209819661.2677, current_search_depth=58) at sql/sql_planner.cc:1976
#16 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=261099, idx=3, record_count=1000000000, read_time=200206564.1583252, current_search_depth=59) at sql/sql_planner.cc:1976
#17 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262123, idx=2, record_count=1000000, read_time=200324.34875488281, current_search_depth=60) at sql/sql_planner.cc:1976
#18 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262139, idx=1, record_count=1000, read_time=260, current_search_depth=61) at sql/sql_planner.cc:1976
#19 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262143, idx=0, record_count=1, read_time=0, current_search_depth=62) at sql/sql_planner.cc:1976
#20 0x0000000000993e07 in Optimize_table_order::greedy_search (this=0x7f40f2387160, remaining_tables=262143) at sql/sql_planner.cc:1466
#21 0x0000000000993626 in Optimize_table_order::choose_table_order (this=0x7f40f2387160) at sql/sql_planner.cc:1139
#22 0x000000000096eb0e in make_join_statistics (join=0x7f40b01e0e00, tables_arg=0x7f40b000bb20, conds=0x7f40b01e3378, keyuse_array=0x7f40b01e1028, first_optimization=true) at sql/sql_optimizer.cc:3740
#23 0x0000000000965b84 in JOIN::optimize (this=0x7f40b01e0e00) at sql/sql_optimizer.cc:379
#24 0x00000000007cdb56 in mysql_execute_select (thd=0x28af1c0, select_lex=0x28b19a8, free_join=true) at sql/sql_select.cc:1086
#25 0x00000000007cde8c in mysql_select (thd=0x28af1c0, tables=0x7f40b000bb20, wild_num=0, fields=..., conds=0x7f40b01e0ad0, order=0x28b1b70, group=0x28b1aa8, having=0x0, select_options=2148272640, result=0x7f40b01e0dd8, unit=0x28b1368, select_lex=0x28b19a8) at sql/sql_select.cc:1221
#26 0x00000000007cbfda in handle_select (thd=0x28af1c0, result=0x7f40b01e0dd8, setup_tables_done_option=0) at sql/sql_select.cc:110
#27 0x00000000007a8697 in execute_sqlcom_select (thd=0x28af1c0, all_tables=0x7f40b000bb20) at sql/sql_parse.cc:5019
#28 0x00000000007a1509 in mysql_execute_command (thd=0x28af1c0) at sql/sql_parse.cc:2589
#29 0x00000000007aaafb in mysql_parse (thd=0x28af1c0, rawbuf=0x7f40b000a250 "SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W A"..., length=2336, parser_state=0x7f40f2389110) at sql/sql_parse.cc:6149
#30 0x000000000079e822 in dispatch_command (command=COM_QUERY, thd=0x28af1c0, packet=0x28b2e11 " SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W"..., packet_length=2340) at sql/sql_parse.cc:1334
#31 0x000000000079d972 in do_command (thd=0x28af1c0) at sql/sql_parse.cc:1036
#32 0x0000000000768af5 in do_handle_one_connection (thd_arg=0x28af1c0) at sql/sql_connect.cc:969
#33 0x000000000076851a in handle_one_connection (arg=0x28af1c0) at sql/sql_connect.cc:885
#34 0x0000000000d8a168 in pfs_spawn_thread (arg=0x286e530) at storage/perfschema/pfs.cc:1853
#35 0x00007f41085c3e9a in start_thread (arg=0x7f40f238a700) at pthread_create.c:308
#36 0x00007f4107adecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#37 0x0000000000000000 in ?? ()
A couple min later:
Thread 3 (Thread 0x7f40f238a700 (LWP 15293)):
#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132
#1 0x00007f41085c72e1 in pthread_rwlock_rdlock () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:120
#2 0x0000000000db7096 in read_lock_stack (cs=0x7f40b00009a0) at dbug/dbug.c:424
#3 0x0000000000db96d1 in db_enter (func=0xfcdb78 "Optimize_table_order::best_access_path", file=0xfcdb48 "sql/sql_planner.cc", line=429, stack_frame=0x7f40f2382500) at dbug/dbug.c:1229
#4 0x0000000000991266 in Optimize_table_order::best_access_path (this=0x7f40f2387160, s=0x7f40b01e7ff8, remaining_tables=213024, idx=14, disable_jbuf=false, record_count=1.6105100000000001e+29, pos=0x7f40b01e8ef8, loose_scan_pos=0x7f40f2382950) at sql/sql_planner.cc:429
#5 0x00000000009948f8 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=213024, idx=14, record_count=1.6105100000000001e+29, read_time=3.2823793261380907e+28, current_search_depth=48) at sql/sql_planner.cc:1841
#6 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=213026, idx=13, record_count=1.6105100000000001e+26, read_time=3.2948573270550628e+25, current_search_depth=49) at sql/sql_planner.cc:1976
#7 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=217122, idx=12, record_count=1.6105100000000001e+23, read_time=1.9624900518502574e+23, current_search_depth=50) at sql/sql_planner.cc:1976
#8 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225314, idx=11, record_count=1.4641e+22, read_time=2.9878051850257181e+21, current_search_depth=51) at sql/sql_planner.cc:1976
#9 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225570, idx=10, record_count=1.4641e+19, read_time=2.076641167977035e+19, current_search_depth=52) at sql/sql_planner.cc:1976
#10 0x0000000000995ac6 in Optimize_table_order::eq_ref_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=225570, idx=10, record_count=1.4641e+19, read_time=2.076641167977035e+19, current_search_depth=52) at sql/sql_planner.cc:2286
#11 0x0000000000994d63 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=226082, idx=9, record_count=1.4641e+19, read_time=1.7838211679770339e+19, current_search_depth=53) at sql/sql_planner.cc:1950
#12 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228130, idx=8, record_count=1.331e+18, read_time=2.6901167977034016e+17, current_search_depth=54) at sql/sql_planner.cc:1976
#13 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=228258, idx=7, record_count=1331000000000000, read_time=270358511795177, current_search_depth=55) at sql/sql_planner.cc:1976
#14 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229282, idx=6, record_count=1331000000000, read_time=1621760162426.585, current_search_depth=56) at sql/sql_planner.cc:1976
#15 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229290, idx=5, record_count=121000000000, read_time=24560162426.585083, current_search_depth=57) at sql/sql_planner.cc:1976
#16 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229354, idx=4, record_count=121000000, read_time=158600324.34875488, current_search_depth=58) at sql/sql_planner.cc:1976
#17 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=229355, idx=3, record_count=11000000, read_time=13400324.348754883, current_search_depth=59) at sql/sql_planner.cc:1976
#18 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262123, idx=2, record_count=1000000, read_time=200324.34875488281, current_search_depth=60) at sql/sql_planner.cc:1976
#19 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262139, idx=1, record_count=1000, read_time=260, current_search_depth=61) at sql/sql_planner.cc:1976
#20 0x0000000000994f00 in Optimize_table_order::best_extension_by_limited_search (this=0x7f40f2387160, remaining_tables=262143, idx=0, record_count=1, read_time=0, current_search_depth=62) at sql/sql_planner.cc:1976
#21 0x0000000000993e07 in Optimize_table_order::greedy_search (this=0x7f40f2387160, remaining_tables=262143) at sql/sql_planner.cc:1466
#22 0x0000000000993626 in Optimize_table_order::choose_table_order (this=0x7f40f2387160) at sql/sql_planner.cc:1139
#23 0x000000000096eb0e in make_join_statistics (join=0x7f40b01e0e00, tables_arg=0x7f40b000bb20, conds=0x7f40b01e3378, keyuse_array=0x7f40b01e1028, first_optimization=true) at sql/sql_optimizer.cc:3740
#24 0x0000000000965b84 in JOIN::optimize (this=0x7f40b01e0e00) at sql/sql_optimizer.cc:379
#25 0x00000000007cdb56 in mysql_execute_select (thd=0x28af1c0, select_lex=0x28b19a8, free_join=true) at sql/sql_select.cc:1086
#26 0x00000000007cde8c in mysql_select (thd=0x28af1c0, tables=0x7f40b000bb20, wild_num=0, fields=..., conds=0x7f40b01e0ad0, order=0x28b1b70, group=0x28b1aa8, having=0x0, select_options=2148272640, result=0x7f40b01e0dd8, unit=0x28b1368, select_lex=0x28b19a8) at sql/sql_select.cc:1221
#27 0x00000000007cbfda in handle_select (thd=0x28af1c0, result=0x7f40b01e0dd8, setup_tables_done_option=0) at sql/sql_select.cc:110
#28 0x00000000007a8697 in execute_sqlcom_select (thd=0x28af1c0, all_tables=0x7f40b000bb20) at sql/sql_parse.cc:5019
#29 0x00000000007a1509 in mysql_execute_command (thd=0x28af1c0) at sql/sql_parse.cc:2589
#30 0x00000000007aaafb in mysql_parse (thd=0x28af1c0, rawbuf=0x7f40b000a250 "SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W A"..., length=2336, parser_state=0x7f40f2389110) at sql/sql_parse.cc:6149
#31 0x000000000079e822 in dispatch_command (command=COM_QUERY, thd=0x28af1c0, packet=0x28b2e11 " SELECT alias1 . `col_varchar_1024_latin1` AS field1 , alias1 . `col_varchar_1024_utf8` AS field2 , alias1 . `col_date` AS field3 , alias1 . `col_int` AS field4 FROM P AS alias1 LEFT OUTER JOIN W"..., packet_length=2340) at sql/sql_parse.cc:1334
#32 0x000000000079d972 in do_command (thd=0x28af1c0) at sql/sql_parse.cc:1036
#33 0x0000000000768af5 in do_handle_one_connection (thd_arg=0x28af1c0) at sql/sql_connect.cc:969
#34 0x000000000076851a in handle_one_connection (arg=0x28af1c0) at sql/sql_connect.cc:885
#35 0x0000000000d8a168 in pfs_spawn_thread (arg=0x286e530) at storage/perfschema/pfs.cc:1853
#36 0x00007f41085c3e9a in start_thread (arg=0x7f40f238a700) at pthread_create.c:308
#37 0x00007f4107adecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112