From 11485d6a988ad187302f559d16f11a16cb9f0996 Mon Sep 17 00:00:00 2001 From: wangt1xiuyi <13547954130@163.com> Date: Mon, 28 Nov 2022 01:54:50 +0000 Subject: [PATCH] [SCN REFACTOR] replace flash back snapshot and remove read snapshot session --- .gitignore | 1 + .secignore | 60 +- CLOSE_SOURCES | 138 - CMakeLists.txt | 6 - NEWS | 3 - deps/easy/src/io/easy_ssl.c | 21 - deps/oblib/README.md | 3 - deps/oblib/src/common/ob_store_format.cpp | 6 +- deps/oblib/src/lib/hash/ob_hashmap.h | 4 + deps/oblib/src/lib/hash/ob_hashtable.h | 2 + deps/oblib/src/lib/json_type/ob_json_base.cpp | 8 +- deps/oblib/src/lib/json_type/ob_json_bin.cpp | 6 +- deps/oblib/src/lib/lock/ob_bucket_lock.cpp | 12 +- deps/oblib/src/lib/lock/ob_bucket_lock.h | 4 +- .../lib/mysqlclient/mysql_result_wrapper.h | 1 - .../lib/mysqlclient/ob_mysql_connection.cpp | 1 - .../mysqlclient/ob_mysql_connection_pool.cpp | 6 +- .../mysqlclient/ob_mysql_connection_pool.h | 3 +- .../src/lib/mysqlclient/ob_mysql_result.h | 23 +- .../mysqlclient/ob_server_connection_pool.cpp | 1 - deps/oblib/src/lib/ob_define.h | 1 + .../lib/objectpool/ob_concurrency_objpool.h | 37 +- deps/oblib/src/lib/oblog/ob_log.cpp | 1 + deps/oblib/src/lib/oblog/ob_log.h | 2 + .../src/lib/restore/cos/ob_cos_wrapper.h | 1 - .../src/lib/restore/ob_object_device.cpp | 3 +- .../src/lib/signal/ob_signal_handlers.cpp | 4 +- .../oblib/src/lib/signal/ob_signal_worker.cpp | 3 + deps/oblib/src/lib/utility/ob_edit_distance.h | 11 +- deps/oblib/src/lib/utility/ob_fast_convert.h | 1 - deps/oblib/src/lib/utility/utility.cpp | 3 +- deps/oblib/src/rpc/frame/ob_req_transport.cpp | 2 +- .../ob_mysql_compress_protocol_processor.cpp | 2 - deps/oblib/src/rpc/obmysql/ob_mysql_packet.h | 1 - .../rpc/obmysql/ob_mysql_request_utils.cpp | 2 - .../rpc/obmysql/packet/ompk_change_user.cpp | 1 - script/dooba/README.md | 9 +- .../archiveservice/ob_archive_service.cpp | 2 + .../election_priority_v1.cpp | 7 +- .../src/ob_cdc_part_trans_resolver.cpp | 30 +- .../libobcdc/src/ob_cdc_part_trans_resolver.h | 11 +- .../libobcdc/src/ob_log_part_trans_task.cpp | 6 +- .../libobcdc/src/ob_log_part_trans_task.h | 17 +- src/logservice/libobcdc/tests/wallet/ca.pem | 19 - .../libobcdc/tests/wallet/client-cert.pem | 19 - .../tests/wallet/client-cert_error.pem | Bin 1079 -> 0 bytes .../libobcdc/tests/wallet/client-key.pem | 27 - .../tests/wallet/client-key_error.pem | Bin 1680 -> 0 bytes src/logservice/palf/log_iterator_impl.h | 2 +- src/logservice/palf/palf_env_impl.cpp | 61 +- src/logservice/palf/palf_env_impl.h | 10 - src/logservice/palf/palf_handle_impl.cpp | 14 +- src/logservice/palf/palf_handle_impl.h | 3 - src/logservice/palf/palf_iterator.h | 2 +- .../restoreservice/ob_log_restore_handler.h | 2 +- src/objit/include/objit/common/ob_item_type.h | 2 + .../ob_dbms_sched_job_master.cpp | 1 + .../ob_dbms_sched_table_operator.cpp | 15 + .../ob_dbms_sched_table_operator.h | 3 + src/observer/ob_dump_task_generator.cpp | 2 +- src/observer/ob_inner_sql_connection.cpp | 27 +- src/observer/ob_inner_sql_connection.h | 6 +- src/observer/ob_rpc_processor_simple.cpp | 5 +- src/observer/ob_service.cpp | 2 +- src/observer/ob_sql_client_decorator.cpp | 11 - src/observer/omt/ob_multi_tenant.cpp | 48 +- src/observer/omt/ob_multi_tenant.h | 4 +- src/observer/omt/ob_tenant_node_balancer.cpp | 24 +- src/observer/omt/ob_tenant_node_balancer.h | 2 +- .../ob_all_virtual_session_wait.cpp | 4 + .../ob_all_virtual_session_wait_history.cpp | 4 +- .../virtual_table/ob_tenant_virtual_outline.h | 2 + .../ob_virtual_open_cursor_table.cpp | 573 +- .../ob_virtual_open_cursor_table.h | 151 +- .../ob_virtual_table_iterator_factory.cpp | 2 - src/pl/ob_pl_code_generator.cpp | 25 +- src/pl/ob_pl_code_generator.h | 5 +- src/pl/ob_pl_resolver.cpp | 1 + .../backup/ob_backup_clean_task_mgr.cpp | 19 +- .../backup/ob_backup_data_scheduler.cpp | 3 +- .../backup/ob_tenant_archive_scheduler.cpp | 11 +- .../ddl_task/ob_column_redefinition_task.cpp | 11 +- .../ddl_task/ob_column_redefinition_task.h | 1 + .../ddl_task/ob_constraint_task.cpp | 35 +- src/rootserver/ddl_task/ob_constraint_task.h | 3 - .../ddl_task/ob_ddl_redefinition_task.cpp | 24 +- .../ddl_task/ob_ddl_redefinition_task.h | 6 +- src/rootserver/ddl_task/ob_ddl_scheduler.cpp | 15 +- src/rootserver/ddl_task/ob_ddl_scheduler.h | 1 + .../ob_ddl_single_replica_executor.cpp | 2 + .../ddl_task/ob_ddl_single_replica_executor.h | 9 +- .../ddl_task/ob_index_build_task.cpp | 68 +- src/rootserver/ddl_task/ob_index_build_task.h | 15 +- .../ddl_task/ob_table_redefinition_task.cpp | 11 +- .../ddl_task/ob_table_redefinition_task.h | 1 + ...b_disaster_recovery_task_table_updater.cpp | 68 +- src/rootserver/ob_root_service.cpp | 2 +- src/rootserver/restore/ob_restore_util.cpp | 1 + src/share/allocator/ob_reserve_arena.h | 8 +- src/share/backup/ob_archive_checkpoint.cpp | 72 +- src/share/backup/ob_backup_clean_util.cpp | 74 +- src/share/backup/ob_backup_clean_util.h | 21 + src/share/backup/ob_backup_path.cpp | 20 +- src/share/backup/ob_backup_path.h | 5 + src/share/backup/ob_backup_struct.cpp | 2 +- src/share/get_oer_define.py | 101 - .../ob_inner_table_schema.12151_12200.cpp | 45 + .../ob_inner_table_schema.15101_15150.cpp | 45 + .../ob_inner_table_schema.28051_28100.cpp | 100 + src/share/inner_table/ob_inner_table_schema.h | 14 +- .../ob_inner_table_schema_constants.h | 4 + .../inner_table/ob_inner_table_schema_def.py | 103 +- src/share/ob_ddl_checksum.cpp | 82 +- src/share/ob_ddl_checksum.h | 20 +- src/share/ob_ddl_common.cpp | 17 +- src/share/ob_ddl_common.h | 19 +- src/share/ob_ddl_task_executor.h | 2 +- src/share/ob_debug_sync_point.h | 2 + src/share/ob_errno.cpp | 19 +- src/share/ob_errno.def | 3 +- src/share/ob_errno.h | 5 +- src/share/ob_i_tablet_scan.h | 4 +- src/share/ob_rpc_struct.cpp | 20 +- src/share/ob_rpc_struct.h | 25 +- src/share/ob_thread_define.h | 2 +- src/share/restore/ob_log_archive_source_mgr.h | 2 +- src/share/rpc/ob_async_rpc_proxy.h | 1 + .../scheduler/ob_dag_warning_history_mgr.h | 2 +- src/share/scheduler/ob_sys_task_stat.cpp | 2 +- src/share/schema/ob_dblink_mgr.cpp | 7 +- src/share/schema/ob_schema_cache.cpp | 26 +- src/share/schema/ob_schema_mgr.cpp | 60 +- src/share/schema/ob_schema_struct.cpp | 7 +- src/share/schema/ob_table_schema.cpp | 17 +- src/share/schema/ob_table_schema.h | 5 + .../code_generator/ob_static_engine_cg.cpp | 26 +- src/sql/das/ob_das_batch_scan_op.cpp | 4 +- src/sql/das/ob_das_scan_op.cpp | 8 +- src/sql/das/ob_das_scan_op.h | 4 +- src/sql/das/ob_das_task_result.cpp | 2 +- .../engine/cmd/ob_alter_system_executor.cpp | 4 + src/sql/engine/expr/ob_expr_oracle_decode.cpp | 63 +- .../expr/ob_expr_user_can_access_obj.cpp | 8 +- src/sql/engine/join/ob_join_filter_op.cpp | 1 + src/sql/engine/ob_exec_context.cpp | 1 + src/sql/engine/ob_exec_context.h | 3 + src/sql/engine/ob_physical_plan.cpp | 6 +- src/sql/engine/ob_physical_plan.h | 7 + .../pdml/static/ob_px_sstable_insert_op.cpp | 1 + .../engine/px/exchange/ob_px_receive_op.cpp | 8 +- src/sql/engine/px/exchange/ob_px_receive_op.h | 15 + src/sql/engine/px/ob_px_dtl_msg.h | 3 +- src/sql/engine/px/ob_px_sub_coord.cpp | 2 + src/sql/engine/px/ob_px_task_process.cpp | 1 + src/sql/engine/table/ob_link_scan_op.cpp | 2 +- src/sql/engine/table/ob_table_scan_op.cpp | 25 +- src/sql/ob_spi.cpp | 51 +- src/sql/ob_spi.h | 14 +- src/sql/ob_sql_temp_table.h | 4 +- src/sql/ob_sql_trans_control.cpp | 10 +- src/sql/ob_sql_utils.cpp | 28 +- src/sql/optimizer/ob_join_order.cpp | 21 +- src/sql/optimizer/ob_log_exchange.h | 2 + src/sql/optimizer/ob_log_join.cpp | 16 +- src/sql/optimizer/ob_log_plan.cpp | 150 +- src/sql/optimizer/ob_log_plan.h | 8 + src/sql/optimizer/ob_log_set.cpp | 21 +- src/sql/optimizer/ob_log_table_scan.cpp | 61 +- src/sql/optimizer/ob_logical_operator.cpp | 29 +- src/sql/optimizer/ob_logical_operator.h | 1 + src/sql/optimizer/ob_optimizer.cpp | 8 +- src/sql/optimizer/ob_optimizer_util.cpp | 119 +- src/sql/optimizer/ob_optimizer_util.h | 9 +- src/sql/optimizer/ob_select_log_plan.cpp | 191 +- src/sql/optimizer/ob_select_log_plan.h | 26 +- src/sql/optimizer/ob_table_location.cpp | 2 +- src/sql/parser/sql_parser_mysql_mode.l | 2 + src/sql/parser/sql_parser_mysql_mode.y | 51 +- .../plan_cache/ob_sql_parameterization.cpp | 2 +- .../cmd/ob_call_procedure_resolver.cpp | 42 +- src/sql/resolver/cmd/ob_resource_resolver.h | 12 +- .../ddl/ob_drop_sequence_resolver.cpp | 4 +- src/sql/resolver/ddl/ob_trigger_resolver.cpp | 1 + src/sql/resolver/dml/ob_del_upd_resolver.cpp | 1 + src/sql/resolver/dml/ob_dml_resolver.cpp | 118 +- src/sql/resolver/dml/ob_dml_resolver.h | 5 +- src/sql/resolver/dml/ob_dml_stmt.cpp | 31 +- src/sql/resolver/dml/ob_dml_stmt.h | 3 + src/sql/resolver/dml/ob_hint.cpp | 37 +- src/sql/resolver/dml/ob_hint.h | 15 +- src/sql/resolver/dml/ob_select_resolver.cpp | 15 +- src/sql/resolver/dml/ob_sql_hint.cpp | 107 +- src/sql/resolver/dml/ob_sql_hint.h | 19 +- src/sql/resolver/dml/ob_update_stmt.cpp | 26 + src/sql/resolver/dml/ob_update_stmt.h | 1 + .../expr/ob_raw_expr_info_extractor.cpp | 1 - .../ob_transform_left_join_to_anti.cpp | 10 +- src/sql/rewrite/ob_transform_rule.h | 20 - .../rewrite/ob_transform_semi_to_inner.cpp | 2 +- src/sql/rewrite/ob_transform_view_merge.cpp | 3 + src/sql/rewrite/ob_transformer_impl.h | 2 +- src/sql/session/ob_basic_session_info.cpp | 10 +- src/sql/session/ob_basic_session_info.h | 7 +- src/storage/access/ob_rows_info.cpp | 2 - src/storage/access/ob_single_merge.cpp | 3 +- src/storage/ddl/ob_build_index_task.cpp | 28 +- src/storage/ddl/ob_build_index_task.h | 5 + src/storage/ddl/ob_complement_data_task.cpp | 17 +- src/storage/ddl/ob_complement_data_task.h | 9 +- src/storage/ddl/ob_ddl_merge_task.cpp | 22 +- src/storage/ddl/ob_ddl_merge_task.h | 11 +- src/storage/ddl/ob_ddl_redo_log_writer.cpp | 207 +- src/storage/ddl/ob_ddl_redo_log_writer.h | 61 +- .../ddl/ob_direct_insert_sstable_ctx.cpp | 18 +- .../ddl/ob_direct_insert_sstable_ctx.h | 11 +- src/storage/ddl/ob_tablet_ddl_kv_mgr.cpp | 21 +- src/storage/ddl/ob_tablet_ddl_kv_mgr.h | 8 +- src/storage/lob/ob_lob_util.h | 4 +- src/storage/ls/ob_ls_tablet_service.cpp | 18 +- src/storage/ls/ob_ls_tablet_service.h | 6 +- .../memtable/mvcc/ob_tx_callback_list.cpp | 2 +- src/storage/memtable/ob_memtable_context.cpp | 8 + src/storage/memtable/ob_row_compactor.cpp | 3 +- src/storage/meta_mem/ob_meta_pointer_map.h | 4 +- .../meta_mem/ob_tenant_meta_mem_mgr.cpp | 20 +- src/storage/meta_mem/ob_tenant_meta_mem_mgr.h | 6 +- src/storage/ob_resource_map.h | 11 +- .../ob_tenant_storage_checkpoint_writer.cpp | 2 +- src/storage/tablet/ob_tablet.cpp | 50 +- src/storage/tablet/ob_tablet.h | 6 + .../tablet/ob_tablet_create_delete_helper.cpp | 82 +- .../tablet/ob_tablet_create_delete_helper.h | 3 +- src/storage/tx/ob_ctx_tx_data.cpp | 35 + src/storage/tx/ob_ctx_tx_data.h | 3 + src/storage/tx/ob_trans_define.cpp | 19 + src/storage/tx/ob_trans_define.h | 2 + src/storage/tx/ob_trans_functor.h | 2 - src/storage/tx/ob_trans_part_ctx.cpp | 76 +- src/storage/tx/ob_two_phase_committer.h | 2 +- src/storage/tx/ob_two_phase_committer_xa.cpp | 13 +- .../tx/ob_two_phase_downstream_committer.cpp | 79 +- .../tx/ob_two_phase_upstream_committer.cpp | 30 +- src/storage/tx/ob_tx_data_define.cpp | 8 +- src/storage/tx/ob_tx_data_define.h | 12 +- src/storage/tx_storage/ob_access_service.cpp | 19 +- .../tx_table/ob_tx_data_memtable_mgr.cpp | 11 +- src/storage/tx_table/ob_tx_data_table.cpp | 16 +- src/storage/tx_table/ob_tx_data_table.h | 8 +- src/storage/tx_table/ob_tx_table.cpp | 2 + src/storage/tx_table/ob_tx_table_interface.h | 2 +- strip2ce | 1630 ---- ...for_producer_consumer_schedule_mode.result | 185 +- ...ansformer_outer_join_simplification.result | 6986 ++++++++--------- tools/deploy/obd.sh | 4 - tools/deploy/obd/obdtest.config.yaml.template | 1 - tools/deploy/obd/observer.include.yaml | 1 - .../docker/standalone/boot/boot-mini-tmp.yaml | 1 - tools/ob_admin/README.md | 43 - .../ob_admin_dump_backup_data_executor.cpp | 4 +- unittest/share/backup/test_backup_struct.cpp | 26 +- unittest/share/mock_kms.pem | 50 - unittest/share/mock_kms_server.py | 41 - unittest/share/test_encryption_util.cpp | 2 +- unittest/share/test_ob_config.cpp | 4 +- unittest/share/test_restore_reader.cpp | 204 - unittest/storage/test_compaction_policy.cpp | 2 +- unittest/storage/test_dml_common.h | 2 +- unittest/storage/test_lob_common.h | 2 +- 268 files changed, 6763 insertions(+), 7737 deletions(-) delete mode 100644 CLOSE_SOURCES delete mode 100644 NEWS delete mode 100644 src/logservice/libobcdc/tests/wallet/ca.pem delete mode 100644 src/logservice/libobcdc/tests/wallet/client-cert.pem delete mode 100755 src/logservice/libobcdc/tests/wallet/client-cert_error.pem delete mode 100644 src/logservice/libobcdc/tests/wallet/client-key.pem delete mode 100755 src/logservice/libobcdc/tests/wallet/client-key_error.pem delete mode 100755 src/share/get_oer_define.py delete mode 100755 strip2ce delete mode 100644 unittest/share/mock_kms.pem delete mode 100644 unittest/share/mock_kms_server.py delete mode 100644 unittest/share/test_restore_reader.cpp diff --git a/.gitignore b/.gitignore index 9fbc66f0d..9a50b99aa 100644 --- a/.gitignore +++ b/.gitignore @@ -323,3 +323,4 @@ tools/deploy/single.yaml tools/ob-configserver/bin/* tools/ob-configserver/tests/*.log tools/ob-configserver/tests/*.out +.history/* diff --git a/.secignore b/.secignore index 1eb1f65e5..8f9ca4907 100644 --- a/.secignore +++ b/.secignore @@ -30,6 +30,7 @@ http://www.python.org/* https://oracle.github.io/* https://en.wikipedia.org/wiki/* + http://en.wikipedia.org/wiki/* https://mariadb.com/* https://github.com/akopytov/sysbench* http://foo.bar.com* @@ -125,6 +126,59 @@ https://github.com/jsteemann/atoi https://tools.ietf.org/html/rfc1951 hewei@mail.ied.ac.cn + http://trade.taobao.com/trade/* + http://buy.tmall.com/order/* + http://unit.buyer.trade.taobao.com/trade/* + http://abc.com/* + https://oceanbase.slack.com/ + https://ask.oceanbase.com/ + https://cdn.nlark.com/yuque/* + https://h5.dingtalk.com/circle/* + https://gw.alipayobjects.com/* + http://yum-test.obvos.alibaba-inc.com/* + http://yum.tbsite.net/taobao/* + https://www.cnblogs.com/* + http://murmurhash.googlepages.com/ + rbrown64@csc.com.au + http://bazaar.launchpad.net/* + http://stackoverflow.com/* + https://cloud.tencent.com/* + http://k3.alibaba-inc.com/* + libecb@schmorp.de + http://software.schmorp.de/* + http://www-01.ibm.com/* + http://msdn.microsoft.com/* + http://www.open-std.org/* + http://forums.freebsd.org/* + http://www.ussg.indiana.edu/* + https://www.qqxiuzi.cn/daohang.htm + https://blog.csdn.net/* + https://es5.github.io/* + http://rapidjson.org/* + https://tools.ietf.org/* + https://github.com/madler/zlib/* + http://www.zlib.net + http://www.oberhumer.com/* + http://www.quicklz.com/ + http://www.goof.com/* + http://www.fastlz.org/* + http://baike.corp.taobao.com/* + http://gitlab.alibaba-inc.com/* + https://gerry.lamost.org/* + https://www.techonthenet.com/oracle/* + http://review.alibaba-inc.com/* + https://gw.alicdn.com/* + http://docs.oracle.com/* + https://oracle-base.com/* + https://www.kernel.org/doc/* + https://www.atatech.org/* + http://oceanbase.alibaba-inc.com/* + https://community.oracle.com/tech/* + https://docs.docker.com/* + http://helloworld.com/* + http://1.1.1.1:8080/* + https://mirrors.aliyun.com/* + https://bixense.com/clicolors/ **/Doxyfile www.doxygen.org) https://www.gnu.org/software/libiconv/ @@ -146,8 +200,9 @@ http://docs.mathjax.org/en/latest/output.html) https://www.mathjax.org https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. + https://issues.apache.org/* + https://www.atatech.org/* **/*.result - http://trade.taobao.com/trade/* https://workitem.aone.alibaba-inc.com/* http://oracle.chinaitlab.com* http://bugfree.corp.taobao.com* @@ -385,9 +440,10 @@ /tools/codestyle/** /src/objit/deps/googletest/** /.git/** +/deps/oblib/src/lib/compress/** -------------------------------------------------------- # Config the ignored fold to escape the Chinese scan by GLOB wildcard -------------------------------------------------------- # Set md5 of pemFile string to filter # This section must be end up with '--------------------------------------------------------'!!! --------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------- diff --git a/CLOSE_SOURCES b/CLOSE_SOURCES deleted file mode 100644 index 6dbc6d5a3..000000000 --- a/CLOSE_SOURCES +++ /dev/null @@ -1,138 +0,0 @@ -# 以下代码目录或者文件,只属于商业版,不属于开源社区版 -# 本文件的目录pattern格式与CODEOWNERS相同 -# 开源裁剪方案参考: https://yuque.antfin-inc.com/docs/share/a24792b6-95f7-4a44-89cb-dd5f9bc59a58?# - -#deps part -deps/oblib/src/lib/xml/** -deps/reasy -deps/oblib/src/lib/oracleclient - -#source part -src/sql/parser/sql_parser_oracle_mode.l -src/sql/parser/sql_parser_oracle_mode.y -src/share/inner_table/sys_package/catodci.sql -src/share/inner_table/sys_package/dbms_any.sql -src/share/inner_table/sys_package/dbms_any_body.sql -src/share/inner_table/sys_package/dbms_application.sql -src/share/inner_table/sys_package/dbms_application_body.sql -src/share/inner_table/sys_package/dbms_audit_mgmt.sql -src/share/inner_table/sys_package/dbms_audit_mgmt_body.sql -src/share/inner_table/sys_package/dbms_crypto.sql -src/share/inner_table/sys_package/dbms_crypto_body.sql -src/share/inner_table/sys_package/dbms_debug.sql -src/share/inner_table/sys_package/dbms_debug_body.sql -src/share/inner_table/sys_package/dbms_describe.sql -src/share/inner_table/sys_package/dbms_describe_body.sql -src/share/inner_table/sys_package/dbms_errlog.sql -src/share/inner_table/sys_package/dbms_errlog_body.sql -src/share/inner_table/sys_package/dbms_ijob.sql -src/share/inner_table/sys_package/dbms_ijob_body.sql -src/share/inner_table/sys_package/dbms_ischeduler.sql -src/share/inner_table/sys_package/dbms_ischeduler_body.sql -src/share/inner_table/sys_package/dbms_job.sql -src/share/inner_table/sys_package/dbms_job_body.sql -src/share/inner_table/sys_package/dbms_lob.sql -src/share/inner_table/sys_package/dbms_lob_body.sql -src/share/inner_table/sys_package/dbms_lock.sql -src/share/inner_table/sys_package/dbms_lock_body.sql -src/share/inner_table/sys_package/dbms_metadata.sql -src/share/inner_table/sys_package/dbms_metadata_body.sql -src/share/inner_table/sys_package/dbms_monitor.sql -src/share/inner_table/sys_package/dbms_monitor_body.sql -src/share/inner_table/sys_package/dbms_output.sql -src/share/inner_table/sys_package/dbms_output_body.sql -src/share/inner_table/sys_package/dbms_plancache.sql -src/share/inner_table/sys_package/dbms_plancache_body.sql -src/share/inner_table/sys_package/dbms_preprocessor.sql -src/share/inner_table/sys_package/dbms_preprocessor_body.sql -src/share/inner_table/sys_package/dbms_random.sql -src/share/inner_table/sys_package/dbms_random_body.sql -src/share/inner_table/sys_package/dbms_resource_manager.sql -src/share/inner_table/sys_package/dbms_resource_manager_body.sql -src/share/inner_table/sys_package/dbms_scheduler.sql -src/share/inner_table/sys_package/dbms_scheduler_body.sql -src/share/inner_table/sys_package/dbms_session.sql -src/share/inner_table/sys_package/dbms_session_body.sql -src/share/inner_table/sys_package/dbms_spm.sql -src/share/inner_table/sys_package/dbms_spm_body.sql -src/share/inner_table/sys_package/dbms_spm_mysql.sql -src/share/inner_table/sys_package/dbms_spm_body_mysql.sql -src/share/inner_table/sys_package/dbms_sql.sql -src/share/inner_table/sys_package/dbms_sql_body.sql -src/share/inner_table/sys_package/dbms_standard.sql -src/share/inner_table/sys_package/dbms_stats.sql -src/share/inner_table/sys_package/dbms_stats_body.sql -src/share/inner_table/sys_package/dbms_sys_error.sql -src/share/inner_table/sys_package/dbms_sys_error_body.sql -src/share/inner_table/sys_package/dbms_utility.sql -src/share/inner_table/sys_package/dbms_utility_body.sql -src/share/inner_table/sys_package/dbms_utl_encode.sql -src/share/inner_table/sys_package/dbms_utl_encode_body.sql -src/share/inner_table/sys_package/dbms_warning.sql -src/share/inner_table/sys_package/dbms_warning_body.sql -src/share/inner_table/sys_package/dbms_xa.sql -src/share/inner_table/sys_package/dbms_xa_body.sql -src/share/inner_table/sys_package/odciconst.sql -src/share/inner_table/sys_package/sa_components.sql -src/share/inner_table/sys_package/sa_components_body.sql -src/share/inner_table/sys_package/sa_label_admin.sql -src/share/inner_table/sys_package/sa_label_admin_body.sql -src/share/inner_table/sys_package/sa_policy_admin.sql -src/share/inner_table/sys_package/sa_policy_admin_body.sql -src/share/inner_table/sys_package/sa_session.sql -src/share/inner_table/sys_package/sa_session_body.sql -src/share/inner_table/sys_package/sa_sysdba.sql -src/share/inner_table/sys_package/sa_sysdba_body.sql -src/share/inner_table/sys_package/sa_user_admin.sql -src/share/inner_table/sys_package/sa_user_admin_body.sql -src/share/inner_table/sys_package/utl_file.sql -src/share/inner_table/sys_package/utl_file_body.sql -src/share/inner_table/sys_package/utl_i18n.sql -src/share/inner_table/sys_package/utl_i18n_body.sql -src/share/inner_table/sys_package/utl_inaddr.sql -src/share/inner_table/sys_package/utl_inaddr_body.sql -src/share/inner_table/sys_package/utl_raw.sql -src/share/inner_table/sys_package/utl_raw_body.sql -src/share/inner_table/sys_package/utlpwdmg.sql -src/share/inner_table/sys_package/xml_type.sql -src/share/inner_table/sys_package/xml_type_body.sql -src/logservice/libobcdc/tests/conf - -#tool -tools/agentserver -tools/codestyle -tools/ob_bench -tools/obmeter -tools/obproxy -tools/obtest -tools/script -tools/upgrade/README.md -tools/ob_admin/log_miner - -#script -script/backup_restore -script/ha -script/supervisor -script/deploy -script/remove_old_branches.pl -script/tpcc_create_table_3zone.sql -script/obstat - -#rpm part -rpm/oceanbase-build.sh -rpm/oceanbase-cdc-build.sh - -#other part -hotfuncs.txt -observer.prof -test -mittest -gdb-macros -asan_ignore_list.txt -CODEOWNERS -INSTALL -.akfarm -.aone.yml -.akconfig -.ak_scan_switch -.obdev diff --git a/CMakeLists.txt b/CMakeLists.txt index 77f982214..80753071d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/Utils.cmake) include(cmake/Env.cmake) -#project(OceanBase -# VERSION 4.0.0.0 -# DESCRIPTION "OceanBase distributed database system" -# HOMEPAGE_URL "http://oceanbase.alipay.com" -# LANGUAGES CXX C ASM) - project("OceanBase_CE" VERSION 4.0.0.0 DESCRIPTION "OceanBase distributed database system" diff --git a/NEWS b/NEWS deleted file mode 100644 index 3411dba80..000000000 --- a/NEWS +++ /dev/null @@ -1,3 +0,0 @@ -1.0 will be released. -Kick MySQL's ass. -perf_dev merged into master \ No newline at end of file diff --git a/deps/easy/src/io/easy_ssl.c b/deps/easy/src/io/easy_ssl.c index 3341794d2..be74a6690 100644 --- a/deps/easy/src/io/easy_ssl.c +++ b/deps/easy/src/io/easy_ssl.c @@ -1707,14 +1707,6 @@ static int easy_ssl_dhparam(easy_ssl_ctx_t *ssl, char *file) DH *dh; BIO *bio; - /* - * -----BEGIN DH PARAMETERS----- - * MIGHAoGBALu8LcrYRnSQfEP89YDpz9vZWKP1aLQtSwju1OsPs1BMbAMCducQgAxc - * y7qokiYUxb7spWWl/fHSh6K8BJvmd4Bg6RqSp1fjBI9osHb302zI8pul34HcLKcl - * 7OZicMyaUDXYzs7vnqAnSmOrHlj6/UmI0PZdFGdX2gcd8EXP4WubAgEC - * -----END DH PARAMETERS----- - */ - static unsigned char dh1024_p[] = { 0xBB, 0xBC, 0x2D, 0xCA, 0xD8, 0x46, 0x74, 0x90, 0x7C, 0x43, 0xFC, 0xF5, 0x80, 0xE9, 0xCF, 0xDB, 0xD9, 0x58, 0xA3, 0xF5, 0x68, 0xB4, 0x2D, 0x4B, @@ -1782,19 +1774,6 @@ static int easy_ssl_dhparam_mysql(easy_ssl_ctx_t *ssl) { DH *dh; - /* - Diffie-Hellman key. - Generated using: >openssl dhparam -5 -C 2048 - - -----BEGIN DH PARAMETERS----- - MIIBCAKCAQEAil36wGZ2TmH6ysA3V1xtP4MKofXx5n88xq/aiybmGnReZMviCPEJ - 46+7VCktl/RZ5iaDH1XNG1dVQmznt9pu2G3usU+k1/VB4bQL4ZgW4u0Wzxh9PyXD - glm99I9Xyj4Z5PVE4MyAsxCRGA1kWQpD9/zKAegUBPLNqSo886Uqg9hmn8ksyU9E - BV5eAEciCuawh6V0O+Sj/C3cSfLhgA0GcXp3OqlmcDu6jS5gWjn3LdP1U0duVxMB - h/neTSCSvtce4CAMYMjKNVh9P1nu+2d9ZH2Od2xhRIqMTfAS1KTqF3VmSWzPFCjG - mjxx/bg6bOOjpgZapvB6ABWlWmRmAAWFtwIBBQ== - -----END DH PARAMETERS----- - */ static unsigned char dh2048_p[]= { 0x8A, 0x5D, 0xFA, 0xC0, 0x66, 0x76, 0x4E, 0x61, 0xFA, 0xCA, 0xC0, 0x37, diff --git a/deps/oblib/README.md b/deps/oblib/README.md index 2616accfe..3794cb6f8 100644 --- a/deps/oblib/README.md +++ b/deps/oblib/README.md @@ -1,4 +1 @@ This is a common library for OceanBase project. - -lib code clone from http://gitlab.alibaba-inc.com/oceanbase/oceanbase/commits/master : c1e9d22c09fcbee932f50a026c8084c826734036 - 2016-10-29 22:19:33 diff --git a/deps/oblib/src/common/ob_store_format.cpp b/deps/oblib/src/common/ob_store_format.cpp index 9faccf019..88a103515 100644 --- a/deps/oblib/src/common/ob_store_format.cpp +++ b/deps/oblib/src/common/ob_store_format.cpp @@ -65,7 +65,7 @@ int ObStoreFormat::find_row_store_type(const ObString &row_store, ObRowStoreType } if (!is_row_store_type_valid(row_store_type)) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR("Unexpected row store type", K(row_store_type), K(row_store), K(ret)); + LOG_WARN("Unexpected row store type", K(row_store_type), K(row_store), K(ret)); } } @@ -85,7 +85,7 @@ int ObStoreFormat::find_store_format_type(const ObString &store_format, } else if (!(OB_STORE_FORMAT_INVALID < start && start <= OB_STORE_FORMAT_MAX) || !(OB_STORE_FORMAT_INVALID < end && end <= OB_STORE_FORMAT_MAX)) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR("Unexpected store format type", K(start), K(end), K(ret)); + LOG_WARN("Unexpected store format type", K(start), K(end), K(ret)); } else { for (int64_t i = start; i < end && !is_store_format_valid(store_format_type); i++) { if (0 == store_format.case_compare(get_store_format_name(static_cast (i)))) { @@ -94,7 +94,7 @@ int ObStoreFormat::find_store_format_type(const ObString &store_format, } if (!is_store_format_valid(store_format_type)) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR("Unexpected store format type", K(store_format), K(store_format_type), K(ret)); + LOG_WARN("Unexpected store format type", K(store_format), K(store_format_type), K(ret)); } } diff --git a/deps/oblib/src/lib/hash/ob_hashmap.h b/deps/oblib/src/lib/hash/ob_hashmap.h index ada46adab..ceca6b00c 100644 --- a/deps/oblib/src/lib/hash/ob_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_hashmap.h @@ -104,6 +104,10 @@ public: { return ht_.size(); } + int64_t bucket_count() const + { + return ht_.get_bucket_count(); + } bool empty() const { return 0 == ht_.size(); diff --git a/deps/oblib/src/lib/hash/ob_hashtable.h b/deps/oblib/src/lib/hash/ob_hashtable.h index 62a90530c..f968d9615 100644 --- a/deps/oblib/src/lib/hash/ob_hashtable.h +++ b/deps/oblib/src/lib/hash/ob_hashtable.h @@ -1331,6 +1331,8 @@ public: return size_; } + int64_t get_bucket_count() const { return bucket_num_; } + public: template int serialization(_archive &archive) diff --git a/deps/oblib/src/lib/json_type/ob_json_base.cpp b/deps/oblib/src/lib/json_type/ob_json_base.cpp index a98853bf5..247cd40c6 100644 --- a/deps/oblib/src/lib/json_type/ob_json_base.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_base.cpp @@ -1936,7 +1936,7 @@ int ObIJsonBase::to_number(ObIAllocator *allocator, number::ObNumber &number) co int ObIJsonBase::to_datetime(int64_t &value) const { INIT_SUCC(ret); - int64_t datetime; + int64_t datetime = 0; switch (json_type()) { case ObJsonNodeType::J_DATETIME: @@ -1985,7 +1985,7 @@ int ObIJsonBase::to_datetime(int64_t &value) const int ObIJsonBase::to_date(int32_t &value) const { INIT_SUCC(ret); - int32_t date; + int32_t date = 0; switch (json_type()) { case ObJsonNodeType::J_DATETIME: @@ -2032,7 +2032,7 @@ int ObIJsonBase::to_date(int32_t &value) const int ObIJsonBase::to_time(int64_t &value) const { INIT_SUCC(ret); - int64_t time; + int64_t time = 0; switch (json_type()) { case ObJsonNodeType::J_TIME: { @@ -2077,7 +2077,7 @@ int ObIJsonBase::to_time(int64_t &value) const int ObIJsonBase::to_bit(uint64_t &value) const { INIT_SUCC(ret); - uint64_t bit; + uint64_t bit = 0; const ObJsonNodeType j_type = json_type(); ObDTMode dt_mode = 0; diff --git a/deps/oblib/src/lib/json_type/ob_json_bin.cpp b/deps/oblib/src/lib/json_type/ob_json_bin.cpp index d0a4d91b1..93abbb365 100644 --- a/deps/oblib/src/lib/json_type/ob_json_bin.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_bin.cpp @@ -2398,7 +2398,7 @@ int ObJsonBin::rebuild_with_meta(const char *data, uint64_t length, ObJsonBuffer old_val_entry += key_entry_size * count; } - uint64_t new_val_entry_offset; + uint64_t new_val_entry_offset = 0; if (OB_FAIL(result.append(reinterpret_cast(&new_header), OB_JSON_BIN_HEADER_LEN))) { LOG_WARN("failed to append header", K(ret)); } else if (OB_FAIL(ObJsonVar::append_var(count, new_header.count_size_, result))) { @@ -2840,7 +2840,7 @@ int ObJsonBin::insert_internal_v0(ObJBNodeMeta& meta, int64_t pos, const ObStrin meta_len += key_entry_size * count; } - uint64_t new_val_entry_offset; + uint64_t new_val_entry_offset = 0; if (OB_FAIL(result.reserve(meta.obj_size_))) { LOG_WARN("failed to reserve mem", K(ret), K(meta.obj_size_)); } else if (OB_FAIL(result.append(reinterpret_cast(&new_header), OB_JSON_BIN_HEADER_LEN))) { @@ -3300,7 +3300,7 @@ int ObJsonBin::remove_v0(size_t index) ObJsonNodeType node_type = this->json_type(); ObJBVerType ver_type = this->get_vertype(); // 1. move into element index, get used bytes - uint64_t used_bytes; + uint64_t used_bytes = 0; if (OB_FAIL(this->element(index))) { LOG_WARN("failed to get element ", K(index), K(ret)); } else { diff --git a/deps/oblib/src/lib/lock/ob_bucket_lock.cpp b/deps/oblib/src/lib/lock/ob_bucket_lock.cpp index a27a77828..ab6a6ab2f 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_lock.cpp +++ b/deps/oblib/src/lib/lock/ob_bucket_lock.cpp @@ -119,7 +119,7 @@ int ObBucketLock::try_wrlock(const uint64_t bucket_idx) return ret; } -int ObBucketLock::rdlock(const uint64_t bucket_idx) +int ObBucketLock::rdlock(const uint64_t bucket_idx, const int64_t abs_timeout_us) { int ret = OB_SUCCESS; if (OB_UNLIKELY(!is_inited_)) { @@ -128,13 +128,13 @@ int ObBucketLock::rdlock(const uint64_t bucket_idx) } else if(OB_UNLIKELY(bucket_idx >= bucket_cnt_)) { ret = OB_INVALID_ARGUMENT; COMMON_LOG(WARN, "Invalid argument, ", K(bucket_idx), K_(bucket_cnt), K(ret)); - } else if (OB_FAIL(latches_[bucket_to_latch_idx(bucket_idx)].rdlock(latch_id_))) { - COMMON_LOG(WARN, "Fail to read lock latch, ", K(bucket_idx), K_(latch_id), K(ret)); + } else if (OB_FAIL(latches_[bucket_to_latch_idx(bucket_idx)].rdlock(latch_id_, abs_timeout_us))) { + COMMON_LOG(WARN, "Fail to read lock latch, ", K(bucket_idx), K_(latch_id), K(abs_timeout_us), K(ret)); } return ret; } -int ObBucketLock::wrlock(const uint64_t bucket_idx) +int ObBucketLock::wrlock(const uint64_t bucket_idx, const int64_t abs_timeout_us) { int ret = OB_SUCCESS; if (OB_UNLIKELY(!is_inited_)) { @@ -143,8 +143,8 @@ int ObBucketLock::wrlock(const uint64_t bucket_idx) } else if(OB_UNLIKELY(bucket_idx >= bucket_cnt_)) { ret = OB_INVALID_ARGUMENT; COMMON_LOG(ERROR, "Invalid argument, ", K(bucket_idx), K_(bucket_cnt), K(ret)); - } else if (OB_FAIL(latches_[bucket_to_latch_idx(bucket_idx)].wrlock(latch_id_))) { - COMMON_LOG(WARN, "Fail to write lock latch, ", K(bucket_idx), K_(latch_id), K(ret)); + } else if (OB_FAIL(latches_[bucket_to_latch_idx(bucket_idx)].wrlock(latch_id_, abs_timeout_us))) { + COMMON_LOG(WARN, "Fail to write lock latch, ", K(bucket_idx), K_(latch_id), K(abs_timeout_us), K(ret)); } return ret; } diff --git a/deps/oblib/src/lib/lock/ob_bucket_lock.h b/deps/oblib/src/lib/lock/ob_bucket_lock.h index 07ae53953..e81be24ef 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_lock.h +++ b/deps/oblib/src/lib/lock/ob_bucket_lock.h @@ -34,8 +34,8 @@ public: void destroy(); int try_rdlock(const uint64_t bucket_idx); int try_wrlock(const uint64_t bucket_idx); - int rdlock(const uint64_t bucket_idx); - int wrlock(const uint64_t bucket_idx); + int rdlock(const uint64_t bucket_idx, const int64_t abs_timeout_us = INT64_MAX); + int wrlock(const uint64_t bucket_idx, const int64_t abs_timeout_us = INT64_MAX); int unlock(const uint64_t bucket_idx); int try_wrlock_all(); int try_rdlock_all(); diff --git a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h index dae7b9a6a..e97dd8567 100644 --- a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h +++ b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h @@ -27,7 +27,6 @@ class MySQLResultWrapper { public: //see this for template virtual function - //http://cxh.me/2014/07/01/nvi-usage-of-virtual-template/ DEFINE_ALLOCATOR_WRAPPER MySQLResultWrapper() {} virtual ~MySQLResultWrapper() {} diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp index 47c96f1cb..104b490c4 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp @@ -118,7 +118,6 @@ int ObMySQLConnection::connect(const char *user, const char *pass, const char *d const static int MAX_IP_BUFFER_LEN = 32; char host[MAX_IP_BUFFER_LEN]; host[0] = '\0'; - // https://baike.baidu.com/item/mysql_real_connect/4007597 // if db is NULL, the default database is used. if (OB_ISNULL(user) || OB_ISNULL(pass) /*|| OB_ISNULL(db)*/) { ret = OB_INVALID_ARGUMENT; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp index d64cc19c5..88e37be16 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp @@ -161,9 +161,9 @@ int ObMySQLConnectionPool::set_db_param(const char *db_user, const char *db_pass } else if (OB_UNLIKELY(w_len <= 0) || OB_UNLIKELY(w_len > OB_MAX_USER_NAME_LENGTH)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("fill db user error", KCSTRING(db_user), K(ret)); - } else if (FALSE_IT(w_len = snprintf(db_pass_, OB_MAX_PASS_WORD_LENGTH, "%s", db_pass))) { + } else if (FALSE_IT(w_len = snprintf(db_pass_, OB_MAX_PASSWORD_BUF_LENGTH, "%s", db_pass))) { // impossible - } else if (OB_UNLIKELY(w_len < 0) || OB_UNLIKELY(w_len >= OB_MAX_PASS_WORD_LENGTH)) { + } else if (OB_UNLIKELY(w_len < 0) || OB_UNLIKELY(w_len >= OB_MAX_PASSWORD_BUF_LENGTH)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("fill db password error", KCSTRING(db_pass), K(ret)); } else if (FALSE_IT(w_len = snprintf(db_name_, OB_MAX_DATABASE_NAME_BUF_LENGTH, "%s", db_name))) { @@ -180,7 +180,7 @@ int ObMySQLConnectionPool::set_db_param(const ObString &db_user, const ObString { int ret = OB_SUCCESS; if (OB_UNLIKELY(db_user.length() > OB_MAX_USER_NAME_LENGTH) - || OB_UNLIKELY(db_pass.length() > OB_MAX_PASS_WORD_LENGTH) + || OB_UNLIKELY(db_pass.length() > OB_MAX_PASSWORD_LENGTH) || OB_UNLIKELY(db_name.length() > OB_MAX_DATABASE_NAME_LENGTH)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("db param buffer is not enough", K(db_user), K(db_pass), K(db_name), K(ret)); diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h index 1547b39c8..994250039 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h @@ -207,7 +207,6 @@ private: int get_server_pool_(const ObAddr &addr, ObServerConnectionPool *&pool); int purge_tenant_server_pool_map_(const ObIArray &tenant_array); protected: - static const int64_t OB_MAX_PASS_WORD_LENGTH = 64; static const int MAX_SERVER_GONE_INTERVAL = 1000 * 1000 * 1; // 1 sec bool is_updated_; @@ -221,7 +220,7 @@ protected: volatile int64_t busy_conn_count_; char db_user_[OB_MAX_USER_NAME_BUF_LENGTH]; - char db_pass_[OB_MAX_PASS_WORD_LENGTH]; + char db_pass_[OB_MAX_PASSWORD_BUF_LENGTH]; char db_name_[OB_MAX_DATABASE_NAME_BUF_LENGTH]; char init_sql_[OB_MAX_SQL_LENGTH]; ObConnPoolConfigParam config_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h index cce257a7e..133546ad5 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h @@ -108,7 +108,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(default_value); \ ret = OB_SUCCESS; \ } \ @@ -152,7 +152,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", K(column_name)); \ + SQL_LOG(TRACE, "null value, ignore", K(column_name)); \ field = static_cast(default_value); \ ret = OB_SUCCESS; \ } \ @@ -298,7 +298,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(static_cast(default_value)); \ ret = OB_SUCCESS; \ } \ @@ -361,7 +361,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(static_cast(default_value)); \ ret = OB_SUCCESS; \ } \ @@ -452,7 +452,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(static_cast(default_value)); \ ret = OB_SUCCESS; \ } \ @@ -651,7 +651,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ ret = OB_SUCCESS; \ } \ else \ @@ -719,7 +719,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ ret = OB_SUCCESS; \ } \ else \ @@ -834,7 +834,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ ret = OB_SUCCESS; \ } \ else \ @@ -1061,7 +1061,7 @@ if (OB_ERR_NULL_VALUE == ret \ || OB_SIZE_OVERFLOW == ret \ || OB_INVALID_ARGUMENT == ret) { \ - SQL_LOG(WARN, "get column failed, so set default value", K(ret), "obj", #obj); \ + SQL_LOG(TRACE, "get column failed, so set default value", K(ret), "obj", #obj); \ ret = OB_SUCCESS; \ obj = default_value; \ } else { \ @@ -1146,7 +1146,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(static_cast(default_value)); \ ret = OB_SUCCESS; \ } \ @@ -1187,7 +1187,7 @@ { \ if (skip_null_error) \ { \ - SQL_LOG(INFO, "null value, ignore", "column_name", #column_name); \ + SQL_LOG(TRACE, "null value, ignore", "column_name", #column_name); \ (obj).set_##column_name(static_cast(default_value)); \ ret = OB_SUCCESS; \ } \ @@ -1258,7 +1258,6 @@ class ObMySQLResult { public: //see this for template virtual function - //http://cxh.me/2014/07/01/nvi-usage-of-virtual-template/ DEFINE_ALLOCATOR_WRAPPER ObMySQLResult(); virtual ~ObMySQLResult(); diff --git a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp index fab297bcd..a322990a5 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp @@ -202,7 +202,6 @@ int ObServerConnectionPool::init_dblink(uint64_t dblink_id, const ObAddr &server cluster_str.length(), cluster_str.ptr()); } (void)snprintf(db_pass_, sizeof(db_pass_), "%.*s", db_pass.length(), db_pass.ptr()); - // https://baike.baidu.com/item/mysql_real_connect/4007597 // if db is NULL, the default database is used. if (!db_name.empty()) { (void)snprintf(db_name_, sizeof(db_name_), "%.*s", db_name.length(), db_name.ptr()); diff --git a/deps/oblib/src/lib/ob_define.h b/deps/oblib/src/lib/ob_define.h index 5c415d088..2cafc22bf 100644 --- a/deps/oblib/src/lib/ob_define.h +++ b/deps/oblib/src/lib/ob_define.h @@ -309,6 +309,7 @@ const int64_t OB_SERVER_TYPE_LENGTH = 64; const int64_t OB_MAX_HOSTNAME_LENGTH = 60; const int64_t OB_MAX_USERNAME_LENGTH = 32; const int64_t OB_MAX_PASSWORD_LENGTH = 128; +const int64_t OB_MAX_PASSWORD_BUF_LENGTH = OB_MAX_PASSWORD_LENGTH + 1; // After each sha1 is 41 characters, the incremental backup is up to 64 times, and the maximum password required for recovery is 64*(41+1)=2,688 const int64_t OB_MAX_PASSWORD_ARRAY_LENGTH = 4096; const int64_t OB_MAX_ERROR_MSG_LEN = 512; diff --git a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h index 174318b4a..f41de2ab2 100644 --- a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h +++ b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h @@ -407,24 +407,13 @@ public: return blk_size; } - static ObFixedClassAllocator *get(const lib::ObLabel &label = common::ObModIds::OB_CONCURRENCY_OBJ_POOL) + static ObFixedClassAllocator *get(const char* label = "ConcurObjPool") { - ObFixedClassAllocator *instance = NULL; - while (OB_UNLIKELY(once_ < 2)) { - if (ATOMIC_BCAS(&once_, 0, 1)) { - instance = new (std::nothrow) ObFixedClassAllocator(sizeof(T), - ObMemAttr(common::OB_SERVER_TENANT_ID, label), - choose_blk_size(sizeof(T)), - common::get_cpu_count()); - if (OB_LIKELY(NULL != instance)) { - instance_ = instance; - (void)ATOMIC_BCAS(&once_, 1, 2); - } else { - (void)ATOMIC_BCAS(&once_, 1, 0); - } - } - } - return (ObFixedClassAllocator *)instance_; + static ObFixedClassAllocator instance(sizeof(T), + ObMemAttr(common::OB_SERVER_TENANT_ID, label), + choose_blk_size(sizeof(T)), + common::get_cpu_count()); + return &instance; } void *alloc() @@ -441,10 +430,6 @@ public: } } -protected: - static volatile int64_t once_; - static volatile ObFixedClassAllocator *instance_; - private: ObSliceAlloc allocator_; }; @@ -735,10 +720,6 @@ template volatile int64_t ObClassAllocator::once_ = 0; template volatile ObClassAllocator *ObClassAllocator::instance_ = NULL; -template -volatile int64_t ObFixedClassAllocator::once_ = 0; -template -volatile ObFixedClassAllocator *ObFixedClassAllocator::instance_ = NULL; template struct OPNum @@ -832,7 +813,7 @@ inline void call_destructor(T *ptr) { ({ \ type *ret = NULL; \ common::ObFixedClassAllocator *instance = \ - common::ObFixedClassAllocator::get(common::OPNum::LABEL); \ + common::ObFixedClassAllocator::get(#type); \ if (OB_LIKELY(NULL != instance)) { \ void *tmp = instance->alloc(); \ if (OB_LIKELY(NULL != tmp)) { \ @@ -847,7 +828,7 @@ inline void call_destructor(T *ptr) { OLD_STATIC_ASSERT((std::is_default_constructible::value), "type is not default constructible"); \ type *ret = NULL; \ common::ObFixedClassAllocator *instance = \ - common::ObFixedClassAllocator::get(common::OPNum::LABEL); \ + common::ObFixedClassAllocator::get(#type); \ if (OB_LIKELY(NULL != instance)) { \ void *tmp = instance->alloc(); \ if (OB_LIKELY(NULL != tmp)) { \ @@ -860,7 +841,7 @@ inline void call_destructor(T *ptr) { #define op_free(ptr) \ ({ \ common::ObFixedClassAllocator<__typeof__(*ptr)> *instance = \ - common::ObFixedClassAllocator<__typeof__(*ptr)>::get(common::OPNum<__typeof__(*ptr)>::LABEL); \ + common::ObFixedClassAllocator<__typeof__(*ptr)>::get(); \ if (OB_LIKELY(NULL != instance)) { \ instance->free(ptr); \ } \ diff --git a/deps/oblib/src/lib/oblog/ob_log.cpp b/deps/oblib/src/lib/oblog/ob_log.cpp index 82dac90a3..b461c25d3 100644 --- a/deps/oblib/src/lib/oblog/ob_log.cpp +++ b/deps/oblib/src/lib/oblog/ob_log.cpp @@ -383,6 +383,7 @@ int ObLogger::set_probe(char *str) auto &probe = probes_[probe_cnt_++]; probe.action_ = action; strncpy(probe.file_, file, sizeof probe.file_); + probe.file_[sizeof probe.file_ - 1] = '\0'; probe.line_ = atoi(line); char location[256]; snprintf(location, sizeof location, "%s:%s", file, line); diff --git a/deps/oblib/src/lib/oblog/ob_log.h b/deps/oblib/src/lib/oblog/ob_log.h index f13acdb96..a9f2fe49a 100644 --- a/deps/oblib/src/lib/oblog/ob_log.h +++ b/deps/oblib/src/lib/oblog/ob_log.h @@ -1113,6 +1113,8 @@ inline void ObLogger::do_log_message(const bool is_async, Function &log_data_func) { int ret = OB_SUCCESS; + bool old_val = set_disable_logging(true); + DEFER(set_disable_logging(old_val)); bool allow = true; bool force_bt = false; diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h index a16ecd86c..3c2d8ef14 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h @@ -55,7 +55,6 @@ private: // COS domain name structure: bucket_name-appid.endpoint -// For example https://bucket-appid.cos.ap-guangzhou.myqcloud.com, // cos.ap-guangzhou.myqcloud.com is the endpoint. struct OB_PUBLIC_API ObCosAccount { diff --git a/deps/oblib/src/lib/restore/ob_object_device.cpp b/deps/oblib/src/lib/restore/ob_object_device.cpp index 7c419e58c..0abf6339e 100644 --- a/deps/oblib/src/lib/restore/ob_object_device.cpp +++ b/deps/oblib/src/lib/restore/ob_object_device.cpp @@ -234,9 +234,8 @@ int ObObjectDevice::open_for_appender(const char *pathname, ObIODOpts *opts, voi OB_LOG(WARN, "Invalid append strategy!", KCSTRING(append_strategy), K(ret)); } param.strategy_ = strategy; - + param.version_param_.version_ = append_version; if (-1 != append_version) { - param.version_param_.version_ = append_version; param.version_param_.open_object_version_ = true; if (param.version_param_.version_ <= 0) { ret = OB_INVALID_ARGUMENT; diff --git a/deps/oblib/src/lib/signal/ob_signal_handlers.cpp b/deps/oblib/src/lib/signal/ob_signal_handlers.cpp index 8defbe0a1..6f58c3228 100644 --- a/deps/oblib/src/lib/signal/ob_signal_handlers.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_handlers.cpp @@ -130,7 +130,9 @@ void close_socket_fd() } DLOG(INFO, "[CLOSEFD], close socket fd finish"); } - + if (NULL != dir) { + closedir(dir); + } } diff --git a/deps/oblib/src/lib/signal/ob_signal_worker.cpp b/deps/oblib/src/lib/signal/ob_signal_worker.cpp index bcd7d8a12..9f7fd4d63 100644 --- a/deps/oblib/src/lib/signal/ob_signal_worker.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_worker.cpp @@ -135,6 +135,9 @@ void iter_task(Func &&cb, int exclude_tid, Args && ... args) } } while (nread > 0); } + if (fd >= 0) { + ::close(fd); + } } ObSignalWorker::ObSignalWorker() diff --git a/deps/oblib/src/lib/utility/ob_edit_distance.h b/deps/oblib/src/lib/utility/ob_edit_distance.h index 985aafe37..26370febc 100644 --- a/deps/oblib/src/lib/utility/ob_edit_distance.h +++ b/deps/oblib/src/lib/utility/ob_edit_distance.h @@ -39,14 +39,15 @@ public: inline int divide() { + int ret = OB_SUCCESS; if (nullptr != str_) { const char *p = str_; int64_t word_length = 0; words_.reset(); while(0 != *p) { if (' ' == *p) { - if (0 != word_length) { - words_.push_back(ObString(word_length, p - word_length)); + if (0 != word_length && OB_FAIL(words_.push_back(ObString(word_length, p - word_length)))) { + COMMON_LOG(WARN, "failed to push back word", K(ret), K(word_length)); } word_length = 0; } else { @@ -54,12 +55,12 @@ public: } ++p; } - if (0 != word_length) { - words_.push_back(ObString(word_length, p - word_length)); + if (0 != word_length && OB_FAIL(words_.push_back(ObString(word_length, p - word_length)))) { + COMMON_LOG(WARN, "failed to push back word", K(ret), K(word_length)); } } count_ = words_.size(); - return OB_SUCCESS; + return ret; } inline ObString &operator[](const int64_t idx) {return words_[idx];} diff --git a/deps/oblib/src/lib/utility/ob_fast_convert.h b/deps/oblib/src/lib/utility/ob_fast_convert.h index 3699e34b6..75bb8db58 100644 --- a/deps/oblib/src/lib/utility/ob_fast_convert.h +++ b/deps/oblib/src/lib/utility/ob_fast_convert.h @@ -72,7 +72,6 @@ inline uint32_t ob_fast_digits10(uint64_t v) /* * The idea comes from the talk by Alexandrescu "Three Optimization Tips for C++". - * https://m.facebook.com/notes/facebook-engineering/three-optimization-tips-for-c/10151361643253920/?__tn__=H-R * faster then databuff_print for 20~4 times(digits from 1~20), 20~7 times(digits from 1~9), * * usage: diff --git a/deps/oblib/src/lib/utility/utility.cpp b/deps/oblib/src/lib/utility/utility.cpp index 2380306a7..519469e6e 100644 --- a/deps/oblib/src/lib/utility/utility.cpp +++ b/deps/oblib/src/lib/utility/utility.cpp @@ -1194,7 +1194,8 @@ static int read_pid(const char *pidfile, long &pid) pid = strtol(buf, NULL, 10); } - if (fd > 0) { + // POSIX file descriptors are non-negative integers. + if (fd >= 0) { close(fd); } diff --git a/deps/oblib/src/rpc/frame/ob_req_transport.cpp b/deps/oblib/src/rpc/frame/ob_req_transport.cpp index 190ba2d4c..6c3e13344 100644 --- a/deps/oblib/src/rpc/frame/ob_req_transport.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_transport.cpp @@ -462,8 +462,8 @@ int ObReqTransport::post_session(easy_session_t *s) const easy_addr_t ObReqTransport::to_ez_addr(const ObAddr &addr) const { easy_addr_t ez; + memset(&ez, 0, sizeof (ez)); if (addr.is_valid()) { - memset(&ez, 0, sizeof (ez)); ez.port = (htons)(static_cast(addr.get_port())); ez.cidx = 0; if (addr.using_ipv4()) { diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp index b8455d91a..e8a81ec99 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp @@ -44,7 +44,6 @@ int ObMysqlCompressProtocolProcessor::do_decode(ObSMConnection& conn, ObICSMemPo * 3B length of compressed payload * 1B compressed sequence id * 3B length of payload before compression - * http://imysql.com/mysql-internal-manual/compressed-packet-header.html */ uint32_t pktlen_before_compress = 0; ObMySQLUtil::get_uint3(start, pktlen); @@ -125,7 +124,6 @@ inline int ObMysqlCompressProtocolProcessor::decode_compressed_packet( K(pkt_body_size), K(ret)); } else { // pktlen_before_compress==0 means do not use compress - // http://imysql.com/mysql-internal-manual/uncompressed-payload.html if (0 == pktlen_before_compress) { pkt_body = const_cast(comp_buf); } else { diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h index 8fe6b8678..986ef8fd1 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h @@ -372,7 +372,6 @@ public: * 3B length of compressed payload * 1B compressed sequence id * 3B length of payload before compression - * http://imysql.com/mysql-internal-manual/compressed-packet-header.html */ class ObMySQLCompressedPacketHeader { diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp index 955bcffe1..9784c1b81 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp @@ -58,8 +58,6 @@ static int64_t get_max_comp_pkt_size(const int64_t uncomp_pkt_size) * * the body is compressed packet(orig header + orig body) * - * http://imysql.com/mysql-internal-manual/compressed-packet-header.html - * * NOTE: In standard mysql compress protocol, if src_pktlen < 50B, or compr_pktlen >= src_pktlen * mysql will do not compress it and set pktlen_before_compression = 0, * it can not ensure checksum. diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp index 507bef59d..268e3d75d 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp @@ -33,7 +33,6 @@ OMPKChangeUser::OMPKChangeUser() : cmd_(COM_CHANGE_USER), } // see com_change_user packet -// http://imysql.com/mysql-internal-manual/com-change-user.html // for proxy, add session vars as connect attrs int64_t OMPKChangeUser::get_serialize_size() const { diff --git a/script/dooba/README.md b/script/dooba/README.md index 489a40832..659946928 100755 --- a/script/dooba/README.md +++ b/script/dooba/README.md @@ -1,6 +1,6 @@ # Description -The latest dooba stable version is 1.0, download address: http://gitlab.alibaba-inc.com/fufeng.syd/dooba/repository/archive?ref=v1.0 +The latest dooba stable version is 1.0 `dooba' is a easy tools monitoring oceanbase cluster for oceanbase admins. It's based on python curses library, and is a powerful tool for watching oceanbase cluster status with straightfoward vision. @@ -52,26 +52,33 @@ Please look into dooba script file header. ## version 1.0 ### dooba offline index + ![screenshot v1.0](/fufeng.syd/dooba/raw/master/screenshot/v1_0-offline.png "screenshot for dooba v1_0 offline index") ### dooba machine + ![screenshot v1.0](/fufeng.syd/dooba/raw/master/screenshot/v1_0-machine.png "screenshot for dooba v1_0 machine") ### dooba help + ![screenshot v1.0](/fufeng.syd/dooba/raw/master/screenshot/v1_0-help.png "screenshot for dooba v1_0 help") ## version 0.4 ### dooba shell + ![screenshot v0.4](/fufeng.syd/dooba/raw/master/screenshot/v0_4-shell.png "screenshot for dooba v0.2 gallery") ### dooba sql + ![screenshot v0.4](/fufeng.syd/dooba/raw/master/screenshot/v0_4-sql.png "screenshot for dooba v0.2 gallery") ### dooba UpdateServer + ![screenshot v0.4](/fufeng.syd/dooba/raw/master/screenshot/v0_4-ups.png "screenshot for dooba v0.2 gallery") ### dooba ChunkServer + ![screenshot v0.4](/fufeng.syd/dooba/raw/master/screenshot/v0_4-cs.png "screenshot for dooba v0.2 gallery") ## version 0.2, 0.3 diff --git a/src/logservice/archiveservice/ob_archive_service.cpp b/src/logservice/archiveservice/ob_archive_service.cpp index 0a8e39c82..a238d2cd1 100644 --- a/src/logservice/archiveservice/ob_archive_service.cpp +++ b/src/logservice/archiveservice/ob_archive_service.cpp @@ -21,6 +21,7 @@ #include "logservice/palf/lsn.h" // LSN #include "logservice/palf/scn.h" // LSN #include "share/backup/ob_backup_connectivity.h" +#include "share/ob_debug_sync.h" namespace oceanbase { @@ -265,6 +266,7 @@ void ObArchiveService::do_check_switch_archive_() int ObArchiveService::load_archive_round_attr_(ObTenantArchiveRoundAttr &attr) { + DEBUG_SYNC(BEFORE_LOAD_ARCHIVE_ROUND); return persist_mgr_.load_archive_round_attr(attr); } diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp index e04792420..6f3df0991 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp @@ -91,10 +91,9 @@ int PriorityV1::get_scn_(const share::ObLSID &ls_id, palf::SCN &scn) COORDINATOR_LOG_(WARN, "open_palf failed"); } else if (OB_FAIL(palf_handle_guard.get_palf_handle()->get_access_mode(access_mode))) { COORDINATOR_LOG_(WARN, "get_access_mode failed"); - } else if (palf::AccessMode::APPEND != access_mode) { - // Set scn to 0 when current access mode is not APPEND. - scn.set_min(); - } else { +// } else if (palf::AccessMode::APPEND != access_mode) { +// // Set log_ts to 0 when current access mode is not APPEND. +// log_ts = 0; common::ObRole role; int64_t unused_pid = -1; palf::SCN min_unreplay_scn; diff --git a/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.cpp b/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.cpp index 0f849ef22..ad26a5bc2 100644 --- a/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.cpp +++ b/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.cpp @@ -713,7 +713,6 @@ int ObCDCPartTransResolver::handle_commit_( transaction::ObTxCommitLogTempRef tmp_ref; transaction::ObTxCommitLog commit_log(tmp_ref); PartTransTask *part_trans_task = NULL; - PartTransTask::CDCTransType trans_type = PartTransTask::CDCTransType::UNKNOWN; int64_t trans_commit_version = OB_INVALID_VERSION; bool is_redo_complete = false; is_served = false; @@ -725,7 +724,7 @@ int ObCDCPartTransResolver::handle_commit_( KR(ret), K_(tls_id), K(tx_id), K(lsn), K(missing_info)); } else if (OB_FAIL(tx_log_block.deserialize_log_body(commit_log))) { LOG_ERROR("deserialize_log_body failed", KR(ret), K_(tls_id), K(tx_id), K(lsn), K(commit_log)); - } else if (OB_UNLIKELY(!is_valid_trans_type_(commit_log.get_trans_type(), trans_type))) { + } else if (OB_UNLIKELY(!is_valid_trans_type_(commit_log.get_trans_type()))) { ret = OB_ERR_UNEXPECTED; LOG_ERROR("invalid trans_type", KR(ret), K_(tls_id), K(tx_id), K(commit_log), K(lsn)); } else if (OB_UNLIKELY(OB_INVALID_VERSION == @@ -734,7 +733,7 @@ int ObCDCPartTransResolver::handle_commit_( LOG_ERROR("invalid trans_commit_version", KR(ret), K_(tls_id), K(tx_id), K(lsn), K(submit_ts), K(commit_log)); } else if (!serve_info.is_served(trans_commit_version)) { LOG_WARN("found trans not served", K_(tls_id), K(tx_id), K(lsn), - K(commit_log), K(trans_type), K(serve_info)); + K(commit_log), K(serve_info)); if (OB_FAIL(part_trans_dispatcher_.remove_task(tls_id_.is_sys_log_stream(), tx_id))) { LOG_ERROR("handle unserverd PartTransTask failed", KR(ret), K_(tls_id), K(tx_id)); } @@ -783,7 +782,7 @@ int ObCDCPartTransResolver::handle_commit_( LOG_ERROR("unexpected found redo log entry not complete if have read commit_info log", KR(ret), K_(tls_id), K(tx_id), K(commit_log), K(lsn), KPC(part_trans_task)); } else if (OB_UNLIKELY(part_trans_task->is_sys_ls_not_serve_trans()) - && PartTransTask::CDCTransType::SINGLE_LS_TRANS == trans_type) { + && transaction::TransType::SP_TRANS == commit_log.get_trans_type()) { // remove part_trans_task if is single_sys_logstream trans but not has valid MultiDataSourceInfo(means not DDL/LS_TABLE_CHANGE/TABLET_CHANGE) LOG_DEBUG("[FILTER_PART_TRANS] sys_ls_trans without valid multi_data_source_info(not ddl/ls_table or tablet_change)", K_(tls_id), K(tx_id), K(commit_log), KPC(part_trans_task)); @@ -791,16 +790,16 @@ int ObCDCPartTransResolver::handle_commit_( LOG_ERROR("handle unserverd single CommitLog(commit_log with invalid prev_log_lsn in dist_trans) failed", KR(ret), K_(tls_id), K(tx_id), K(commit_log), K(lsn)); } - } else if (PartTransTask::CDCTransType::SINGLE_LS_TRANS == trans_type + } else if (transaction::TransType::SP_TRANS == commit_log.get_trans_type() && OB_FAIL(part_trans_task->prepare(lsn, submit_ts, part_trans_dispatcher_))) { // prepare single_ls_trans while resolving its commit_log. - LOG_ERROR("prepare part_trans_task for single_ls_trans failed", KR(ret), K_(tls_id), K(tx_id), K(trans_type), + LOG_ERROR("prepare part_trans_task for single_ls_trans failed", KR(ret), K_(tls_id), K(tx_id), K(lsn), K(submit_ts), K(commit_log), KPC(part_trans_task)); } else if (OB_FAIL(part_trans_task->commit( cluster_id, tx_id, trans_commit_version, - trans_type, + (transaction::TransType)commit_log.get_trans_type(), commit_log.get_ls_log_info_arr(), lsn, submit_ts))) { @@ -947,22 +946,5 @@ int ObCDCPartTransResolver::check_redo_log_list_( return ret; } -bool ObCDCPartTransResolver::is_valid_trans_type_( - const int32_t trans_type_int, - PartTransTask::CDCTransType &trans_type) const -{ - bool b_ret = false; - - if (transaction::TransType::SP_TRANS == trans_type_int) { - b_ret = true; - trans_type = PartTransTask::CDCTransType::SINGLE_LS_TRANS; - } else if (transaction::TransType::DIST_TRANS == trans_type_int) { - b_ret = true; - trans_type = PartTransTask::CDCTransType::DIST_TRANS; - } - - return b_ret; -} - } // end namespace cdc } // end namespace oceanbase diff --git a/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.h b/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.h index 4840f3d5d..a198f677c 100644 --- a/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.h +++ b/src/logservice/libobcdc/src/ob_cdc_part_trans_resolver.h @@ -378,9 +378,10 @@ private: PartTransTask &part_trans_task, MissingLogInfo &missing_info); - bool is_valid_trans_type_( - const int32_t trans_type_int, - PartTransTask::CDCTransType &trans_type) const; + inline bool is_valid_trans_type_(const int32_t trans_type) const + { + return transaction::TransType::SP_TRANS == trans_type || transaction::TransType::DIST_TRANS == trans_type; + } // trans_commit_version of single LS trans is log submit_ts, otherwise is trans_commit_version recorded in trans_log. inline int64_t get_trans_commit_version_(const int64_t commit_log_submit_ts, const int64_t commit_version_in_tx_log) const @@ -389,10 +390,6 @@ private: commit_log_submit_ts : commit_version_in_tx_log; } - int check_and_handle_not_served_sys_ls_trans_( - PartTransTask &part_trans_task, - const PartTransTask::CDCTransType &trans_type); - private: bool offlined_ CACHE_ALIGNED; // Is the partition deleted TenantLSID tls_id_; diff --git a/src/logservice/libobcdc/src/ob_log_part_trans_task.cpp b/src/logservice/libobcdc/src/ob_log_part_trans_task.cpp index 5c47f7d37..46ac0be05 100644 --- a/src/logservice/libobcdc/src/ob_log_part_trans_task.cpp +++ b/src/logservice/libobcdc/src/ob_log_part_trans_task.cpp @@ -2028,7 +2028,7 @@ PartTransTask::PartTransTask() : prepare_log_lsn_(), commit_ts_(OB_INVALID_TIMESTAMP), commit_log_lsn_(), - trans_type_(CDCTransType::UNKNOWN), + trans_type_(transaction::TransType::UNKNOWN_TRANS), is_xa_or_dup_(false), participant_count_(0), participants_(NULL), @@ -2162,7 +2162,7 @@ void PartTransTask::reset() prepare_log_lsn_.reset(); commit_ts_ = OB_INVALID_TIMESTAMP; commit_log_lsn_.reset(); - trans_type_ = CDCTransType::UNKNOWN; + trans_type_ = transaction::TransType::UNKNOWN_TRANS; is_xa_or_dup_ = false; participant_count_ = 0; participants_ = NULL; @@ -2723,7 +2723,7 @@ int PartTransTask::commit( const uint64_t cluster_id, const transaction::ObTransID &tx_id, const int64_t trans_commit_version, - const CDCTransType &trans_type, + const transaction::TransType &trans_type, const transaction::ObLSLogInfoArray &ls_info_array, const palf::LSN &commit_log_lsn, const int64_t commit_log_submit_ts) diff --git a/src/logservice/libobcdc/src/ob_log_part_trans_task.h b/src/logservice/libobcdc/src/ob_log_part_trans_task.h index d3be9f69d..6a1ab3342 100644 --- a/src/logservice/libobcdc/src/ob_log_part_trans_task.h +++ b/src/logservice/libobcdc/src/ob_log_part_trans_task.h @@ -716,13 +716,6 @@ struct TransCommitInfo; class PartTransTask : public TransTaskBase, public ObLogResourceRecycleTask, public ObILogCallback { public: - // TODO, 需要替换为事务层统一定义的结构 - enum CDCTransType - { - UNKNOWN = -1, - SINGLE_LS_TRANS = 0, - DIST_TRANS = 1 - }; enum TaskType { TASK_TYPE_UNKNOWN = 0, @@ -817,7 +810,7 @@ public: const uint64_t cluster_id, const transaction::ObTransID &tx_id, const int64_t trans_commit_version, - const CDCTransType &trans_type, + const transaction::TransType &trans_type, const transaction::ObLSLogInfoArray &ls_info_array, const palf::LSN &commit_log_lsn, const int64_t commit_log_submit_ts); @@ -1017,8 +1010,8 @@ public: const ObString &get_part_trans_info() const { return part_trans_info_str_; } bool is_served() const { return SERVED == serve_state_; } - bool is_single_ls_trans() const { return CDCTransType::SINGLE_LS_TRANS == trans_type_; } - bool is_dist_trans() const { return CDCTransType::DIST_TRANS == trans_type_; } + bool is_single_ls_trans() const { return transaction::TransType::SP_TRANS == trans_type_; } + bool is_dist_trans() const { return transaction::TransType::DIST_TRANS == trans_type_; } void is_part_trans_sort_finish() const { sorted_redo_list_.is_dml_stmt_iter_end(); } bool is_part_dispatch_finish() const { return sorted_redo_list_.is_dispatch_finish(); } void inc_sorted_br() { ATOMIC_INC(&output_br_count_by_turn_); } @@ -1089,7 +1082,7 @@ public: K_(exec_tenant_id), K_(tls_id), K_(trans_id), - K_(trans_type), + "trans_type", transaction::trans_type_to_cstr(trans_type_), K_(is_xa_or_dup), K_(is_trans_committed), K_(trans_commit_version), @@ -1188,7 +1181,7 @@ private: palf::LSN prepare_log_lsn_; // PrepareLog LSN(same with commit_log_lsn_ if SINGLE_LS_TRANS) int64_t commit_ts_; // Transaction timestamp, usually set to the Commit log timestamp palf::LSN commit_log_lsn_; // CommitLog LSN - CDCTransType trans_type_; + transaction::TransType trans_type_; bool is_xa_or_dup_; // true if xa dist trans or duplicate table trans. int64_t participant_count_; diff --git a/src/logservice/libobcdc/tests/wallet/ca.pem b/src/logservice/libobcdc/tests/wallet/ca.pem deleted file mode 100644 index e7fe9cf6d..000000000 --- a/src/logservice/libobcdc/tests/wallet/ca.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDAzCCAeugAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR -TF9TZXJ2ZXJfNS43LjI0X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X -DTE5MDQyOTA5MDc1NVoXDTI5MDQyNjA5MDc1NVowPDE6MDgGA1UEAwwxTXlTUUxf -U2VydmVyXzUuNy4yNF9BdXRvX0dlbmVyYXRlZF9DQV9DZXJ0aWZpY2F0ZTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALjwNXZC8Tr9kndc6WheAsynLxs2 -wqRhpIqASTH25xVS50F151VM8QeoTpPLYSNx7Iy+grQ6R8b0aSpF8lqav3Op/VVz -zAePtcNthoDBcqDoI0pgS/mbYYagjCnDeWFA37Gm3iPf417aWa8ngC2JLHcArjx8 -9m1EPp917/owdIo/xLUYkTsyZkKc5IWBx8368/UaILEwdK7yBVHcc4zpKSeRTAIh -q8oUMT4MJ6E5WSbFyLI3ooc3WuXPpkDkC3+pcPszs2lgyWZSnpmFMo/STnK/WERA -YXOZur76Sd21YhuO0tYaVa1RcMFUbru08ECGz2dnMYgn4WsjyqwaZDmLXwUCAwEA -AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABGpcpi40J4n1 -Swa3+VYgdlmXExM2boJjR+Yl9v367aT6FM0cxnPrnHZiWaAOnuTMkuimsPpRxzb4 -yj9aix/fTMBhxu5KJ/EIovT3tBWvWbFjdTqRe9NCZ8ALyweWzfixu9A4cFbs6HfK -aBjZtnIl4rPGXhryjSdBWIVBRnIaIuVzAmFHu/To0Ws6UPelhCcLdI7LtwpyX1wd -lcob5pEfy2vsoS5F/bMCIXXvXTkFWPvQAOGkndSV3IxPY0Vxc1JUxB74WTPIO2+q -hREu1LTlmuISUKhWtAQjhsXUyufPUKPGZW/VhpsQecrSjv5HN3B2DW56en9ZejbK -vde8+i/gFg== ------END CERTIFICATE----- diff --git a/src/logservice/libobcdc/tests/wallet/client-cert.pem b/src/logservice/libobcdc/tests/wallet/client-cert.pem deleted file mode 100644 index a0b2bd9ae..000000000 --- a/src/logservice/libobcdc/tests/wallet/client-cert.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDBDCCAeygAwIBAgIBAzANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR -TF9TZXJ2ZXJfNS43LjI0X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X -DTE5MDQyOTA5MDc1NVoXDTI5MDQyNjA5MDc1NVowQDE+MDwGA1UEAww1TXlTUUxf -U2VydmVyXzUuNy4yNF9BdXRvX0dlbmVyYXRlZF9DbGllbnRfQ2VydGlmaWNhdGUw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBe+87EmlgsUJscpOW4fm9 -pW/ZFDRUcPQxBdKZMFVy2p8uW7sXEQ+wHZhRgemnBdT4kYmGSfMLJAlrzYe6HjKJ -8t/3RH90f0qjmdlM4f5jRoU74fPG2rpG+UxklR26DAsbPCd/wnQtDUzG6zO1yj53 -6xa7veRNXMBg/N9wUSw1oGab2H9/6EkfC4JmXNVcSZ75Nxtg08g2OGYwH+rsV5NZ -yydxoYkizbM8aIR27F96QaeAlZf/oZ5mjcAeIgdzhQMJi9njU71YLvktnhDpQGwo -utALQYWcUyJfH8or23u+A+WjHRd9wnsvl3Ea+lqg2fmBzwTxmkXOE42QnKc6OshJ -AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBACbNmYOhrLbD -elG0GOHzwVjPmOZewHfVs4l9TEpEliZedRWuIOWq0wPqf5NrimAhYjUBfMmns1/Y -xbl4XO/s7ma/qXmKvXF2aHMK1YU5zvsJUc8vm62x8GmMDuaqnsltGiS4jorOZ5wh -Fgd4GenkASy7XE/MLEuZwpKGfZQ4rm7KKh1XRVfCfz7PlZuCKKEwT2dOwjKe7S+y -5NeWeiDUa2mfkWdrNocExa2USHlgvxplSsFxjJlbP3Fl2EvS15Ke1vLALcPHR8ZV -UYGO0yuNZY6aT9vODB7eEDSAa76X8h6cKmNB2edKALfQDZuGkDWObhtc/hmuCNsK -QbZq3sMaA9Q= ------END CERTIFICATE----- diff --git a/src/logservice/libobcdc/tests/wallet/client-cert_error.pem b/src/logservice/libobcdc/tests/wallet/client-cert_error.pem deleted file mode 100755 index 787f017afc7c7e53333365cb20672cb7143f4a05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1079 zcmdM|0Vh{?Pd^1`*PswjH&18B5Lb|(E|;&Tr?Z8Nv$JDLy0c@TZ@Eigq?dPolxId+ zvY%t1tB+HlV|jp!tC_D$y1S!csHR1twgf7oa<%~6&{opXjD-U6>e$}VF1z)R1lS$ zlLc~_ucxPzXO^QMms5InVMcbQyJfk7lVhN(o1>$@vtyuzBS?XBy0^1qpsS;yk(p6y zpn-3hb6Hx6b3|rEiK|gnVv1>6Qg|?zafWYxg{4cHeqMy5pGRV{i;;y_k+WsCYmS?- zi*tZUl$n=BP^G@NUz%f8giBPYX^MH7x4CCza=J&RWnQEYmsv<40v5UD|s&;sAdRCBAmYIoPl}DvhV6lF9cD_$!N|Je)X|QQdsAFZ8my4Tg5|>4i znQ@v+rEy|Wx_^XWL1AHJMn-65dT2mMfKOgoU}kBkSF&q_kz1grk#@e9Q>edhNI-;H zVUTB(V|lunZz-2+x{0=Xsj*9PMUk;(WKglbnOlCYVL_E&mUmdOi?&g&MVWzTsgs#c zl4C`9fLDe`Xh3nOx3Otjl3SHaRfRKGzJ7{Hp0|^yhfkn^yQ_P#uc4=pYkGlcPEfYL zbE>DOvu}P-hL>l4cD7-Tqr0(y zuTyZEcWJ(#S!$41iHVDQSZYy_Yg9&dXpnEZOJ<^PUS_tBMNW`@en?JKYQAGpwpma` zV3mP$kx!&^U?7)MMRsmVWr@3Axx0Q~l1Ex*L{(T$mZN@Ra9(X{B?ObFhA1R90b-MPXrz zdrrA)s%d&zK&nrLnXzF;goRgjXrg66XjWd9vuAL6zHw?ImwAq5cuIIqu%~{aZ=PR) zSwK#ZK|o%li>GI9kzq)osZ)7Twzp+zkwsFmle=e5uv@xMvA0u3m6>C{M}C2)KbN_G zM1fg_Z&9dmWocMSVV1jFS*5d6xR<$Sg}YgyWqFlXRk(gxfrocWZla4xU=$a)6ma!( I!7LdV0QSRLcmMzZ diff --git a/src/logservice/libobcdc/tests/wallet/client-key.pem b/src/logservice/libobcdc/tests/wallet/client-key.pem deleted file mode 100644 index 3909b1de4..000000000 --- a/src/logservice/libobcdc/tests/wallet/client-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAwXvvOxJpYLFCbHKTluH5vaVv2RQ0VHD0MQXSmTBVctqfLlu7 -FxEPsB2YUYHppwXU+JGJhknzCyQJa82Huh4yifLf90R/dH9Ko5nZTOH+Y0aFO+Hz -xtq6RvlMZJUdugwLGzwnf8J0LQ1Mxusztco+d+sWu73kTVzAYPzfcFEsNaBmm9h/ -f+hJHwuCZlzVXEme+TcbYNPINjhmMB/q7FeTWcsncaGJIs2zPGiEduxfekGngJWX -/6GeZo3AHiIHc4UDCYvZ41O9WC75LZ4Q6UBsKLrQC0GFnFMiXx/KK9t7vgPlox0X -fcJ7L5dxGvpaoNn5gc8E8ZpFzhONkJynOjrISQIDAQABAoIBADwkHNl8wJqYnq/8 -8VleBnXnfZu5RwbUUWMHj02kk3ru77nGM6JY4Ep6+ISlYA5VprxY6KmARPa6jd8f -dMfqaQUuJGXEueVpR7cQtFXMjXkoS3OwqUivZmV3SkKdgy74XV9q1FBHDjuOvcW7 -CEjCg6ZcwaU7wkI1yWqcT4um/5nvJbwGb/LCcgsl82iI83MyZ6Ese1sDVVZ53aza -XLEsO8MmdGCHFQsRhx+EVnrZQZprMEvKQJTbtJHLt8LrLk4K6jzwlJqyyD/+byeX -uMw/TdI8xWFiTzn4fZgPQSJvQ6gMoZ1zl0bf9540wI1j4EhfS72PHqMo8afzvFB+ -SEDt7zECgYEA9tfgM/tNk2ZB3QhhKLdksilAZ5bb9MLDvfwIoiMhklPM9E2sJj/4 -6Y3fgASE8RcfCK2kXV0jwFRPPfPt3iXejMKdHDOMHnKXTfi7V/afZJRN5O/879Kc -WNfLsn52trJJ8cvWQAEX8aVOhdxfhjDHrAb+APnYNCQJ5olzOy9Kym0CgYEAyKlW -qPm1znib0fLFP1XjWANfl2gdGE6us5rs4HYoSCJ0SL4/vMM0q7WN5+rvs2id9JSn -aBAImbnrpeJvXHKeh16vr6IjzKfa9mtG00nRGNo6ILo69rmx3dE2CunMMauF9Hfd -yTe71e6dO7IqG+cMJ/G9GDJs8Xgaw+Qn0RC0C80CgYBnQgDY3dwit9j/dFzoYmcu -HBGEA9h5N+wYElEuOhH2GzYWUFOeII6obJ+89qcCD1D9GV4zbB3je6E2Yk7z6dWB -/nsoa+vGZNskU9NSxakBswQuq7GcRPcANy1PupVAca57BnDWj16LyEHjvz76bHdq -X/ZrRBiMHzNBC+h3Lp5TtQKBgBbR0y4iP7+8TZQhtLbQMKuIrq1MRMrH3+xC+R9J -sKkLagf/wsXXuTyxx/KQ8DOJ+TSgVy1pbWD2GMtjpeBwlIC2juo9WS7kA+20I3jR -0zqtTqD8LMp0MbsVGL1C+1rGs9QqcYl5kh3xJeZtC4bizqoYPrXqviLz0q9mWfTX -nnIdAoGBAJZq5xvDiCmO1rrg9s6cwGRU/3Hoe/GR1iJWBbpPzP9/ACTXoWP7/QHU -WL3OcvgKJlwC9c0yP79fCt0pHK8DSbeoABwgFC/YFwGxoHm2t+Bb6tSdDnHizRUr -oalDqfereEjKxfg7TkwRzQ4dgHUag4+pcGggDjGdH1tNdWQQLO+N ------END RSA PRIVATE KEY----- diff --git a/src/logservice/libobcdc/tests/wallet/client-key_error.pem b/src/logservice/libobcdc/tests/wallet/client-key_error.pem deleted file mode 100755 index 2b4491d8d5aac714b77d554fc498b383cfe9cc99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1680 zcmdM|0Vh{?Pd|mAU`K_3AkQ$z5LX3n*GQ0rE|;&Tr)z zfp3{}Sz3v6L}o>at5H>AifLL>c(8GXZ+?ZPOPYROgrlEFVzP^og%?+mvt_nxj+?QI zbAU;dnU_USrM|acnqyUjOH`<7ig}s0xo2c@x<{sEUZjs%NM(q#S(%TITVS}CXKF-p zPEawIi@95>c6e}lR*+McnTcPON2OC>v3_`VzE5OIl6jbEuxU=HV`Y|?i<@hbMUt6u znoFf|Vo|z(gkeEpVPr-IS7>E=Xh2ASPhMGIW@)HbvTKBqTcD?rcD|QWsK0MWK!jOg zkY|)*dAgZzscX84wtK0uOL9e#v1MdXvA&sGK3A?`L6u*YcUZBDwo$G{nSp1ilbKJF zV?}s?SB6JuKyj$Iv1wY8Ta`;yg>$}sibgTCa7a>Epr?ytpreyxzNeF8pmRl8prcEmL6Swf zpGgK+RZx0jo@;n{Wl?TXx`|78xisWl37$hN_weRWs!R}S5Z`osj*2~M2>||TA+K5aadtyrgm;R-t!rUXgEFkWYlaiHC7;Mxu6vvuRFgfVpw0xpQD?hF@@S zg^9VJg^OQlL`h(vr>~n6mvN+thnY!uN@7)F zU}<);TV9!|Ushsbg=2Drk)f}ndy2oaslHRLKbKLlOORJ;MR-MqI2BzNO z`e~v0jzK0>-Ui9#zFhvM;ZBJr+Mb3kCKkpfm3fiL1*N_L73F1K*_kD2$pN00MH$&4 zW?>fQ6`n;#iD||bsfC$IPTHBKg(gKA7M@)C{#8kNVI`5Kg^nJPMV@JSNkw52`%WP9XS>K7V?X>+;j z8wLe=g@u<|lotl%7MJJxmN`3_MP;UExVof7Wh8~^8x%$*Ia~Ppn1>{Vm-%%WR!S2c?DJmSmYRG1-cfvdgmKD`xR>ExCG|r6mfZ2 z8V3bNSU9IgI#v{AW+pr8R|UG~dle=Z`Z`Bsg=)K(78+If`#YJN`T6^Kn&f9yg_h@< zh5LDxlqDNw7lv`A7a0VZW#pAc28NYorWPb8nxzLvn3ouqCVQIrxR)A+BR>2dDbwRYiDkr51-JSL$avrU$q=hnu)XRC!stgqM2O0!na)GNAS3ei*)eQpxm60BZ diff --git a/src/logservice/palf/log_iterator_impl.h b/src/logservice/palf/log_iterator_impl.h index 714d92c8a..05ee41704 100644 --- a/src/logservice/palf/log_iterator_impl.h +++ b/src/logservice/palf/log_iterator_impl.h @@ -177,7 +177,7 @@ int LogIteratorImpl::init(IteratorStorage *log_storage) log_storage_ = log_storage; curr_entry_size_ = 0; is_inited_ = true; - PALF_LOG(INFO, "LogIteratorImpl init success", K(ret), KPC(this)); + PALF_LOG(TRACE, "LogIteratorImpl init success", K(ret), KPC(this)); } return ret; } diff --git a/src/logservice/palf/palf_env_impl.cpp b/src/logservice/palf/palf_env_impl.cpp index f7f871774..fe1ff70c6 100644 --- a/src/logservice/palf/palf_env_impl.cpp +++ b/src/logservice/palf/palf_env_impl.cpp @@ -718,14 +718,9 @@ int PalfEnvImpl::try_recycle_blocks() } } - // step3. notify each palf instance stop writing when reach limit usage threshold. + // step3. reset diskspace_enough_. if (diskspace_enough_ != curr_diskspace_enough) { - if (OB_FAIL(notify_diskspace_enough_(curr_diskspace_enough))) { - PALF_LOG(WARN, "notify_diskspace_enough_ failed", K(ret), KPC(this), - K(usable_disk_limit_size_to_stop_writing), K(total_used_size_byte)); - } else { - diskspace_enough_ = curr_diskspace_enough; - } + ATOMIC_STORE(&diskspace_enough_, curr_diskspace_enough); } if ((true == need_recycle && false == has_recycled && false == is_shrinking) || false == diskspace_enough_) { PALF_LOG(ERROR, "clog disk space is almost full", @@ -747,26 +742,7 @@ int PalfEnvImpl::try_recycle_blocks() bool PalfEnvImpl::check_disk_space_enough() { - int ret = OB_SUCCESS; - bool bool_ret = true; - int64_t total_used_disk_space = 0; - int64_t total_size_byte = 0; - if (OB_FAIL(get_disk_usage(total_used_disk_space, total_size_byte))) { - PALF_LOG(WARN, "get_disk_usage failed", K(ret), KPC(this)); - } else { - PalfDiskOptions disk_opts_for_stopping_writing; - PalfDiskOptions disk_opts_for_recycling_blocks; - PalfDiskOptionsWrapper::Status status = PalfDiskOptionsWrapper::Status::INVALID_STATUS; - disk_options_wrapper_.get_disk_opts(disk_opts_for_stopping_writing, - disk_opts_for_recycling_blocks, - status); - const int64_t usable_limit_disk_size = - total_size_byte * disk_opts_for_stopping_writing.log_disk_utilization_limit_threshold_ / 100LL; - if (usable_limit_disk_size < total_used_disk_space) { - bool_ret = false; - } - } - return bool_ret; + return true == ATOMIC_LOAD(&diskspace_enough_); } // TODO by yunlong @@ -803,25 +779,6 @@ bool PalfEnvImpl::GetTotalUsedDiskSpace::operator() (const LSKey &ls_key, PalfHa return bool_ret; } -PalfEnvImpl::NotifyDiskEnough::NotifyDiskEnough(const bool diskspace_enough) - : diskspace_enough_(diskspace_enough), - ret_code_(OB_SUCCESS) {} - -PalfEnvImpl::NotifyDiskEnough::~NotifyDiskEnough() {} - -bool PalfEnvImpl::NotifyDiskEnough::operator()(const LSKey &palf_id, PalfHandleImpl *palf_handle_impl) -{ - bool bool_ret = true; - if (NULL == palf_handle_impl) { - ret_code_ = OB_ERR_UNEXPECTED; - bool_ret = false; - } else { - (void) palf_handle_impl->set_diskspace_enough(diskspace_enough_); - PALF_LOG(WARN, "NotifyDiskEnough execute", K(palf_id), K(palf_handle_impl)); - } - return bool_ret; -} - int PalfEnvImpl::get_disk_usage(int64_t &used_size_byte, int64_t &total_usable_size_byte) { int ret = OB_SUCCESS; @@ -1051,18 +1008,6 @@ int PalfEnvImpl::recycle_blocks_(bool &has_recycled, int64_t &oldest_palf_id, SC return ret; } -int PalfEnvImpl::notify_diskspace_enough_(const bool diskspace_enough) -{ - int ret = OB_SUCCESS; - NotifyDiskEnough functor(diskspace_enough); - if (OB_FAIL(palf_handle_impl_map_.for_each(functor))) { - PALF_LOG(WARN, "palf_handle_impl_map_ for_each failed", K(ret), K(functor)); - } else { - PALF_LOG(INFO, "notify_diskspace_enough_ success", K(ret), K(diskspace_enough), KPC(this)); - } - return ret; -} - int PalfEnvImpl::wait_until_reference_count_to_zero_(const int64_t palf_id) { int ret = OB_SUCCESS; diff --git a/src/logservice/palf/palf_env_impl.h b/src/logservice/palf/palf_env_impl.h index 198c45d33..47f01e146 100644 --- a/src/logservice/palf/palf_env_impl.h +++ b/src/logservice/palf/palf_env_impl.h @@ -271,15 +271,6 @@ private: int64_t palf_id_; int ret_code_; }; - struct NotifyDiskEnough - { - NotifyDiskEnough(const bool diskspace_enough); - ~NotifyDiskEnough(); - bool operator()(const LSKey &palf_id, PalfHandleImpl *palf_handle_impl); - TO_STRING_KV(K_(diskspace_enough), K_(ret_code)); - bool diskspace_enough_; - int ret_code_; - }; private: int scan_all_palf_handle_impl_director_(); @@ -293,7 +284,6 @@ private: int64_t &palf_id, int64_t &maximum_used_size); int recycle_blocks_(bool &has_recycled, int64_t &oldest_palf_id, SCN &oldest_scn); - int notify_diskspace_enough_(const bool diskspace_enough); int wait_until_reference_count_to_zero_(const int64_t palf_id); // check the diskspace whether is enough to hold a new palf instance. bool check_can_create_palf_handle_impl_() const; diff --git a/src/logservice/palf/palf_handle_impl.cpp b/src/logservice/palf/palf_handle_impl.cpp index f7c9339e2..680feb236 100644 --- a/src/logservice/palf/palf_handle_impl.cpp +++ b/src/logservice/palf/palf_handle_impl.cpp @@ -61,7 +61,6 @@ PalfHandleImpl::PalfHandleImpl() last_record_append_lsn_(PALF_INITIAL_LSN_VAL), has_set_deleted_(false), palf_env_impl_(NULL), - diskspace_enough_(true), append_cost_stat_("[PALF STAT WRITE LOG]", 2 * 1000 * 1000), flush_cb_cost_stat_("[PALF STAT FLUSH CB]", 2 * 1000 * 1000), replica_meta_lock_(), @@ -195,7 +194,6 @@ void PalfHandleImpl::destroy() if (IS_INIT) { PALF_EVENT("PalfHandleImpl destroy", palf_id_, KPC(this)); is_inited_ = false; - diskspace_enough_ = true; lc_cb_ = NULL; self_.reset(); palf_id_ = INVALID_PALF_ID; @@ -370,7 +368,7 @@ int PalfHandleImpl::submit_log( PALF_LOG(WARN, "invalid argument", K(ret), K_(palf_id), KP(buf), K(buf_len), K(ref_scn)); } else { RLockGuard guard(lock_); - if (false == diskspace_enough_) { + if (false == palf_env_impl_->check_disk_space_enough()) { ret = OB_LOG_OUTOF_DISK_SPACE; if (palf_reach_time_interval(1 * 1000 * 1000, log_disk_full_warn_time_)) { PALF_LOG(WARN, "log outof disk space", K(ret), KPC(this), K(opts), K(ref_scn)); @@ -2425,7 +2423,7 @@ int PalfHandleImpl::receive_log(const common::ObAddr &server, } else { // rdlock RLockGuard guard(lock_); - if (false == diskspace_enough_) { + if (false == palf_env_impl_->check_disk_space_enough()) { ret = OB_LOG_OUTOF_DISK_SPACE; if (palf_reach_time_interval(1 * 1000 * 1000, log_disk_full_warn_time_)) { PALF_LOG(WARN, "log outof disk space", K(ret), KPC(this), K(server), K(push_log_type), K(lsn)); @@ -2509,7 +2507,7 @@ int PalfHandleImpl::submit_group_log(const PalfAppendOptions &opts, while (true) { do { RLockGuard guard(lock_); - if (false == diskspace_enough_) { + if (false == palf_env_impl_->check_disk_space_enough()) { ret = OB_LOG_OUTOF_DISK_SPACE; if (palf_reach_time_interval(1 * 1000 * 1000, log_disk_full_warn_time_)) { PALF_LOG(WARN, "log outof disk space", K(ret), KPC(this), K(opts), K(lsn)); @@ -3454,11 +3452,5 @@ int PalfHandleImpl::stat(PalfStat &palf_stat) return ret; } -void PalfHandleImpl::set_diskspace_enough(const bool diskspace_enough) -{ - WLockGuard guard(lock_); - diskspace_enough_ = diskspace_enough; -} - } // end namespace palf } // end namespace oceanbase diff --git a/src/logservice/palf/palf_handle_impl.h b/src/logservice/palf/palf_handle_impl.h index 87d49a17b..9fb385198 100644 --- a/src/logservice/palf/palf_handle_impl.h +++ b/src/logservice/palf/palf_handle_impl.h @@ -576,7 +576,6 @@ public: // ==================== Callback end ======================== virtual int revoke_leader(const int64_t proposal_id) = 0; virtual int stat(PalfStat &palf_stat) = 0; - virtual void set_diskspace_enough(const bool diskspace_enough) = 0; virtual int get_palf_epoch(int64_t &palf_epoch) const = 0; }; @@ -842,7 +841,6 @@ public: const LogCandidateList &candidate_list, const RegisterReturn reg_ret) override final; int handle_learner_req(const LogLearner &server, const LogLearnerReqType req_type) override final; - void set_diskspace_enough(const bool diskspace_enough) override final; int get_palf_epoch(int64_t &palf_epoch) const; TO_STRING_KV(K_(palf_id), K_(self), K_(has_set_deleted)); private: @@ -1006,7 +1004,6 @@ private: // NB: only set has_set_deleted_ to true when this palf_handle has been deleted. bool has_set_deleted_; PalfEnvImpl *palf_env_impl_; - bool diskspace_enough_; ObMiniStat::ObStatItem append_cost_stat_; ObMiniStat::ObStatItem flush_cb_cost_stat_; // a spin lock for read/write replica_meta mutex diff --git a/src/logservice/palf/palf_iterator.h b/src/logservice/palf/palf_iterator.h index 002526b68..544caf9be 100644 --- a/src/logservice/palf/palf_iterator.h +++ b/src/logservice/palf/palf_iterator.h @@ -37,7 +37,7 @@ public: } else if (OB_FAIL(iterator_impl_.init(&iterator_storage_))) { PALF_LOG(WARN, "PalfIterator init failed", K(ret)); } else { - PALF_LOG(INFO, "PalfIterator init success", K(ret), K(start_offset), KPC(this)); + PALF_LOG(TRACE, "PalfIterator init success", K(ret), K(start_offset), KPC(this)); is_inited_ = true; } return ret; diff --git a/src/logservice/restoreservice/ob_log_restore_handler.h b/src/logservice/restoreservice/ob_log_restore_handler.h index 3e46bf9f6..3ac0149b8 100644 --- a/src/logservice/restoreservice/ob_log_restore_handler.h +++ b/src/logservice/restoreservice/ob_log_restore_handler.h @@ -111,7 +111,7 @@ public: int get_restore_sync_scn(const share::ObLSID &id, palf::SCN &log_scn); void mark_error(share::ObTaskId &trace_id, const int ret_code); int get_restore_error(share::ObTaskId &trace_id, int &ret_code, bool &error_exist); - TO_STRING_KV(K_(is_inited), K_(is_in_stop_state), K_(id), K_(proposal_id), K_(role), KPC_(parent), K_(context)); + TO_STRING_KV(K_(is_inited), K_(is_in_stop_state), K_(id), K_(proposal_id), K_(role), KP_(parent), K_(context)); private: bool is_valid() const; diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index 40d74d11d..ef6c742f8 100644 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -1138,6 +1138,8 @@ typedef enum ObItemType T_INDEX_HINT, T_NO_INDEX_HINT, T_FULL_HINT, + T_USE_DAS_HINT, + T_NO_USE_DAS_HINT, T_USE_MERGE, T_USE_HASH, T_NO_USE_HASH, diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp index da4f41b25..151c97897 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp @@ -677,6 +677,7 @@ int ObDBMSSchedJobMaster::register_job( CK (OB_LIKELY(inited_)); CK (job_info.valid()); OZ (table_operator_.check_job_timeout(job_info)); + OZ (table_operator_.check_auto_drop(job_info)); if (OB_FAIL(ret)) { } else if (job_info.is_broken() || job_info.is_running() || job_info.is_disabled()) { execute_at = now + MIN_SCHEDULER_INTERVAL; diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp index f846ed646..0cec7c305 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp @@ -194,6 +194,21 @@ int ObDBMSSchedTableOperator::check_job_timeout(ObDBMSSchedJobInfo &job_info) return ret; } +int ObDBMSSchedTableOperator::check_auto_drop(ObDBMSSchedJobInfo &job_info) +{ + int ret = OB_SUCCESS; + if (job_info.is_running()) { + // running job not check + } else if (ObTimeUtility::current_time() > (job_info.end_date_) && + (true == job_info.auto_drop_)) { + OZ(update_for_end(job_info.get_tenant_id(), job_info, 0, NULL)); + LOG_WARN("auto drop miss out job", K(job_info), K(ObTimeUtility::current_time())); + } else { + LOG_DEBUG("job no need to drop", K(job_info)); + } + return ret; +} + int ObDBMSSchedTableOperator::check_job_can_running(int64_t tenant_id, bool &can_running) { int ret = OB_SUCCESS; diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h index 5788d3b47..303cd54e9 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h @@ -71,6 +71,9 @@ public: int check_job_can_running(int64_t tenant_id, bool &can_running); int check_job_timeout(ObDBMSSchedJobInfo &job_info); + + int check_auto_drop(ObDBMSSchedJobInfo &job_info); + private: DISALLOW_COPY_AND_ASSIGN(ObDBMSSchedTableOperator); diff --git a/src/observer/ob_dump_task_generator.cpp b/src/observer/ob_dump_task_generator.cpp index 6a42df05c..75161350d 100644 --- a/src/observer/ob_dump_task_generator.cpp +++ b/src/observer/ob_dump_task_generator.cpp @@ -209,7 +209,7 @@ void ObDumpTaskGenerator::dump_memory_leak() ob_free(buf); } } - if (fd > 0) { + if (fd >= 0) { ::close(fd); } } diff --git a/src/observer/ob_inner_sql_connection.cpp b/src/observer/ob_inner_sql_connection.cpp index e2cc4dd41..4944d4823 100644 --- a/src/observer/ob_inner_sql_connection.cpp +++ b/src/observer/ob_inner_sql_connection.cpp @@ -949,7 +949,8 @@ int ObInnerSQLConnection::execute(ParamStore ¶ms, ObVirtualTableIteratorFactory *vt_iter_factory, bool is_from_pl, bool is_dynamic, - bool is_forall) + bool is_forall, + int64_t array_binding_count) { int ret = OB_SUCCESS; ObExecRecord exec_record; @@ -1037,15 +1038,9 @@ int ObInnerSQLConnection::execute(ParamStore ¶ms, if (enable_sql_audit) { exec_record.record_start(); } - if (is_forall) { - const ObSqlArrayObj *array_obj = NULL; - CK (params.count() > 0); - CK (params.at(0).is_ext_sql_array()); - CK (OB_NOT_NULL(array_obj = reinterpret_cast(params.at(0).get_ext()))); - if (OB_SUCC(ret)) { - res.sql_ctx().multi_stmt_item_.set_ps_mode(true); - res.sql_ctx().multi_stmt_item_.set_ab_cnt(array_obj->count_); - } + if (OB_SUCC(ret) && is_forall) { + res.sql_ctx().multi_stmt_item_.set_ps_mode(true); + res.sql_ctx().multi_stmt_item_.set_ab_cnt(array_binding_count); } const uint64_t tenant_id = get_session().get_effective_tenant_id(); @@ -2259,7 +2254,8 @@ int ObInnerSQLConnection::execute(const uint64_t tenant_id, ObISQLClient::ReadResult &res, bool is_from_pl, bool is_dynamic, - bool is_forall) + bool is_forall, + int64_t array_binding_count) { int ret = OB_SUCCESS; FLTSpanGuard(inner_execute); @@ -2301,7 +2297,7 @@ int ObInnerSQLConnection::execute(const uint64_t tenant_id, get_session().store_query_string(ps_info->get_ps_sql()); if (OB_FAIL(execute(params, read_ctx->get_result(), &read_ctx->get_vt_iter_factory(), - is_from_pl, is_dynamic, is_forall))) { + is_from_pl, is_dynamic, is_forall, array_binding_count))) { LOG_WARN("execute sql failed", K(ret), K(tenant_id), K(stmt_id)); } } @@ -2493,8 +2489,6 @@ int ObInnerSQLConnection::get_session_variable(const ObString &name, int64_t &va if (!inited_) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); - } else if (0 == name.case_compare("ob_read_snapshot_version")) { //fake system variable - val = get_session().get_read_snapshot_version(); } else if (0 == name.case_compare("tx_isolation")) { // 隔离级别是一个varchar值 ObObj obj; @@ -2516,11 +2510,6 @@ int ObInnerSQLConnection::set_session_variable(const ObString &name, int64_t val if (!inited_) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); - } else if (0 == name.case_compare("ob_read_snapshot_version")) { //fake system variable - if (val > 0) { - LOG_INFO("inner sql with read snapshot version", K(name), K(val)); - } - (void)get_session().set_read_snapshot_version(val); } else if (0 == name.case_compare("ob_check_sys_variable")) { // fake system variable if (0 == val) { LOG_TRACE("disable inner sql check sys variable"); diff --git a/src/observer/ob_inner_sql_connection.h b/src/observer/ob_inner_sql_connection.h index 22b0754f6..9701df8fb 100644 --- a/src/observer/ob_inner_sql_connection.h +++ b/src/observer/ob_inner_sql_connection.h @@ -244,7 +244,8 @@ public: common::ObISQLClient::ReadResult &res, bool is_from_pl = false, bool is_dynamic = false, - bool is_forall = false); + bool is_forall = false, + int64_t array_binding_count = 0); virtual int execute(const uint64_t tenant_id, sqlclient::ObIExecutor &executor) override; @@ -333,7 +334,8 @@ private: ObVirtualTableIteratorFactory *vt_iter_factory = NULL, bool is_from_pl = false, bool is_dynamic = false, - bool is_forall = false); + bool is_forall = false, + int64_t array_binding_count = 0); int do_execute(const ParamStore ¶ms, ObInnerSQLResult &res); int switch_tenant(const uint64_t tenant_id); diff --git a/src/observer/ob_rpc_processor_simple.cpp b/src/observer/ob_rpc_processor_simple.cpp index 8c105477f..096618ce2 100644 --- a/src/observer/ob_rpc_processor_simple.cpp +++ b/src/observer/ob_rpc_processor_simple.cpp @@ -1928,10 +1928,11 @@ int ObRpcRemoteWriteDDLPrepareLogP::process() int64_t prepare_log_ts = 0; if (OB_FAIL(sstable_redo_writer.write_prepare_log(table_key, arg_.table_id_, - arg_.schema_version_, + arg_.execution_id_, + arg_.ddl_task_id_, prepare_log_ts))) { LOG_WARN("fail to remote write commit log", K(ret), K(table_key), K_(arg)); - } else if (OB_FAIL(ddl_kv_mgr->ddl_prepare(arg_.start_log_ts_, prepare_log_ts, arg_.table_id_, arg_.schema_version_))) { + } else if (OB_FAIL(ddl_kv_mgr->ddl_prepare(arg_.start_log_ts_, prepare_log_ts, arg_.table_id_, arg_.execution_id_, arg_.ddl_task_id_))) { LOG_WARN("failed to do ddl kv prepare", K(ret), K(arg_)); } else { result_ = prepare_log_ts; diff --git a/src/observer/ob_service.cpp b/src/observer/ob_service.cpp index 937e1f91b..1c7291ddc 100644 --- a/src/observer/ob_service.cpp +++ b/src/observer/ob_service.cpp @@ -565,7 +565,7 @@ int ObService::calc_column_checksum_request(const obrpc::ObCalcColumnChecksumReq LOG_WARN("error unexpected, dag scheduler must not be nullptr", KR(ret)); } else if (OB_FAIL(dag_scheduler->alloc_dag(dag))) { STORAGE_LOG(WARN, "fail to alloc dag", KR(ret)); - } else if (OB_FAIL(dag->init(arg.tenant_id_, arg.ls_id_, arg.tablet_id_, arg.calc_table_id_ == arg.target_table_id_, arg.target_table_id_, arg.schema_version_, arg.execution_id_, arg.snapshot_version_))) { + } else if (OB_FAIL(dag->init(arg.tenant_id_, arg.ls_id_, arg.tablet_id_, arg.calc_table_id_ == arg.target_table_id_, arg.target_table_id_, arg.schema_version_, arg.task_id_, arg.execution_id_, arg.snapshot_version_))) { STORAGE_LOG(WARN, "fail to init ObUniqueCheckingDag", KR(ret)); } else if (OB_FAIL(dag->alloc_global_index_task_callback(arg.tablet_id_, arg.target_table_id_, arg.source_table_id_, arg.schema_version_, arg.task_id_, callback))) { STORAGE_LOG(WARN, "fail to alloc global index task callback", KR(ret)); diff --git a/src/observer/ob_sql_client_decorator.cpp b/src/observer/ob_sql_client_decorator.cpp index 03b22a58f..c9550941b 100644 --- a/src/observer/ob_sql_client_decorator.cpp +++ b/src/observer/ob_sql_client_decorator.cpp @@ -98,7 +98,6 @@ int ObSQLClientRetryWeak::weak_read(ReadResult &res, const uint64_t tenant_id, c sqlclient::ObISQLConnection *conn = NULL; int64_t old_read_consistency = 0; ObString ob_read_consistency = ObString::make_string("ob_read_consistency"); - ObString read_snapshot_version_name= ObString::make_string("ob_read_snapshot_version"); ObString tx_isolation = ObString::make_string("tx_isolation"); int64_t old_tx_isolation = 0; int64_t read_committed = 1; // ObTransIsolation::READ_COMMITTED @@ -117,9 +116,6 @@ int ObSQLClientRetryWeak::weak_read(ReadResult &res, const uint64_t tenant_id, c // Mandatory set to READ-COMMITTED isolation level else if (OB_FAIL(conn->set_session_variable(tx_isolation, read_committed))) { LOG_WARN("failed to set session variable ob_read_consistency", K(ret)); - } else if (snapshot_timestamp_ > 0 && - OB_FAIL(conn->set_session_variable(read_snapshot_version_name, snapshot_timestamp_))) { - LOG_WARN("failed to set session variable ob_read_snapshot_version", K(ret), K_(snapshot_timestamp)); } else { if (check_sys_variable_) { @@ -149,13 +145,6 @@ int ObSQLClientRetryWeak::weak_read(ReadResult &res, const uint64_t tenant_id, c } ret = (OB_SUCCESS == ret) ? tmp_ret : ret; - // reset ob_read_snapshot_version - tmp_ret = conn->set_session_variable(read_snapshot_version_name, OB_INVALID_VERSION); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("failed to set session variable ob_read_snapshot_version", K(ret)); - } - ret = (OB_SUCCESS == ret) ? tmp_ret : ret; - } return ret; } diff --git a/src/observer/omt/ob_multi_tenant.cpp b/src/observer/omt/ob_multi_tenant.cpp index e819af74e..969af4d28 100644 --- a/src/observer/omt/ob_multi_tenant.cpp +++ b/src/observer/omt/ob_multi_tenant.cpp @@ -578,7 +578,8 @@ int ObMultiTenant::create_tenant_without_unit(const uint64_t tenant_id, return ret; } -int ObMultiTenant::convert_hidden_to_real_sys_tenant(const ObUnitInfoGetter::ObTenantConfig &unit) +int ObMultiTenant::convert_hidden_to_real_sys_tenant(const ObUnitInfoGetter::ObTenantConfig &unit, + const int64_t abs_timeout_us) { int ret = OB_SUCCESS; @@ -590,12 +591,14 @@ int ObMultiTenant::convert_hidden_to_real_sys_tenant(const ObUnitInfoGetter::ObT ObTenantSuperBlock new_super_block; bool lock_succ = false; int64_t bucket_lock_idx = -1; + int64_t lock_timeout_ts = abs_timeout_us - 3000000; // reserve 3s for converting tenant + if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); - } else if (OB_FAIL(bucket_lock_.try_wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id)))) { - LOG_WARN("fail to try_wrlock for convert_hidden_to_real_sys_tenant", K(ret), K(bucket_lock_idx)); + } else if (OB_FAIL(bucket_lock_.wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id), lock_timeout_ts))) { + LOG_WARN("fail to wrlock for convert_hidden_to_real_sys_tenant", K(ret), K(bucket_lock_idx), K(lock_timeout_ts)); } else if (FALSE_IT(lock_succ = true)) { } else if (OB_FAIL(get_tenant(tenant_id, tenant))) { LOG_WARN("fail to get sys tenant", K(tenant_id), K(ret)); @@ -622,7 +625,7 @@ int ObMultiTenant::convert_hidden_to_real_sys_tenant(const ObUnitInfoGetter::ObT return ret; } -int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog) +int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, const int64_t abs_timeout_us) { int ret = OB_SUCCESS; @@ -635,6 +638,7 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog) ObTenantCreateStep create_step = ObTenantCreateStep::STEP_BEGIN; // step0 bool lock_succ = false; int64_t bucket_lock_idx = -1; + int64_t lock_timeout_ts = abs_timeout_us - 5000000; // reserve 5s for creating tenant if (IS_NOT_INIT) { ret = OB_NOT_INIT; @@ -645,8 +649,8 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog) } else if (OB_ISNULL(malloc_allocator)) { ret = OB_ERR_UNEXPECTED; LOG_ERROR("malloc allocator is NULL", K(ret)); - } else if (OB_FAIL(bucket_lock_.try_wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id)))) { - LOG_WARN("fail to try_wrlock for create tenant", K(ret), K(tenant_id), K(bucket_lock_idx)); + } else if (OB_FAIL(bucket_lock_.wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id), lock_timeout_ts))) { + LOG_WARN("fail to wrlock for create tenant", K(ret), K(tenant_id), K(bucket_lock_idx), K(lock_timeout_ts)); } else if (FALSE_IT(lock_succ = true)) { } else if (OB_SUCC(get_tenant(tenant_id, tenant))) { ret = OB_TENANT_EXIST; @@ -854,7 +858,7 @@ int ObMultiTenant::update_tenant_unit(const ObUnitInfoGetter::ObTenantConfig &un if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); - } else if (OB_FAIL(bucket_lock_.try_wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id)))) { + } else if (OB_FAIL(bucket_lock_.wrlock(bucket_lock_idx = get_tenant_lock_bucket_idx(tenant_id)))) { LOG_WARN("fail to try_wrlock for update tenant unit", K(ret), K(tenant_id), K(bucket_lock_idx)); } else if (FALSE_IT(lock_succ = true)) { } else if (OB_FAIL(update_tenant_unit_no_lock(unit))) { @@ -1283,13 +1287,6 @@ int ObMultiTenant::remove_tenant(const uint64_t tenant_id) } else if (OB_FAIL(GCTX.session_mgr_->kill_tenant(tenant_id))) { LOG_ERROR("fail to kill tenant session", K(ret), K(tenant_id)); } else { - LOG_INFO("removed_tenant begin to stop", K(tenant_id)); - removed_tenant->stop(); - LOG_INFO("removed_tenant begin to wait", K(tenant_id)); - removed_tenant->wait(); - // wait for some outstanding requests to complete, which may need to switch tenant, - // so here call try_wrlock after wait, otherwise, some req may be hang in the th_worker. - // https://work.aone.alibaba-inc.com/issue/44705579 LOG_INFO("removed_tenant begin to try wlock", K(tenant_id)); bool locked = false; ObLDHandle handle; @@ -1305,6 +1302,10 @@ int ObMultiTenant::remove_tenant(const uint64_t tenant_id) LOG_WARN("can't get tenant wlock to remove tenant", K(tenant_id), K(ret)); removed_tenant->lock_.ld_.print(); } else { + LOG_INFO("removed_tenant begin to stop", K(tenant_id)); + removed_tenant->stop(); + LOG_INFO("removed_tenant begin to wait", K(tenant_id)); + removed_tenant->wait(); ObTenant *removed_tenant_tmp = nullptr; SpinWLockGuard guard(lock_); @@ -1560,13 +1561,20 @@ int ObMultiTenant::get_tenant_with_tenant_lock( const uint64_t tenant_id, ObLDHandle &handle, ObTenant *&tenant) const { SpinRLockGuard guard(lock_); - int ret = get_tenant_unsafe(tenant_id, tenant); + ObTenant *tenant_tmp = nullptr; + int ret = get_tenant_unsafe(tenant_id, tenant_tmp); if (OB_SUCC(ret)) { - if (OB_FAIL(tenant->try_rdlock(handle)) && tenant->has_stopped()) { - // in some cases this error code is handled specially - ret = OB_IN_STOP_STATE; - LOG_WARN("fail to try rdlock tenant", K(ret), K(tenant_id)); - } else if (OB_UNLIKELY(tenant->has_stopped())) { + if (OB_FAIL(tenant_tmp->try_rdlock(handle))) { + if (tenant_tmp->has_stopped()) { + // in some cases this error code is handled specially + ret = OB_IN_STOP_STATE; + LOG_WARN("fail to try rdlock tenant", K(ret), K(tenant_id)); + } + } else { + // assign tenant when get rdlock succ + tenant = tenant_tmp; + } + if (OB_UNLIKELY(tenant_tmp->has_stopped())) { LOG_WARN("get rdlock when tenant has stopped", K(tenant_id), K(lbt())); } } diff --git a/src/observer/omt/ob_multi_tenant.h b/src/observer/omt/ob_multi_tenant.h index 9cdcb3879..c5c59e873 100644 --- a/src/observer/omt/ob_multi_tenant.h +++ b/src/observer/omt/ob_multi_tenant.h @@ -99,9 +99,9 @@ public: void destroy(); int create_hidden_sys_tenant(); - int convert_hidden_to_real_sys_tenant(const share::ObUnitInfoGetter::ObTenantConfig &unit); + int convert_hidden_to_real_sys_tenant(const share::ObUnitInfoGetter::ObTenantConfig &unit, const int64_t abs_timeout_us = INT64_MAX); int create_tenant_without_unit(const uint64_t tenant_id, const double min_cpu, const double max_cpu); - int create_tenant(const ObTenantMeta &meta, bool write_slog); + int create_tenant(const ObTenantMeta &meta, bool write_slog, const int64_t abs_timeout_us = INT64_MAX); int update_tenant_unit(const share::ObUnitInfoGetter::ObTenantConfig &unit); int get_tenant_unit(const uint64_t tenant_id, share::ObUnitInfoGetter::ObTenantConfig &unit); diff --git a/src/observer/omt/ob_tenant_node_balancer.cpp b/src/observer/omt/ob_tenant_node_balancer.cpp index a154671a6..933f7ebec 100644 --- a/src/observer/omt/ob_tenant_node_balancer.cpp +++ b/src/observer/omt/ob_tenant_node_balancer.cpp @@ -157,8 +157,12 @@ int ObTenantNodeBalancer::notify_create_tenant(const obrpc::TenantServerUnitConf const bool has_memstore = (unit.replica_type_ != REPLICA_TYPE_LOGONLY); const int64_t create_timestamp = ObTimeUtility::current_time(); basic_tenant_unit.unit_status_ = ObUnitInfoGetter::ObUnitStatus::UNIT_NORMAL; + const int64_t create_tenant_timeout_ts = THIS_WORKER.get_timeout_ts(); - if (OB_FAIL(basic_tenant_unit.init(tenant_id, + if (create_tenant_timeout_ts < create_timestamp) { + ret = OB_TIMEOUT; + LOG_WARN("notify_create_tenant has timeout", K(ret), K(create_timestamp), K(create_tenant_timeout_ts)); + } else if (OB_FAIL(basic_tenant_unit.init(tenant_id, unit.unit_id_, ObUnitInfoGetter::ObUnitStatus::UNIT_NORMAL, unit.unit_config_, @@ -170,19 +174,19 @@ int ObTenantNodeBalancer::notify_create_tenant(const obrpc::TenantServerUnitConf } else if (is_user_tenant(tenant_id) && OB_FAIL(basic_tenant_unit.divide_meta_tenant(meta_tenant_unit))) { LOG_WARN("divide meta tenant failed", KR(ret), K(unit), K(basic_tenant_unit)); - } else if (OB_FAIL(check_new_tenant(basic_tenant_unit))) { - LOG_WARN("failed to create new tenant", KR(ret), K(basic_tenant_unit)); + } else if (OB_FAIL(check_new_tenant(basic_tenant_unit, create_tenant_timeout_ts))) { + LOG_WARN("failed to create new tenant", KR(ret), K(basic_tenant_unit), K(create_tenant_timeout_ts)); } else { ret = OB_SUCCESS; - LOG_INFO("succ to create new user tenant", KR(ret), K(unit), K(basic_tenant_unit)); + LOG_INFO("succ to create new user tenant", KR(ret), K(unit), K(basic_tenant_unit), K(create_tenant_timeout_ts)); } // create meta tenant if (OB_SUCC(ret) && is_user_tenant(tenant_id)) { - if (OB_FAIL(check_new_tenant(meta_tenant_unit))) { - LOG_WARN("failed to create meta tenant", KR(ret), K(meta_tenant_unit)); + if (OB_FAIL(check_new_tenant(meta_tenant_unit, create_tenant_timeout_ts))) { + LOG_WARN("failed to create meta tenant", KR(ret), K(meta_tenant_unit), K(create_tenant_timeout_ts)); } else { ret = OB_SUCCESS; - LOG_INFO("succ to create meta tenant", KR(ret), K(meta_tenant_unit)); + LOG_INFO("succ to create meta tenant", KR(ret), K(meta_tenant_unit), K(create_tenant_timeout_ts)); } } } @@ -305,7 +309,7 @@ int ObTenantNodeBalancer::check_new_tenants(TenantUnits &units) return ret; } -int ObTenantNodeBalancer::check_new_tenant(const ObUnitInfoGetter::ObTenantConfig &unit) +int ObTenantNodeBalancer::check_new_tenant(const ObUnitInfoGetter::ObTenantConfig &unit, const int64_t abs_timeout_us) { int ret = OB_SUCCESS; @@ -318,7 +322,7 @@ int ObTenantNodeBalancer::check_new_tenant(const ObUnitInfoGetter::ObTenantConfi if (OB_SYS_TENANT_ID == tenant_id) { if (OB_SUCC(omt_->get_tenant(tenant_id, tenant))) { if (tenant->is_hidden()) { - if (OB_FAIL(omt_->convert_hidden_to_real_sys_tenant(unit))) { + if (OB_FAIL(omt_->convert_hidden_to_real_sys_tenant(unit, abs_timeout_us))) { LOG_WARN("fail to create real sys tenant", K(unit)); } } else { // is real sys tenant @@ -357,7 +361,7 @@ int ObTenantNodeBalancer::check_new_tenant(const ObUnitInfoGetter::ObTenantConfi ObTenantSuperBlock super_block(tenant_id, false/*is_hidden*/); // empty super block if (OB_FAIL(tenant_meta.build(unit, super_block))) { LOG_WARN("fail to build tenant meta", K(ret)); - } else if (OB_FAIL(omt_->create_tenant(tenant_meta, true/* write_slog */))) { + } else if (OB_FAIL(omt_->create_tenant(tenant_meta, true/* write_slog */, abs_timeout_us))) { LOG_WARN("fail to create new tenant", K(ret), K(tenant_id)); } } else if (OB_FAIL(omt_->update_tenant_unit(unit))) { diff --git a/src/observer/omt/ob_tenant_node_balancer.h b/src/observer/omt/ob_tenant_node_balancer.h index 542902399..66f98e04c 100644 --- a/src/observer/omt/ob_tenant_node_balancer.h +++ b/src/observer/omt/ob_tenant_node_balancer.h @@ -79,7 +79,7 @@ private: ~ObTenantNodeBalancer(); int check_new_tenants(share::TenantUnits &units); - int check_new_tenant(const share::ObUnitInfoGetter::ObTenantConfig &unit); + int check_new_tenant(const share::ObUnitInfoGetter::ObTenantConfig &unit, const int64_t abs_timeout_us = INT64_MAX); int check_del_tenants(const share::TenantUnits &local_units, share::TenantUnits &units); void periodically_check_tenant(); int fetch_effective_tenants(const share::TenantUnits &old_tenants, share::TenantUnits &new_tenants); diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait.cpp b/src/observer/virtual_table/ob_all_virtual_session_wait.cpp index 075fbfb24..84e7cd224 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_wait.cpp @@ -125,6 +125,10 @@ int ObAllVirtualSessionWait::inner_get_next_row(ObNewRow *&row) ret = OB_ITER_END; } if (OB_SUCCESS == ret && session_status_.count() != 0) { + if (OB_ISNULL(event_desc) || OB_ISNULL(collect_)) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN, "event_desc or collect_ is NULL", K(ret), KP(event_desc), KP(collect_)); + } uint64_t cell_idx = 0; int64_t curr_time = ObTimeUtility::current_time(); for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) { diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp b/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp index e6960b9c7..13a60ee17 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp @@ -147,9 +147,9 @@ int ObAllVirtualSessionWaitHistory::inner_get_next_row(ObNewRow *&row) ret = OB_ITER_END; } if (OB_SUCCESS == ret && session_status_.count() != 0) { - if (nullptr == event_desc) { + if (OB_ISNULL(event_desc) || OB_ISNULL(collect_)) { ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "event_desc is NULL", K(ret)); + SERVER_LOG(WARN, "event_desc or collect_ is NULL", K(ret), KP(event_desc), KP(collect_)); } uint64_t cell_idx = 0; double value = 0; diff --git a/src/observer/virtual_table/ob_tenant_virtual_outline.h b/src/observer/virtual_table/ob_tenant_virtual_outline.h index 9184ee3ba..c081d5cca 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_outline.h +++ b/src/observer/virtual_table/ob_tenant_virtual_outline.h @@ -46,6 +46,8 @@ class ObTenantVirtualOutlineBase: public common::ObVirtualTableIterator protected: struct DBInfo { + DBInfo() : db_name_(), is_recycle_(false) {} + common::ObString db_name_; bool is_recycle_; }; diff --git a/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp b/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp index ea1347af2..0f3bc40c7 100644 --- a/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp +++ b/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp @@ -13,21 +13,10 @@ #define USING_LOG_PREFIX SERVER #include "ob_virtual_open_cursor_table.h" -#include "lib/container/ob_array_serialization.h" -#include "share/schema/ob_schema_getter_guard.h" -#include "share/schema/ob_table_schema.h" #include "sql/session/ob_sql_session_mgr.h" -#include "lib/oblog/ob_log_module.h" -#include "common/object/ob_object.h" -#include "observer/ob_req_time_service.h" #include "observer/ob_server.h" -#include "lib/allocator/ob_mod_define.h" - -#include "sql/plan_cache/ob_plan_cache_manager.h" -#include "sql/plan_cache/ob_plan_cache.h" -#include "sql/plan_cache/ob_plan_cache_callback.h" -#include "sql/plan_cache/ob_plan_cache_value.h" -#include "sql/plan_cache/ob_plan_cache_util.h" +#include "sql/session/ob_sql_session_info.h" +#include "sql/privilege_check/ob_ora_priv_check.h" using namespace oceanbase::common; using namespace oceanbase::share::schema; @@ -37,74 +26,11 @@ namespace oceanbase { namespace observer { -void ObVirtualOpenCursorTable::ObEachSessionId::reset() -{ - is_success_ = false; - sids_map_.destroy(); -} - -int ObVirtualOpenCursorTable::ObEachSessionId::init(int64_t item_cnt, ObIAllocator *allocator) -{ - int ret = OB_SUCCESS; - OZ (sids_map_.create(item_cnt * 4 / 3, ObModIds::OB_HASH_BUCKET)); - OX (allocator_ = allocator); - return ret; -} - -bool ObVirtualOpenCursorTable::ObEachSessionId::operator()(sql::ObSQLSessionMgr::Key key, - sql::ObSQLSessionInfo *sess_info) -{ - UNUSED(key); - SessionInfo vsp; - is_success_ = true; - int ret = OB_SUCCESS; - CK (OB_NOT_NULL(sess_info)); - CK (OB_NOT_NULL(allocator_)); - if (OB_SUCC(ret)) { - char *sql_id = nullptr; - sql::ObSQLSessionInfo::LockGuard lock_guard(sess_info->get_thread_data_lock()); - if (OB_ISNULL(sql_id = reinterpret_cast(allocator_->alloc(common::OB_MAX_SQL_ID_LENGTH + 1)))) { - ret = OB_ALLOCATE_MEMORY_FAILED; - SERVER_LOG(WARN, "failed to alloc buf", K(ret)); - } else if (FALSE_IT(sess_info->get_cur_sql_id(sql_id, OB_MAX_SQL_ID_LENGTH + 1))) { - } else if (sql_id[0] != '\0') { - vsp.id = sess_info->get_sessid(); - vsp.addr = reinterpret_cast(sess_info); - vsp.sql_id.assign(sql_id, common::OB_MAX_SQL_ID_LENGTH); - OZ (ob_write_string(*allocator_, sess_info->get_user_name(), vsp.user_name)); - if (vsp.is_valid()) { - SessionInfoArray vsp_arr; - OZ (sids_map_.get_refactored(vsp.sql_id, vsp_arr)); - - if (OB_HASH_NOT_EXIST == ret) { - ret = OB_SUCCESS; - OZ (vsp_arr.push_back(vsp)); - OZ (sids_map_.set_refactored(vsp.sql_id, vsp_arr)); - } else if (OB_SUCCESS != ret) { - // do nothing - } else { - OZ (vsp_arr.push_back(vsp)); - OZ (sids_map_.set_refactored(vsp.sql_id, vsp_arr, 1)); - } - } - } - } - return is_success_ && (OB_SUCCESS == ret); -} ObVirtualOpenCursorTable::ObVirtualOpenCursorTable() : ObVirtualTableScannerIterator(), - sess_mgr_(NULL), - pcm_(NULL), - plan_id_array_idx_(0), - plan_cache_(NULL), - sess_arr_(NULL), - sess_id_array_idx_(0), - oesid_(allocator_), - tenant_id_(OB_INVALID_ID), - port_(0), - is_travs_sess_(false), - plan_id_(0) + session_mgr_(NULL), + port_(0) { } @@ -113,6 +39,15 @@ ObVirtualOpenCursorTable::~ObVirtualOpenCursorTable() reset(); } +void ObVirtualOpenCursorTable::reset() +{ + session_mgr_ = NULL; + ipstr_.reset(); + port_ = 0; + fill_scanner_.reset(); + ObVirtualTableScannerIterator::reset(); +} + int ObVirtualOpenCursorTable::set_addr(const common::ObAddr &addr) { int ret = OB_SUCCESS; @@ -130,245 +65,337 @@ int ObVirtualOpenCursorTable::set_addr(const common::ObAddr &addr) return ret; } -void ObVirtualOpenCursorTable::reset() -{ - sess_mgr_ = NULL; - pcm_ = NULL; - plan_id_array_idx_ = 0; - plan_cache_ = NULL; - sess_id_array_idx_ = 0; - sess_arr_ = NULL; - oesid_.reset(); - tenant_id_ = OB_INVALID_ID; - ipstr_.reset(); - port_ = 0; - is_travs_sess_ = false; - ObVirtualTableScannerIterator::reset(); -} - -int ObVirtualOpenCursorTable::inner_open() -{ - int ret = OB_SUCCESS; - int64_t sess_cnt = 0; - CK (OB_NOT_NULL(allocator_)); - OZ (sess_mgr_->get_session_count(sess_cnt)); - OZ (oesid_.init(sess_cnt, allocator_)); - OZ (sess_mgr_->for_each_session(oesid_)); - if (OB_SUCC(ret)) { - // !!! 引用plan cache资源前必须加ObReqTimeGuard - ObReqTimeGuard req_timeinfo_guard; - if (OB_UNLIKELY(NULL == pcm_)) { - ret = OB_NOT_INIT; - SERVER_LOG(WARN, "pcm_ is NULL", K(ret)); - } else if (OB_UNLIKELY(NULL != plan_cache_)){ - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "before get_plan_cache, the point of plan_cache must be NULL", K(ret)); - } else if (OB_UNLIKELY(NULL == (plan_cache_ = pcm_->get_plan_cache(tenant_id_)))) { - SERVER_LOG(WARN, "plan cache is null", K(ret)); - } else { - ObGetAllPlanIdOp plan_id_op(&plan_id_array_); - if (OB_FAIL(plan_cache_->foreach_cache_obj(plan_id_op))) { - SERVER_LOG(WARN, "fail to traverse id2stat_map"); - } else { - plan_id_array_idx_ = 0; - } - } - } - return ret; -} - int ObVirtualOpenCursorTable::inner_get_next_row(ObNewRow *&row) { int ret = OB_SUCCESS; - bool is_end = false; - - if (OB_ISNULL(sess_mgr_)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(ERROR, "session mgr is null", K(ret)); + if (OB_ISNULL(session_mgr_)) { + ret = OB_NOT_INIT; + SERVER_LOG(WARN, "sessionMgr is NULL", K(ret)); } else { - if (NULL == plan_cache_) { - ret = OB_ITER_END; - is_end = true; - } else if (OB_SUCC(ret)) { - if (is_travs_sess_) { - bool is_filled = false; - ObCacheObjGuard guard(GV_SQL_HANDLE); - ObPlanCacheObject *plan = NULL; - if (OB_FAIL(plan_cache_->ref_cache_obj(plan_id_, guard))) { - // this rarely happens this because other had hold ref_cnt of this cache obj. - SERVER_LOG(ERROR, "failed to get plan.", K(ret)); - } else if (FALSE_IT(plan = static_cast(guard.get_cache_obj()))) { - } else if (OB_FAIL(fill_cells(row, is_filled, plan))) { - SERVER_LOG(ERROR, "failed to fill cells", K(ret)); + if (!start_to_read_) { + if (OB_FAIL(fill_scanner_.init(allocator_, + &scanner_, + session_, + &cur_row_, + output_column_ids_, + schema_guard_, + ipstr_, + port_))) { + SERVER_LOG(WARN, "init fill_scanner fail", K(ret)); + } else if (OB_FAIL(session_mgr_->for_each_session(fill_scanner_))) { + SERVER_LOG(WARN, "fill scanner fail", K(ret)); + } else { + scanner_it_ = scanner_.begin(); + start_to_read_ = true; + } + } + if (OB_SUCCESS == ret && start_to_read_) { + if (OB_FAIL(scanner_it_.get_next_row(cur_row_))) { + if (OB_UNLIKELY(OB_ITER_END != ret)) { + SERVER_LOG(WARN, "fail to get next row", K(ret)); } } else { - bool is_filled = false; - while (OB_SUCC(ret) && false == is_filled && false == is_end) { - if (plan_id_array_idx_ < 0) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "invalid plan_stat_array index", K(plan_id_array_idx_)); - } else if (plan_id_array_idx_ >= plan_id_array_.count()) { - is_end = true; - plan_id_array_idx_ = OB_INVALID_ID; - plan_id_array_.reset(); - ret = OB_ITER_END; - if (OB_UNLIKELY(NULL == plan_cache_)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "plan cache is null", K(ret)); - } else { - plan_cache_->dec_ref_count(); - plan_cache_ = NULL; - } - } else { - ObPlanCacheObject *plan = NULL; - ObCacheObjGuard guard(GV_SQL_HANDLE); - is_end = false; - plan_id_ = plan_id_array_.at(plan_id_array_idx_); - ++plan_id_array_idx_; - int tmp_ret = plan_cache_->ref_cache_obj(plan_id_, guard); //plan引用计数加1 - //如果当前plan_id对应的plan已被淘汰, 则忽略继续获取下一个plan - // cache_obj = guard.get_cache_obj(); - if (OB_HASH_NOT_EXIST == tmp_ret) { - //do nothing; - } else if (OB_SUCCESS != tmp_ret) { - ret = tmp_ret; - } else if (FALSE_IT(plan = static_cast(guard.get_cache_obj()))) { - } else if (OB_FAIL(fill_cells(row, is_filled, plan))) { //plan exist - SERVER_LOG(WARN, "fail to fill cells", K(plan), K(tenant_id_)); - } else { - } - } - } //while end: + row = &cur_row_; } } } return ret; } -int ObVirtualOpenCursorTable::fill_cells(ObNewRow *&row, bool &is_filled, ObPlanCacheObject* cache_obj) +bool ObVirtualOpenCursorTable::FillScanner::operator()(sql::ObSQLSessionMgr::Key key, + ObSQLSessionInfo *sess_info) { int ret = OB_SUCCESS; - const ObPhysicalPlan *plan = NULL; - is_filled = false; - if (!cache_obj->is_sql_crsr()) { + if (OB_UNLIKELY(NULL == scanner_ + || NULL == allocator_ + || NULL == cur_row_ + || NULL == cur_row_->cells_ + || NULL == sess_info + || NULL == my_session_)) { + ret = OB_NOT_INIT; + SERVER_LOG(WARN, + "parameter or data member is NULL", + K(ret), + K(scanner_), + K(allocator_), + K(cur_row_), + K(sess_info), + K(my_session_)); + } else if (OB_UNLIKELY(cur_row_->count_ < output_column_ids_.count())) { ret = OB_ERR_UNEXPECTED; - SERVER_LOG(ERROR, "not a sql", K(ret)); - } else if (OB_ISNULL(plan = dynamic_cast(cache_obj))) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "unexpected null plan", K(ret), K(plan)); - } else if (OB_ISNULL(sess_arr_ = oesid_.get_sid_maps().get(plan->get_sql_id()))) { - is_filled = false; + SERVER_LOG(WARN, + "cells count is less than output column count", + K(ret), + K(cur_row_->count_), + K(output_column_ids_.count())); } else { - SERVER_LOG(WARN, "sid array count", K(sess_arr_->count())); - if (sess_id_array_idx_ < sess_arr_->count()) { - OZ (fill_cells_impl(sess_arr_->at(sess_id_array_idx_), plan)); - OX (sess_id_array_idx_++); - OX (row = &cur_row_); - is_filled = true; - } - -#define RESET_TRAVS_STATUS() \ -do { \ - is_travs_sess_ = false; \ - sess_id_array_idx_ = 0; \ -} while(0) - - // 如果失败,不管如何先释放对plan cache内部的引用 - if (OB_FAIL(ret)) { - RESET_TRAVS_STATUS(); - } else { - if (sess_id_array_idx_ == sess_arr_->count()) { - RESET_TRAVS_STATUS(); - } else { - is_travs_sess_ = true; + ObServer &server = ObServer::get_instance(); + uint64_t cell_idx = 0; + char ip_buf[common::OB_IP_STR_BUFF]; + char peer_buf[common::OB_IP_PORT_STR_BUFF]; + char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1]; + //If you are in system tenant, you can see all thread. + //Otherwise, you can show only the threads at the same Tenant with you. + //If you have the PROCESS privilege, you can show all threads at your Tenant. + //Otherwise, you can show only your own threads. + if (sess_info->is_shadow()) { + //this session info is logical free, shouldn't be added to scanner + } else if ((OB_SYS_TENANT_ID == my_session_->get_priv_tenant_id()) + || (sess_info->get_priv_tenant_id() == my_session_->get_priv_tenant_id() + && my_session_->get_user_id() == sess_info->get_user_id())) { + ObSQLSessionInfo::LockGuard lock_guard(sess_info->get_thread_data_lock()); + OZ (fill_cur_plan_cell(*sess_info)); + for (sql::ObSQLSessionInfo::CursorCache::CursorMap::iterator iter = + sess_info->get_cursor_cache().pl_cursor_map_.begin(); //ignore ret + OB_SUCC(ret) && iter != sess_info->get_cursor_cache().pl_cursor_map_.end(); + ++iter) { + pl::ObPLCursorInfo *cursor_info = iter->second; + if (OB_ISNULL(cursor_info)) { + // do not report error + SERVER_LOG(WARN, "get a NULL cursor when record for v$open_cursor."); + } else { + OZ (fill_session_cursor_cell(*sess_info, cursor_info->get_id())); + } } } - // for(int i = 0; OB_SUCC(ret) && i < sess_arr_->count(); ++i) { - // OZ (fill_cells_impl(sess_arr_->at(i), plan, plan_cache)); - // } } - return ret; + return OB_SUCCESS == ret; } -int ObVirtualOpenCursorTable::fill_cells_impl(const SessionInfo &sess_info, - const ObPhysicalPlan *plan) +int ObVirtualOpenCursorTable::FillScanner::fill_session_cursor_cell(ObSQLSessionInfo &sess_info, + const int64_t cursor_id) { int ret = OB_SUCCESS; - ObObj *cells = cur_row_.cells_; const int64_t col_count = output_column_ids_.count(); ObCharsetType default_charset = ObCharset::get_default_charset(); ObCollationType default_collation = ObCharset::get_default_collation(default_charset); - if (OB_UNLIKELY(NULL == cells)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(ERROR, "cur row cell is NULL", K(ret)); - } else { + for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) { + const uint64_t col_id = output_column_ids_.at(i); + switch (col_id) { + case TENANT_ID: { + cur_row_->cells_[i].set_int(sess_info.get_priv_tenant_id()); + break; + } + case SVR_IP: { + cur_row_->cells_[i].set_varchar(ipstr_); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case SVR_PORT: { + cur_row_->cells_[i].set_int(port_); + break; + } + case SADDR: { + ObSqlString addr; + ObString tmp_saddr; + addr.append_fmt("%lx", reinterpret_cast(&sess_info)); + OZ (ob_write_string(*allocator_, addr.string(), tmp_saddr)); + // get last 8 char, for oracle compatiable + int64_t offset = tmp_saddr.length() > 8 ? tmp_saddr.length() - 8 : 0; + // if tmp_saddr.length() - offset > 8, offset is 0 + // the length make sure (tmp_saddr.ptr() + offset) do not have out-of-bounds access + int64_t length = tmp_saddr.length() - offset > 8 ? 8 : tmp_saddr.length() - offset; + ObString saddr(length, tmp_saddr.ptr() + offset); + cur_row_->cells_[i].set_varchar(saddr); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case SID: { + cur_row_->cells_[i].set_int(sess_info.get_sessid()); + break; + } + case USER_NAME: { + cur_row_->cells_[i].set_varchar(sess_info.get_user_name()); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case ADDRESS: { + // session cursor not set now + cur_row_->cells_[i].set_null(); + break; + } + case HASH_VALUE: { + // cur_row_->cells_[i].set_int(sess_info.id); + cur_row_->cells_[i].set_null(); + break; + } + case SQL_ID: { + char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1]; + if (obmysql::COM_QUERY == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_EXECUTE == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_PREPARE == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_PREXECUTE == sess_info.get_mysql_cmd()) { + sess_info.get_cur_sql_id(sql_id, OB_MAX_SQL_ID_LENGTH + 1); + } else { + sql_id[0] = '\0'; + } + cur_row_->cells_[i].set_varchar(ObString::make_string(sql_id)); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case SQL_TEXT: { + ObPsStmtId inner_stmt_id = OB_INVALID_ID; + if (0 == (cursor_id & (1L << 31))) { + if (OB_ISNULL(sess_info.get_ps_cache())) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN,"ps : ps cache is null.", K(ret), K(cursor_id)); + } else if (OB_FAIL(sess_info.get_inner_ps_stmt_id(cursor_id, inner_stmt_id))) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN,"ps : get inner stmt id fail.", K(ret), K(cursor_id)); + } else { + ObPsStmtInfoGuard guard; + ObPsStmtInfo *ps_info = NULL; + if (OB_FAIL(sess_info.get_ps_cache()->get_stmt_info_guard(inner_stmt_id, guard))) { + SERVER_LOG(WARN,"get stmt info guard failed", K(ret), K(cursor_id), K(inner_stmt_id)); + } else if (OB_ISNULL(ps_info = guard.get_stmt_info())) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN,"get stmt info is null", K(ret)); + } else { + ObString sql = ps_info->get_ps_sql(); + int64_t len = 60 > sql.length() ? sql.length() : 60; + cur_row_->cells_[i].set_varchar(ObString(len, ps_info->get_ps_sql().ptr())); + cur_row_->cells_[i].set_collation_type(default_collation); + } + } + } else { + // refcursor can not get sql now + cur_row_->cells_[i].set_varchar("ref cursor"); + cur_row_->cells_[i].set_collation_type(default_collation); + } + break; + } + case LAST_SQL_ACTIVE_TIME: { + // session cursor not set now + cur_row_->cells_[i].set_null(); + break; + } + case SQL_EXEC_ID: { + cur_row_->cells_[i].set_null(); + break; + } + case CURSOR_TYPE: { + cur_row_->cells_[i].set_varchar("SESSION CURSOR CACHED"); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case CHILD_ADDRESS: { + cur_row_->cells_[i].set_null(); + break; + } + case CON_ID: { + cur_row_->cells_[i].set_int(1); + break; + } + default: { + break; + } + } + } + if (OB_UNLIKELY(OB_SUCCESS == ret && OB_SUCCESS != (ret = scanner_->add_row(*cur_row_)))) { + SERVER_LOG(WARN, "fail to add row", K(ret), K(*cur_row_)); + } + return ret; +} + +int ObVirtualOpenCursorTable::FillScanner::fill_cur_plan_cell(ObSQLSessionInfo &sess_info) +{ + int ret = OB_SUCCESS; + const int64_t col_count = output_column_ids_.count(); + ObCharsetType default_charset = ObCharset::get_default_charset(); + ObCollationType default_collation = ObCharset::get_default_collation(default_charset); + ObPlanCache *plan_cache = sess_info.get_plan_cache(); + if (OB_NOT_NULL(plan_cache)) { for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) { const uint64_t col_id = output_column_ids_.at(i); switch (col_id) { case TENANT_ID: { - cells[i].set_int(tenant_id_); + cur_row_->cells_[i].set_int(sess_info.get_priv_tenant_id()); break; } case SVR_IP: { - cells[i].set_varchar(ipstr_); - cells[i].set_collation_type(default_collation); + cur_row_->cells_[i].set_varchar(ipstr_); + cur_row_->cells_[i].set_collation_type(default_collation); break; } case SVR_PORT: { - cells[i].set_int(port_); + cur_row_->cells_[i].set_int(port_); break; } case SADDR: { ObSqlString addr; ObString tmp_saddr; - OZ(addr.append_fmt("%lx", sess_info.addr)); + addr.append_fmt("%lx", reinterpret_cast(&sess_info)); OZ (ob_write_string(*allocator_, addr.string(), tmp_saddr)); // get last 8 char, for oracle compatiable int64_t offset = tmp_saddr.length() > 8 ? tmp_saddr.length() - 8 : 0; - ObString saddr(8, tmp_saddr.ptr() + offset); - cells[i].set_varchar(saddr); - cells[i].set_collation_type(default_collation); + // if tmp_saddr.length() - offset > 8, offset is 0 + // the length make sure (tmp_saddr.ptr() + offset) do not have out-of-bounds access + int64_t length = tmp_saddr.length() - offset > 8 ? 8 : tmp_saddr.length() - offset; + ObString saddr(length, tmp_saddr.ptr() + offset); + cur_row_->cells_[i].set_varchar(saddr); + cur_row_->cells_[i].set_collation_type(default_collation); break; } case SID: { - cells[i].set_int(sess_info.id); + cur_row_->cells_[i].set_int(sess_info.get_sessid()); break; } case USER_NAME: { - cells[i].set_varchar(sess_info.user_name); - cells[i].set_collation_type(default_collation); + cur_row_->cells_[i].set_varchar(sess_info.get_user_name()); + cur_row_->cells_[i].set_collation_type(default_collation); break; } - case ADDRESS: { // sql在plancache中的内存地址 - // ObSqlString saddr; - // saddr.append_fmt("%lx", reinterpret_cast(plan)); - // ObString addr; - // OZ (ob_write_string(*allocator_, saddr.string(), addr)); - // cells[i].set_raw(addr); - cells[i].set_null(); + case ADDRESS: { + // plan not set now + cur_row_->cells_[i].set_null(); break; } case HASH_VALUE: { - // cells[i].set_int(sess_info.id); - cells[i].set_null(); + // cur_row_->cells_[i].set_int(sess_info.id); + cur_row_->cells_[i].set_null(); break; } case SQL_ID: { - cells[i].set_varchar(sess_info.sql_id); - cells[i].set_collation_type(default_collation); + char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1]; + if (obmysql::COM_QUERY == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_EXECUTE == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_PREPARE == sess_info.get_mysql_cmd() || + obmysql::COM_STMT_PREXECUTE == sess_info.get_mysql_cmd()) { + sess_info.get_cur_sql_id(sql_id, OB_MAX_SQL_ID_LENGTH + 1); + } else { + sql_id[0] = '\0'; + } + cur_row_->cells_[i].set_varchar(ObString::make_string(sql_id)); + cur_row_->cells_[i].set_collation_type(default_collation); break; } case SQL_TEXT: { - cells[i].set_varchar(ObString(60, plan->stat_.raw_sql_.ptr())); - cells[i].set_collation_type(default_collation); + ObString sql = sess_info.get_current_query_string(); + int64_t len = 60 > sql.length() ? sql.length() : 60; + cur_row_->cells_[i].set_varchar(ObString(len, sql.ptr())); + cur_row_->cells_[i].set_collation_type(default_collation); break; } case LAST_SQL_ACTIVE_TIME: { - cells[i].set_datetime(plan->stat_.last_active_time_); + // session cursor not set now + cur_row_->cells_[i].set_timestamp(sess_info.get_query_start_time()); break; } case SQL_EXEC_ID: { - cells[i].set_null(); + cur_row_->cells_[i].set_null(); + break; + } + case CURSOR_TYPE: { + cur_row_->cells_[i].set_varchar("OPEN"); + cur_row_->cells_[i].set_collation_type(default_collation); + break; + } + case CHILD_ADDRESS: { + cur_row_->cells_[i].set_null(); + break; + } + case CON_ID: { + cur_row_->cells_[i].set_int(1); break; } default: { @@ -377,8 +404,54 @@ int ObVirtualOpenCursorTable::fill_cells_impl(const SessionInfo &sess_info, } } } + if (OB_UNLIKELY(OB_SUCCESS == ret && OB_SUCCESS != (ret = scanner_->add_row(*cur_row_)))) { + SERVER_LOG(WARN, "fail to add row", K(ret), K(*cur_row_)); + } return ret; } +void ObVirtualOpenCursorTable::FillScanner::reset() +{ + allocator_ = NULL; + scanner_ = NULL; + cur_row_ = NULL; + my_session_ = NULL; + output_column_ids_.reset(); + ipstr_.reset(); + port_ = 0; +} + +int ObVirtualOpenCursorTable::FillScanner::init(ObIAllocator *allocator, + common::ObScanner *scanner, + sql::ObSQLSessionInfo *session_info, + common::ObNewRow *cur_row, + const ObIArray &column_ids, + share::schema::ObSchemaGetterGuard* schema_guard, + common::ObString &ipstr, + uint32_t port) +{ + int ret = OB_SUCCESS; + if (OB_UNLIKELY(NULL == allocator + || NULL == scanner + || NULL == cur_row + || NULL == session_info)) { + ret = OB_NOT_INIT; + SERVER_LOG(WARN, + "some parameter is NULL", K(ret), K(allocator), K(scanner), K(cur_row), K(session_info)); + } else if (OB_FAIL(output_column_ids_.assign(column_ids))) { + SQL_ENG_LOG(WARN, "fail to assign output column ids", K(ret), K(column_ids)); + } else { + allocator_ = allocator; + scanner_ = scanner; + cur_row_ = cur_row; + my_session_ = session_info; + schema_guard_ = schema_guard; + ipstr_ = ipstr; + port_ = port; + } + return ret; +} + + } // namespace observer } // namespace oceanbase diff --git a/src/observer/virtual_table/ob_virtual_open_cursor_table.h b/src/observer/virtual_table/ob_virtual_open_cursor_table.h index d00e3cc0e..020c40e71 100644 --- a/src/observer/virtual_table/ob_virtual_open_cursor_table.h +++ b/src/observer/virtual_table/ob_virtual_open_cursor_table.h @@ -13,10 +13,26 @@ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_OPEN_CURSOR #define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_OPEN_CURSOR #include "share/ob_virtual_table_scanner_iterator.h" -#include "lib/hash/ob_hashmap.h" -#include "lib/container/ob_se_array.h" #include "sql/session/ob_sql_session_mgr.h" +/* __all_virtual_open_cursor + * The original implementation logic of open_cursor is: + * + * 1. lock each session and get cur_sql_id + * 2. get all plans through plan_cache, when the plan's sql_id == cur_sql_id, get the current plan, and get sql_text & last_active_time information + * + * the problem with this implementation is that: + * + * 1. when get a plan, since the current session is not locked, the risk is high + * 2. only sql_text & last_active_time information is read in the plan. These two values can be get on the session, and the cost of using the plan is relatively high + * + * new open_cursor implementation logic: + * + * 1. securely get session information through fore_each_session + * 2. referring to the show_processlist framework, put the results into the scanner for results, this framework is also conducive to subsequent expansion + * 3. cur_plan & session_cursor two kinds of information are currently recorded + */ + namespace oceanbase { namespace common @@ -46,91 +62,92 @@ class ObPlanCache; namespace observer { -class ObSessionOpenCursor { -public: - explicit ObSessionOpenCursor() {} - virtual ~ObSessionOpenCursor() {} - bool operator()(sql::ObSQLSessionMgr::Key key, sql::ObSQLSessionInfo *sess_info); -private: - DISALLOW_COPY_AND_ASSIGN(ObSessionOpenCursor); -}; class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { public: -struct SessionInfo { - uint32_t id; // session id - uint64_t addr; // session addr - ObString user_name; - ObString sql_id; // ob_max_sql_id_length; - bool is_valid() - { - return 0 != addr && 0 != id; - } - TO_STRING_KV(K(id), K(addr), K(user_name), K(sql_id)); -}; -typedef common::ObSEArray SessionInfoArray; -typedef common::hash::ObHashMap SidMap; -class ObEachSessionId { -public: - explicit ObEachSessionId(ObIAllocator *alloc): - is_success_(false), - allocator_(alloc) {} - virtual ~ObEachSessionId(){} - bool operator()(sql::ObSQLSessionMgr::Key key, sql::ObSQLSessionInfo *sess_info); - int init(int64_t sess_cnt, ObIAllocator *allocator); - void reset(); - inline SidMap &get_sid_maps() { return sids_map_; } -private: - SidMap sids_map_; - bool is_success_; - ObIAllocator *allocator_; - DISALLOW_COPY_AND_ASSIGN(ObEachSessionId); -}; ObVirtualOpenCursorTable(); virtual ~ObVirtualOpenCursorTable(); virtual int inner_get_next_row(common::ObNewRow *&row); virtual void reset(); - virtual int inner_open(); - void set_session_mgr(sql::ObSQLSessionMgr *sess_mgr) { sess_mgr_ = sess_mgr; } - void set_plan_cache_manager(sql::ObPlanCacheManager *pcm) { pcm_ = pcm; } - inline void set_tenant_id(uint64_t tid) { tenant_id_ = tid; } + void set_session_mgr(sql::ObSQLSessionMgr *sess_mgr) { session_mgr_ = sess_mgr; } int set_addr(const common::ObAddr &addr); -protected: - int fill_cells(ObNewRow *&row, bool &is_filled, sql::ObPlanCacheObject* cache_obj); - int fill_cells_impl(const SessionInfo &sess_info, const sql::ObPhysicalPlan *plan); + private: + // https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-OPEN_CURSOR.html enum { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, SVR_PORT, - SADDR, - SID, - USER_NAME, - ADDRESS, - HASH_VALUE, - SQL_ID, - SQL_TEXT, - LAST_SQL_ACTIVE_TIME, - SQL_EXEC_ID, + SADDR, // session point addr + SID, // session id + USER_NAME, // cur user name + ADDRESS, // now is null + HASH_VALUE, // now is null + SQL_ID, // sql id + SQL_TEXT, // sql text, only 60 + LAST_SQL_ACTIVE_TIME, // last sql active time + SQL_EXEC_ID, // now is null + CURSOR_TYPE, // cursor type, only support OPEN & SESSION CURSOR CACHED now + /* + * OPEN PL/SQL + * OPEN + * SESSION CURSOR CACHED + * OPEN-RECURSIVE + * DICTIONARY LOOKUP CURSOR CACHED + * BUNDLE DICTIONARY LOOKUP CACHED + * JAVA NAME TRANSLATION CURSOR CACHED + * REPLICATION TRIGGER CURSOR CACHED + * CONSTRAINTS CURSOR CACHED + * PL/SQL CURSOR CACHED + */ + CHILD_ADDRESS, // Address of the child cursor + CON_ID, // The ID of the container to which the data pertains, only support 1 now + }; + + class FillScanner + { + public: + FillScanner() + :allocator_(NULL), + scanner_(NULL), + cur_row_(NULL), + my_session_(NULL), + output_column_ids_() + {} + virtual ~FillScanner(){} + bool operator()(sql::ObSQLSessionMgr::Key key, sql::ObSQLSessionInfo* sess_info); + int fill_session_cursor_cell(sql::ObSQLSessionInfo &sess_info, + const int64_t cursor_id); + int fill_cur_plan_cell(sql::ObSQLSessionInfo &sess_info); + int init(ObIAllocator *allocator, + common::ObScanner *scanner, + sql::ObSQLSessionInfo * session_info, + common::ObNewRow *cur_row, + const ObIArray &column_ids, + share::schema::ObSchemaGetterGuard* schema_guard, + common::ObString &ipstr, + uint32_t port); + inline void reset(); + + private: + ObIAllocator *allocator_; + common::ObScanner *scanner_; + common::ObNewRow *cur_row_; + sql::ObSQLSessionInfo *my_session_; + share::schema::ObSchemaGetterGuard* schema_guard_; + ObSEArray output_column_ids_; + common::ObString ipstr_; + uint32_t port_; + DISALLOW_COPY_AND_ASSIGN(FillScanner); }; private: - sql::ObSQLSessionMgr *sess_mgr_; - sql::ObPlanCacheManager *pcm_; - common::ObSEArray plan_id_array_; - common::ObSEArray session_info_array_; - int64_t plan_id_array_idx_; - sql::ObPlanCache *plan_cache_; - const SessionInfoArray *sess_arr_; - int64_t sess_id_array_idx_; - ObEachSessionId oesid_; - uint64_t tenant_id_; + sql::ObSQLSessionMgr *session_mgr_; common::ObString ipstr_; uint32_t port_; - bool is_travs_sess_; - uint64_t plan_id_; + FillScanner fill_scanner_; DISALLOW_COPY_AND_ASSIGN(ObVirtualOpenCursorTable); }; // end ObVirtualOpenCursorTable } // end observer diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp index dcd9db546..be8f887bc 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp @@ -1984,8 +1984,6 @@ int ObVTIterCreator::create_vt_iter(ObVTableScanParam ¶ms, } else { open_cursors->set_allocator(&allocator); open_cursors->set_session_mgr(GCTX.session_mgr_); - open_cursors->set_plan_cache_manager(GCTX.sql_engine_->get_plan_cache_manager()); - open_cursors->set_tenant_id(real_tenant_id); OZ (open_cursors->set_addr(addr_)); OX (vt_iter = static_cast(open_cursors)); } diff --git a/src/pl/ob_pl_code_generator.cpp b/src/pl/ob_pl_code_generator.cpp index cf3ade26d..2a6c1b0ac 100644 --- a/src/pl/ob_pl_code_generator.cpp +++ b/src/pl/ob_pl_code_generator.cpp @@ -1185,7 +1185,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLForAllStmt &s) if (OB_SUCC(ret) && OB_NOT_NULL(generator_.get_current().get_v())) { const ObPLForLoopStmt& for_loop = static_cast(s); if (OB_NOT_NULL(s.get_sql_stmt()) && !s.get_save_exception()) { - ObLLVMValue lower, upper, lower_obj, upper_obj, p_index_obj; + ObLLVMValue lower, upper, lower_obj, upper_obj, p_index_obj, count; ObLLVMValue ret_err, is_need_rollback; ObLLVMType ir_type; ObLLVMBasicBlock illegal_block, after_block, rollback_block, not_rollback_block; @@ -1201,7 +1201,9 @@ int ObPLCodeGenerateVisitor::visit(const ObPLForAllStmt &s) OZ (generator_.get_helper().create_alloca(var->get_name(), ir_type, p_index_obj)); OX (generator_.get_vars().at(s.get_ident() + generator_.USER_ARG_OFFSET) = p_index_obj); OZ (generator_.generate_bound_and_check(s, true, lower, upper, lower_obj, upper_obj, illegal_block)); - OZ (generator_.generate_sql(*(s.get_sql_stmt()), ret_err)); + OZ (generator_.get_helper().create_sub(upper, lower, count)); + OZ (generator_.get_helper().create_inc(count, count)); + OZ (generator_.generate_sql(*(s.get_sql_stmt()), ret_err, count)); OZ (generator_.get_helper().create_icmp_eq(ret_err, OB_BATCHED_MULTI_STMT_ROLLBACK, is_need_rollback)); OZ (generator_.get_helper().create_cond_br(is_need_rollback, rollback_block, not_rollback_block)); OZ (generator_.set_current(not_rollback_block)); @@ -1558,8 +1560,9 @@ int ObPLCodeGenerateVisitor::visit(const ObPLSqlStmt &s) } else if (OB_FAIL(generator_.generate_goto_label(s))) { LOG_WARN("failed to generate goto label", K(ret)); } else { - ObLLVMValue ret_err; - OZ (generator_.generate_sql(s, ret_err)); + ObLLVMValue ret_err, count; + OZ (generator_.get_helper().get_int32(0, count)); + OZ (generator_.generate_sql(s, ret_err, count)); OZ (generator_.generate_after_sql(s, ret_err)); } return ret; @@ -2633,9 +2636,8 @@ int ObPLCodeGenerateVisitor::visit(const ObPLFetchStmt &s) ret_err))) { LOG_WARN("failed to generate fetch", K(ret)); } else if (lib::is_mysql_mode()) { //Mysql模式直接检查抛出异常 - if (OB_FAIL(generator_.check_success(ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning()))) { - LOG_WARN("failed to check success", K(ret)); - } + OZ (generator_.check_success( + ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning(), true)); } else { //Oracle模式如果是OB_READ_NOTHING错误,吞掉异常不抛出 ObLLVMValue is_not_found; ObLLVMBasicBlock fetch_end; @@ -3357,6 +3359,8 @@ int ObPLCodeGenerator::init_spi_service() LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(bool_type))) { LOG_WARN("push_back error", K(ret)); + } else if (OB_FAIL(arg_types.push_back(int32_type))) { + LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(ObLLVMFunctionType::get(int32_type, arg_types, ft))) { LOG_WARN("failed to get function type", K(ret)); } else if (OB_FAIL(helper_.create_function(ObString("spi_execute"), ft, spi_service_.spi_execute_))) { @@ -4937,7 +4941,7 @@ int ObPLCodeGenerator::generate_bound_and_check(const ObPLForLoopStmt &s, return ret; } -int ObPLCodeGenerator::generate_sql(const ObPLSqlStmt &s, ObLLVMValue &ret_err) +int ObPLCodeGenerator::generate_sql(const ObPLSqlStmt &s, ObLLVMValue &ret_err, ObLLVMValue &array_bind_count) { int ret = OB_SUCCESS; if (OB_ISNULL(get_current().get_v())) { @@ -5015,6 +5019,7 @@ int ObPLCodeGenerator::generate_sql(const ObPLSqlStmt &s, ObLLVMValue &ret_err) ObLLVMValue is_forall; OZ (get_helper().get_int8(static_cast(s.is_forall_sql()), is_forall)); OZ (args.push_back(is_forall)); + OZ (args.push_back(array_bind_count)); OZ (get_helper().create_call(ObString("spi_execute"), get_spi_service().spi_execute_, args, ret_err)); } } @@ -6612,7 +6617,7 @@ int ObPLCodeGenerator::raise_exception(ObLLVMValue &exception, return ret; } int ObPLCodeGenerator::check_success(jit::ObLLVMValue &ret_err, int64_t stmt_id, - bool in_notfound, bool in_warning) + bool in_notfound, bool in_warning, bool signal) { int ret = OB_SUCCESS; if (OB_FAIL(helper_.set_insert_point(get_current()))) { @@ -6694,7 +6699,7 @@ int ObPLCodeGenerator::check_success(jit::ObLLVMValue &ret_err, int64_t stmt_id, LOG_WARN("failed to create_load", K(ret)); } else if (OB_FAIL(helper_.create_load(ObString("load_str_len"), str_len_ptr, str_len))) { LOG_WARN("failed to create_load", K(ret)); - } else if (OB_FAIL(generate_exception(type, ret_err, error_code, sql_state, str_len, stmt_id_value, success_branch, line_number_value, in_notfound, in_warning, false/*not signal*/))) { + } else if (OB_FAIL(generate_exception(type, ret_err, error_code, sql_state, str_len, stmt_id_value, success_branch, line_number_value, in_notfound, in_warning, signal))) { LOG_WARN("failed to generate exception", K(ret)); } else if (OB_FAIL(set_current(success_branch))) { LOG_WARN("failed to set_current", K(ret)); diff --git a/src/pl/ob_pl_code_generator.h b/src/pl/ob_pl_code_generator.h index b6c8540a9..d3de81cc7 100644 --- a/src/pl/ob_pl_code_generator.h +++ b/src/pl/ob_pl_code_generator.h @@ -311,13 +311,14 @@ public: jit::ObLLVMValue &upper_value, jit::ObLLVMValue &is_true); - int generate_sql(const ObPLSqlStmt &s, jit::ObLLVMValue &ret_err); + int generate_sql(const ObPLSqlStmt &s, jit::ObLLVMValue &ret_err, jit::ObLLVMValue &array_bind_count); int generate_after_sql(const ObPLSqlStmt &s, jit::ObLLVMValue &ret_err); int generate_new_objparam(jit::ObLLVMValue &result, int64_t udt_id = OB_INVALID_ID); int check_success(jit::ObLLVMValue &ret_err, int64_t stmt_id = OB_INVALID_ID, bool in_notfound = false, - bool in_warning = false); + bool in_warning = false, + bool signal = false); int finish_current(const jit::ObLLVMBasicBlock &next); jit::ObLLVMValue stack_save(); void stack_restore(jit::ObLLVMValue &stack); diff --git a/src/pl/ob_pl_resolver.cpp b/src/pl/ob_pl_resolver.cpp index 54c3decbe..cbd129e4c 100644 --- a/src/pl/ob_pl_resolver.cpp +++ b/src/pl/ob_pl_resolver.cpp @@ -3615,6 +3615,7 @@ int ObPLResolver::check_raw_expr_in_forall(ObRawExpr* expr, int64_t idx, bool &n ret = OB_ERR_FORALL_ITER_NOT_ALLOWED; LOG_WARN("PLS-00430: FORALL iteration variable INDX is not allowed in this context", K(ret)); } + //这里控制包含非数组类型变量的forall语句直接以forloop实现, 避免forall先回退, 再forloop执行 can_array_binding = false; } else { bool inner_modify = false; diff --git a/src/rootserver/backup/ob_backup_clean_task_mgr.cpp b/src/rootserver/backup/ob_backup_clean_task_mgr.cpp index 8ce499c12..5f0f28c6e 100644 --- a/src/rootserver/backup/ob_backup_clean_task_mgr.cpp +++ b/src/rootserver/backup/ob_backup_clean_task_mgr.cpp @@ -805,16 +805,19 @@ int ObBackupCleanTaskMgr::delete_backup_set_inner_placeholder_() int ret = OB_SUCCESS; ObBackupPath path; ObBackupSetDesc desc; - share::ObBackupDest backup_set_dest; desc.backup_set_id_ = backup_set_info_.backup_set_id_; desc.backup_type_ = backup_set_info_.backup_type_; - if (OB_FAIL(ObBackupPathUtil::construct_backup_set_dest(backup_dest_, desc, backup_set_dest))) { - LOG_WARN("fail to construct backup set dest", K(ret)); - } else if (OB_FAIL(ObBackupPathUtil::get_backup_set_inner_placeholder( - backup_set_dest, desc, backup_set_info_.start_replay_scn_, backup_set_info_.min_restore_scn_, path))) { - LOG_WARN("failed to get backup set end placeholder path", K(ret)); - } else if (OB_FAIL(share::ObBackupCleanUtil::delete_backup_file(path, backup_dest_.get_storage_info()))) { - LOG_WARN("failed to delete backup file", K(ret), K(task_attr_), K(path)); + char placeholder_prefix[OB_MAX_BACKUP_CHECK_FILE_NAME_LENGTH] = { 0 }; + ObBackupIoAdapter util; + ObBackupPrefixDeleteFileOp prefix_delete_op; + if (OB_FAIL(ObBackupPathUtil::get_backup_set_dir_path(backup_dest_, desc, path))) { + LOG_WARN("failed to get tenant data backup set dir", K(ret), K_(backup_dest)); + } else if (OB_FAIL(ObBackupPathUtil::get_backup_set_inner_placeholder_prefix(desc, placeholder_prefix, sizeof(placeholder_prefix)))) { + LOG_WARN("failed to get backup set inner placeholder prefix", K(ret)); + } else if (OB_FAIL(prefix_delete_op.init(placeholder_prefix, strlen(placeholder_prefix), path, backup_dest_.get_storage_info()))) { + LOG_WARN("failed to init prefix delete", K(ret), K(placeholder_prefix)); + } else if (OB_FAIL(util.list_files(path.get_obstr(), backup_dest_.get_storage_info(), prefix_delete_op))) { + LOG_WARN("failed to list files", K(ret), K(path), K(placeholder_prefix)); } return ret; } diff --git a/src/rootserver/backup/ob_backup_data_scheduler.cpp b/src/rootserver/backup/ob_backup_data_scheduler.cpp index 9661c380e..7e7711bde 100644 --- a/src/rootserver/backup/ob_backup_data_scheduler.cpp +++ b/src/rootserver/backup/ob_backup_data_scheduler.cpp @@ -621,7 +621,8 @@ int ObBackupDataScheduler::start_tenant_backup_data_(const ObBackupJobAttr &job_ LOG_WARN("[DATA_BACKUP]failed to update backup type", K(ret), K(new_job_attr)); } else if (OB_FAIL(new_job_attr.executor_tenant_id_.push_back(new_job_attr.tenant_id_))) { LOG_WARN("[DATA_BACKUP]failed to push back tenant id", K(ret)); - } else if (OB_FALSE_IT(new_job_attr.initiator_job_id_ = new_job_attr.job_id_)) { + } else if (OB_FALSE_IT(new_job_attr.initiator_job_id_ = new_job_attr.tenant_id_ == new_job_attr.initiator_tenant_id_ ? + 0/*no parent job*/ : new_job_attr.initiator_job_id_)) { } else if (OB_FAIL(lease_service_->check_lease())) { LOG_WARN("fail to check leader", K(ret)); } else if (OB_FAIL(ObBackupJobOperator::insert_job(trans, new_job_attr))) { diff --git a/src/rootserver/backup/ob_tenant_archive_scheduler.cpp b/src/rootserver/backup/ob_tenant_archive_scheduler.cpp index a15468ff2..31d0cfc2c 100644 --- a/src/rootserver/backup/ob_tenant_archive_scheduler.cpp +++ b/src/rootserver/backup/ob_tenant_archive_scheduler.cpp @@ -26,6 +26,7 @@ #include "share/backup/ob_backup_connectivity.h" #include "share/ls/ob_ls_i_life_manager.h" #include "logservice/palf/scn.h" +#include "share/ob_debug_sync.h" using namespace oceanbase; using namespace rootserver; @@ -586,14 +587,20 @@ int ObArchiveHandler::checkpoint_(ObTenantArchiveRoundAttr &round_info) case ObArchiveRoundState::Status::INTERRUPTED: break; case ObArchiveRoundState::Status::PREPARE: { + DEBUG_SYNC(BEFROE_LOG_ARCHIVE_SCHEDULE_PREPARE); if (OB_FAIL(start_archive_(round_info))) { LOG_WARN("failed to prepare archive", K(ret), K(round_info)); } } break; - case ObArchiveRoundState::Status::BEGINNING: - case ObArchiveRoundState::Status::DOING: + case ObArchiveRoundState::Status::BEGINNING: { + DEBUG_SYNC(BEFROE_LOG_ARCHIVE_SCHEDULE_BEGINNING); + } + case ObArchiveRoundState::Status::DOING: { + DEBUG_SYNC(BEFROE_LOG_ARCHIVE_SCHEDULE_DOING); + } case ObArchiveRoundState::Status::STOPPING: { + DEBUG_SYNC(BEFROE_LOG_ARCHIVE_SCHEDULE_STOPPING); if (OB_FAIL(do_checkpoint_(round_info))) { LOG_WARN("failed to checkpoint", K(ret), K(round_info)); } diff --git a/src/rootserver/ddl_task/ob_column_redefinition_task.cpp b/src/rootserver/ddl_task/ob_column_redefinition_task.cpp index e725a118f..a09c821eb 100644 --- a/src/rootserver/ddl_task/ob_column_redefinition_task.cpp +++ b/src/rootserver/ddl_task/ob_column_redefinition_task.cpp @@ -120,7 +120,7 @@ int ObColumnRedefinitionTask::wait_data_complement(const ObDDLTaskStatus next_ta DEBUG_SYNC(COLUMN_REDEFINITION_REPLICA_BUILD); if (is_build_replica_end) { ret = complete_sstable_job_ret_code_; - if (OB_SUCC(ret) && OB_FAIL(check_data_dest_tables_columns_checksum())) { + if (OB_SUCC(ret) && OB_FAIL(check_data_dest_tables_columns_checksum(1/*execution_id*/))) { LOG_WARN("fail to check the columns checkum between data table and hidden one", K(ret)); } if (OB_FAIL(switch_status(next_task_status, ret))) { @@ -139,6 +139,7 @@ int ObColumnRedefinitionTask::send_build_single_replica_request() ret = OB_NOT_INIT; LOG_WARN("ObColumnRedefinitionTask has not been inited", K(ret)); } else { + redefinition_execution_id_ = ObTimeUtility::fast_current_time(); ObDDLSingleReplicaExecutorParam param; param.tenant_id_ = tenant_id_; param.type_ = task_type_; @@ -148,6 +149,7 @@ int ObColumnRedefinitionTask::send_build_single_replica_request() param.snapshot_version_ = snapshot_version_; param.task_id_ = task_id_; param.parallelism_ = alter_table_arg_.parallelism_; + param.execution_id_ = redefinition_execution_id_; if (OB_FAIL(ObDDLUtil::get_tablets(tenant_id_, object_id_, param.source_tablet_ids_))) { LOG_WARN("fail to get tablets", K(ret), K(tenant_id_), K(object_id_)); } else if (OB_FAIL(ObDDLUtil::get_tablets(tenant_id_, target_object_id_, param.dest_tablet_ids_))) { @@ -183,7 +185,10 @@ int ObColumnRedefinitionTask::check_build_single_replica(bool &is_end) } // update sstable complement status for all leaders -int ObColumnRedefinitionTask::update_complete_sstable_job_status(const common::ObTabletID &tablet_id, const int64_t snapshot_version, const int ret_code) +int ObColumnRedefinitionTask::update_complete_sstable_job_status(const common::ObTabletID &tablet_id, + const int64_t snapshot_version, + const int64_t execution_id, + const int ret_code) { int ret = OB_SUCCESS; if (OB_UNLIKELY(!is_inited_)) { @@ -194,6 +199,8 @@ int ObColumnRedefinitionTask::update_complete_sstable_job_status(const common::O } else if (snapshot_version != snapshot_version_) { ret = OB_ERR_UNEXPECTED; LOG_WARN("snapshot version not match", K(ret), K(snapshot_version), K(snapshot_version_)); + } else if (execution_id != redefinition_execution_id_) { + LOG_INFO("receive a mismatch execution result, ignore", K(execution_id), K(redefinition_execution_id_)); } else if (OB_FAIL(replica_builder_.set_partition_task_status(tablet_id, ret_code))) { LOG_WARN("fail to set partition task status", K(ret)); } diff --git a/src/rootserver/ddl_task/ob_column_redefinition_task.h b/src/rootserver/ddl_task/ob_column_redefinition_task.h index 8284c9fdc..3a329142f 100644 --- a/src/rootserver/ddl_task/ob_column_redefinition_task.h +++ b/src/rootserver/ddl_task/ob_column_redefinition_task.h @@ -44,6 +44,7 @@ public: virtual int update_complete_sstable_job_status( const common::ObTabletID &tablet_id, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code) override; private: int wait_data_complement(const share::ObDDLTaskStatus next_task_status); diff --git a/src/rootserver/ddl_task/ob_constraint_task.cpp b/src/rootserver/ddl_task/ob_constraint_task.cpp index 019131751..135d79ab5 100644 --- a/src/rootserver/ddl_task/ob_constraint_task.cpp +++ b/src/rootserver/ddl_task/ob_constraint_task.cpp @@ -44,33 +44,18 @@ ObCheckConstraintValidationTask::ObCheckConstraintValidationTask( } int ObCheckConstraintValidationTask::process() -{ - int ret = OB_SUCCESS; - int tmp_ret = OB_SUCCESS; - ObRootService *root_service = GCTX.root_service_; - if (OB_ISNULL(root_service)) { - ret = OB_ERR_SYS; - LOG_WARN("error sys, root service must not be nullptr", K(ret)); - } else { - ObTabletID unused_tablet_id; - ObDDLTaskKey task_key(target_object_id_, schema_version_); - ret = ObDDLUtil::retry_with_ddl_schema_hint([this]() -> int { return this->check_constraint_by_send_sql(); }); - if (OB_SUCCESS != (tmp_ret = root_service->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, 1L/*unused snapshot version*/, ret))) { - LOG_WARN("fail to finish check constraint task", K(ret), K(tmp_ret)); - } - } - return ret; -} - -int ObCheckConstraintValidationTask::check_constraint_by_send_sql() const { int ret = OB_SUCCESS; ObTraceIdGuard trace_id_guard(trace_id_); + ObRootService *root_service = GCTX.root_service_; const ObConstraint *constraint = nullptr; bool is_oracle_mode = false; ObSchemaGetterGuard schema_guard; const ObTableSchema *table_schema = nullptr; const ObDatabaseSchema *database_schema = nullptr; + int tmp_ret = OB_SUCCESS; + ObTabletID unused_tablet_id; + ObDDLTaskKey task_key(target_object_id_, schema_version_); if (OB_FAIL(ObMultiVersionSchemaService::get_instance().get_tenant_schema_guard(tenant_id_, schema_guard))) { LOG_WARN("get tenant schema guard failed", K(ret), K(tenant_id_)); } else if (OB_FAIL(schema_guard.get_table_schema(tenant_id_, data_table_id_, table_schema))) { @@ -78,6 +63,9 @@ int ObCheckConstraintValidationTask::check_constraint_by_send_sql() const } else if (OB_ISNULL(table_schema)) { ret = OB_TABLE_NOT_EXIST; LOG_WARN("table schema not exist", K(ret)); + } else if (OB_ISNULL(root_service)) { + ret = OB_ERR_SYS; + LOG_WARN("error sys, root service must not be nullptr", K(ret)); } else if (!check_table_empty_ && OB_ISNULL(constraint = table_schema->get_constraint(constraint_id_))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("error unexpected, can not get constraint", K(ret)); @@ -159,6 +147,9 @@ int ObCheckConstraintValidationTask::check_constraint_by_send_sql() const } } } + if (OB_SUCCESS != (tmp_ret = root_service->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, 1L/*unused snapshot version*/, 1L/*unused execution id*/, ret))) { + LOG_WARN("fail to finish check constraint task", K(ret), K(tmp_ret)); + } return ret; } @@ -199,8 +190,10 @@ int ObForeignKeyConstraintValidationTask::process() ObTabletID unused_tablet_id; ObDDLTaskKey task_key(foregin_key_id_, schema_version_); int tmp_ret = OB_SUCCESS; - ret = ObDDLUtil::retry_with_ddl_schema_hint([this]() -> int { return this->check_fk_by_send_sql(); }); - if (OB_SUCCESS != (tmp_ret = root_service->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, 1L/*unused snapshot version*/, ret))) { + if (OB_FAIL(check_fk_by_send_sql())) { + LOG_WARN("failed to check fk", K(ret)); + } + if (OB_SUCCESS != (tmp_ret = root_service->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, 1L/*unused snapshot version*/, 1L/*unused execution id*/, ret))) { LOG_WARN("fail to finish check constraint task", K(ret)); } LOG_INFO("execute check foreign key task finish", K(ret), K(task_key), K(data_table_id_), K(foregin_key_id_)); diff --git a/src/rootserver/ddl_task/ob_constraint_task.h b/src/rootserver/ddl_task/ob_constraint_task.h index 80e65dc49..cd096e389 100644 --- a/src/rootserver/ddl_task/ob_constraint_task.h +++ b/src/rootserver/ddl_task/ob_constraint_task.h @@ -37,9 +37,6 @@ public: virtual int process() override; virtual int64_t get_deep_copy_size() const override { return sizeof(*this); } virtual ObAsyncTask *deep_copy(char *buf, const int64_t buf_size) const override; -private: - int check_constraint_by_send_sql() const; - int rollback_change(); private: uint64_t tenant_id_; int64_t data_table_id_; diff --git a/src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp b/src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp index 632880f00..7eba4e5a3 100644 --- a/src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp +++ b/src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp @@ -39,6 +39,7 @@ ObDDLRedefinitionSSTableBuildTask::ObDDLRedefinitionSSTableBuildTask( const int64_t dest_table_id, const int64_t schema_version, const int64_t snapshot_version, + const int64_t execution_id, const ObSQLMode &sql_mode, const common::ObCurTraceId::TraceId &trace_id, const int64_t parallelism, @@ -46,7 +47,7 @@ ObDDLRedefinitionSSTableBuildTask::ObDDLRedefinitionSSTableBuildTask( ObRootService *root_service) : is_inited_(false), tenant_id_(tenant_id), task_id_(task_id), data_table_id_(data_table_id), dest_table_id_(dest_table_id), schema_version_(schema_version), snapshot_version_(snapshot_version), - sql_mode_(sql_mode), trace_id_(trace_id), parallelism_(parallelism), + execution_id_(execution_id), sql_mode_(sql_mode), trace_id_(trace_id), parallelism_(parallelism), use_heap_table_ddl_plan_(use_heap_table_ddl_plan), root_service_(root_service) { set_retry_times(0); // do not retry @@ -103,6 +104,8 @@ int ObDDLRedefinitionSSTableBuildTask::process() dest_table_id_, schema_version_, snapshot_version_, + execution_id_, + task_id_, parallelism_, use_heap_table_ddl_plan_, false/*use_schema_version_hint_for_src_table*/, @@ -141,7 +144,7 @@ int ObDDLRedefinitionSSTableBuildTask::process() } } } - if (OB_SUCCESS != (tmp_ret = root_service_->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, snapshot_version_, ret))) { + if (OB_SUCCESS != (tmp_ret = root_service_->get_ddl_scheduler().on_sstable_complement_job_reply(unused_tablet_id, task_key, snapshot_version_, execution_id_, ret))) { LOG_WARN("fail to finish sstable complement", K(ret)); } return ret; @@ -165,6 +168,7 @@ ObAsyncTask *ObDDLRedefinitionSSTableBuildTask::deep_copy(char *buf, const int64 dest_table_id_, schema_version_, snapshot_version_, + execution_id_, sql_mode_, trace_id_, parallelism_, @@ -551,7 +555,7 @@ int ObDDLRedefinitionTask::get_validate_checksum_columns_id(const ObTableSchema return ret; } -int ObDDLRedefinitionTask::check_data_dest_tables_columns_checksum() +int ObDDLRedefinitionTask::check_data_dest_tables_columns_checksum(const int64_t execution_id) { int ret = OB_SUCCESS; ObSchemaGetterGuard schema_guard; @@ -583,16 +587,16 @@ int ObDDLRedefinitionTask::check_data_dest_tables_columns_checksum() LOG_WARN("fail to create datatable column checksum map", K(ret)); } else if (OB_FAIL(dest_table_column_checksums.create(OB_MAX_COLUMN_NUMBER / 2, ObModIds::OB_CHECKSUM_CHECKER))) { LOG_WARN("fail to create desttable column checksum map", K(ret)); - } else if (OB_UNLIKELY(OB_INVALID_ID == schema_version_ || OB_INVALID_ID == object_id_ || !data_table_column_checksums.created())) { + } else if (OB_UNLIKELY(0 > execution_id || OB_INVALID_ID == object_id_ || !data_table_column_checksums.created())) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), "data_table_execution_id", schema_version_, K(object_id_), K(data_table_column_checksums.created())); + LOG_WARN("invalid argument", K(ret), K(execution_id), K(object_id_), K(data_table_column_checksums.created())); } else if (OB_UNLIKELY(OB_INVALID_ID == target_object_id_ || !dest_table_column_checksums.created())) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), "dest_table_execution_id", schema_version_, "dest_table_id", target_object_id_, K(dest_table_column_checksums.created())); - } else if (OB_FAIL(ObDDLChecksumOperator::get_table_column_checksum(tenant_id_, schema_version_, object_id_, data_table_column_checksums, GCTX.root_service_->get_sql_proxy()))) { - LOG_WARN("fail to get table column checksum", K(ret), K(schema_version_), "table_id", object_id_, K(data_table_column_checksums.created()), KP(GCTX.root_service_)); - } else if (OB_FAIL(ObDDLChecksumOperator::get_table_column_checksum(tenant_id_, schema_version_, target_object_id_, dest_table_column_checksums, GCTX.root_service_->get_sql_proxy()))) { - LOG_WARN("fail to get table column checksum", K(ret), "dest_table_execution_id", schema_version_, "table_id", target_object_id_, K(dest_table_column_checksums.created()), KP(GCTX.root_service_)); + LOG_WARN("invalid argument", K(ret), "dest_table_id", target_object_id_, K(dest_table_column_checksums.created())); + } else if (OB_FAIL(ObDDLChecksumOperator::get_table_column_checksum(tenant_id_, execution_id, object_id_, task_id_, data_table_column_checksums, GCTX.root_service_->get_sql_proxy()))) { + LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), "table_id", object_id_, K_(task_id), K(data_table_column_checksums.created()), KP(GCTX.root_service_)); + } else if (OB_FAIL(ObDDLChecksumOperator::get_table_column_checksum(tenant_id_, execution_id, target_object_id_, task_id_, dest_table_column_checksums, GCTX.root_service_->get_sql_proxy()))) { + LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), "table_id", target_object_id_, K_(task_id), K(dest_table_column_checksums.created()), KP(GCTX.root_service_)); } else { uint64_t dest_column_id = 0; for (hash::ObHashMap::const_iterator iter = data_table_column_checksums.begin(); diff --git a/src/rootserver/ddl_task/ob_ddl_redefinition_task.h b/src/rootserver/ddl_task/ob_ddl_redefinition_task.h index 465cdf7a4..1b1a26ae2 100644 --- a/src/rootserver/ddl_task/ob_ddl_redefinition_task.h +++ b/src/rootserver/ddl_task/ob_ddl_redefinition_task.h @@ -31,6 +31,7 @@ public: const int64_t dest_table_id, const int64_t schema_version, const int64_t snapshot_version, + const int64_t execution_id, const ObSQLMode &sql_mode, const common::ObCurTraceId::TraceId &trace_id, const int64_t parallelism, @@ -52,6 +53,7 @@ private: int64_t dest_table_id_; int64_t schema_version_; int64_t snapshot_version_; + int64_t execution_id_; ObSQLMode sql_mode_; ObTimeZoneInfoWrap tz_info_wrap_; share::ObColumnNameMap col_name_map_; @@ -112,6 +114,7 @@ public: virtual int update_complete_sstable_job_status( const common::ObTabletID &tablet_id, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code) = 0; int on_child_task_finish( const ObDDLTaskKey &child_task_key, @@ -133,7 +136,7 @@ protected: const share::schema::ObTableSchema &data_table_schema, const share::schema::ObTableSchema &dest_table_schema, common::hash::ObHashMap &validate_checksum_column_ids); - int check_data_dest_tables_columns_checksum(); + int check_data_dest_tables_columns_checksum(const int64_t execution_id); int unlock_table(); int fail(); int success(); @@ -214,6 +217,7 @@ protected: int64_t update_autoinc_job_time_; int64_t check_table_empty_job_ret_code_; int64_t check_table_empty_job_time_; + int64_t redefinition_execution_id_; }; } // end namespace rootserver diff --git a/src/rootserver/ddl_task/ob_ddl_scheduler.cpp b/src/rootserver/ddl_task/ob_ddl_scheduler.cpp index c318928d3..6a008411e 100644 --- a/src/rootserver/ddl_task/ob_ddl_scheduler.cpp +++ b/src/rootserver/ddl_task/ob_ddl_scheduler.cpp @@ -335,7 +335,7 @@ void ObDDLScheduler::run1() } else { ObCurTraceId::set(task->get_trace_id()); task->process(); - if (task->need_retry()) { + if (task->need_retry() && !has_set_stop()) { if (OB_FAIL(task_queue_.add_task_to_last(task))) { STORAGE_LOG(ERROR, "fail to add task to last, which should not happen", K(ret), K(*task)); } @@ -1302,15 +1302,16 @@ int ObDDLScheduler::on_sstable_complement_job_reply( const common::ObTabletID &tablet_id, const ObDDLTaskKey &task_key, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code) { int ret = OB_SUCCESS; if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); - } else if (OB_UNLIKELY(!(task_key.is_valid() && snapshot_version > 0))) { + } else if (OB_UNLIKELY(!(task_key.is_valid() && snapshot_version > 0 && execution_id > 0))) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(task_key), K(snapshot_version), K(ret_code)); + LOG_WARN("invalid argument", K(ret), K(task_key), K(snapshot_version), K(execution_id), K(ret_code)); } else { ObDDLTask *ddl_task = nullptr; if (OB_FAIL(task_queue_.get_task(task_key, ddl_task))) { @@ -1324,12 +1325,12 @@ int ObDDLScheduler::on_sstable_complement_job_reply( const int64_t task_type = ddl_task->get_task_type(); switch (task_type) { case ObDDLType::DDL_CREATE_INDEX: - if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, ret_code))) { + if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, execution_id, ret_code))) { LOG_WARN("update complete sstable job status failed", K(ret)); } break; case ObDDLType::DDL_DROP_PRIMARY_KEY: - if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, ret_code))) { + if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, execution_id, ret_code))) { LOG_WARN("update complete sstable job status", K(ret)); } break; @@ -1339,7 +1340,7 @@ int ObDDLScheduler::on_sstable_complement_job_reply( case ObDDLType::DDL_MODIFY_COLUMN: case ObDDLType::DDL_CONVERT_TO_CHARACTER: case ObDDLType::DDL_TABLE_REDEFINITION: - if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, ret_code))) { + if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, execution_id, ret_code))) { LOG_WARN("update complete sstable job status", K(ret)); } break; @@ -1353,7 +1354,7 @@ int ObDDLScheduler::on_sstable_complement_job_reply( case ObDDLType::DDL_DROP_COLUMN: case ObDDLType::DDL_ADD_COLUMN_OFFLINE: case ObDDLType::DDL_COLUMN_REDEFINITION: - if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, ret_code))) { + if (OB_FAIL(static_cast(ddl_task)->update_complete_sstable_job_status(tablet_id, snapshot_version, execution_id, ret_code))) { LOG_WARN("update complete sstable job status", K(ret), K(tablet_id), K(snapshot_version), K(ret_code)); } break; diff --git a/src/rootserver/ddl_task/ob_ddl_scheduler.h b/src/rootserver/ddl_task/ob_ddl_scheduler.h index 97b42f5c1..17571eed7 100644 --- a/src/rootserver/ddl_task/ob_ddl_scheduler.h +++ b/src/rootserver/ddl_task/ob_ddl_scheduler.h @@ -113,6 +113,7 @@ public: const common::ObTabletID &tablet_id, const ObDDLTaskKey &task_key, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code); int on_ddl_task_finish( diff --git a/src/rootserver/ddl_task/ob_ddl_single_replica_executor.cpp b/src/rootserver/ddl_task/ob_ddl_single_replica_executor.cpp index 74813272e..c6df7bad5 100644 --- a/src/rootserver/ddl_task/ob_ddl_single_replica_executor.cpp +++ b/src/rootserver/ddl_task/ob_ddl_single_replica_executor.cpp @@ -42,6 +42,7 @@ int ObDDLSingleReplicaExecutor::build(const ObDDLSingleReplicaExecutorParam &par schema_version_ = param.schema_version_; snapshot_version_ = param.snapshot_version_; task_id_ = param.task_id_; + execution_id_ = param.execution_id_; parallelism_ = param.parallelism_; common::ObIArray &build_infos = partition_build_stat_; @@ -113,6 +114,7 @@ int ObDDLSingleReplicaExecutor::schedule_task() arg.ddl_type_ = type_; arg.task_id_ = task_id_; arg.parallelism_ = parallelism_; + arg.execution_id_ = execution_id_; if (OB_FAIL(location_service->get(tenant_id_, arg.source_tablet_id_, expire_renew_time, is_cache_hit, ls_id))) { LOG_WARN("get ls failed", K(ret), K(arg.source_tablet_id_)); diff --git a/src/rootserver/ddl_task/ob_ddl_single_replica_executor.h b/src/rootserver/ddl_task/ob_ddl_single_replica_executor.h index 2e6809831..b3e8fec92 100644 --- a/src/rootserver/ddl_task/ob_ddl_single_replica_executor.h +++ b/src/rootserver/ddl_task/ob_ddl_single_replica_executor.h @@ -35,18 +35,19 @@ public: schema_version_(0), snapshot_version_(0), task_id_(0), - parallelism_(0) + parallelism_(0), + execution_id_(0) {} ~ObDDLSingleReplicaExecutorParam() = default; bool is_valid() const { return common::OB_INVALID_TENANT_ID != tenant_id_ && share::DDL_INVALID != type_ && source_tablet_ids_.count() > 0 && dest_tablet_ids_.count() > 0 && common::OB_INVALID_ID != source_table_id_ && common::OB_INVALID_ID != dest_table_id_ - && schema_version_ > 0 && snapshot_version_ > 0 && task_id_ > 0; + && schema_version_ > 0 && snapshot_version_ > 0 && task_id_ > 0 && execution_id_ > 0; } TO_STRING_KV(K_(tenant_id), K_(type), K_(source_tablet_ids), K_(dest_tablet_ids), K_(source_table_id), K_(dest_table_id), K_(schema_version), - K_(snapshot_version), K_(task_id), K_(parallelism)); + K_(snapshot_version), K_(task_id), K_(parallelism), K_(execution_id)); public: uint64_t tenant_id_; share::ObDDLType type_; @@ -58,6 +59,7 @@ public: int64_t snapshot_version_; int64_t task_id_; int64_t parallelism_; + int64_t execution_id_; }; class ObDDLSingleReplicaExecutor @@ -100,6 +102,7 @@ private: int64_t snapshot_version_; int64_t task_id_; int64_t parallelism_; + int64_t execution_id_; common::ObArray partition_build_stat_; common::ObSpinLock lock_; }; diff --git a/src/rootserver/ddl_task/ob_index_build_task.cpp b/src/rootserver/ddl_task/ob_index_build_task.cpp index 3aaf87495..86afcaf80 100644 --- a/src/rootserver/ddl_task/ob_index_build_task.cpp +++ b/src/rootserver/ddl_task/ob_index_build_task.cpp @@ -28,21 +28,6 @@ using namespace oceanbase::share::schema; using namespace oceanbase::sql; int ObIndexSSTableBuildTask::process() -{ - int ret = ObDDLUtil::retry_with_ddl_schema_hint([this]() -> int { return this->send_build_replica_sql(); }); - ObTabletID unused_tablet_id; - LOG_INFO("build index sstable finish", K(ret), K(*this)); - ObDDLTaskKey task_key(dest_table_id_, schema_version_); - int tmp_ret = root_service_->get_ddl_scheduler().on_sstable_complement_job_reply( - unused_tablet_id, task_key, snapshot_version_, ret); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("report build finish failed", K(ret), K(tmp_ret)); - ret = OB_SUCCESS == ret ? tmp_ret : ret; - } - return ret; -} - -int ObIndexSSTableBuildTask::send_build_replica_sql() const { int ret = OB_SUCCESS; ObTraceIdGuard trace_id_guard(trace_id_); @@ -77,6 +62,8 @@ int ObIndexSSTableBuildTask::send_build_replica_sql() const dest_table_id_, table_schema->get_schema_version(), snapshot_version_, + execution_id_, + task_id_, parallelism_, false/*use_heap_table_ddl*/, !table_schema->is_user_hidden_table()/*use_schema_version_hint_for_src_table*/, @@ -117,6 +104,15 @@ int ObIndexSSTableBuildTask::send_build_replica_sql() const LOG_WARN("fail to execute build replica sql", K(ret), K(tenant_id_)); } } + + LOG_INFO("build index sstable finish", K(ret), K(*this)); + ObDDLTaskKey task_key(dest_table_id_, schema_version_); + int tmp_ret = root_service_->get_ddl_scheduler().on_sstable_complement_job_reply( + unused_tablet_id, task_key, snapshot_version_, execution_id_, ret); + if (OB_SUCCESS != tmp_ret) { + LOG_WARN("report build finish failed", K(ret), K(tmp_ret)); + ret = OB_SUCCESS == ret ? tmp_ret : ret; + } return ret; } @@ -133,6 +129,7 @@ ObAsyncTask *ObIndexSSTableBuildTask::deep_copy(char *buf, const int64_t buf_siz dest_table_id_, schema_version_, snapshot_version_, + execution_id_, trace_id_, parallelism_, create_index_arg_, @@ -146,7 +143,8 @@ ObIndexBuildTask::ObIndexBuildTask() : ObDDLTask(ObDDLType::DDL_CREATE_INDEX), index_table_id_(target_object_id_), is_unique_index_(false), is_global_index_(false), root_service_(nullptr), snapshot_held_(false), is_sstable_complete_task_submitted_(false), sstable_complete_request_time_(0), sstable_complete_ts_(0), - check_unique_snapshot_(0), complete_sstable_job_ret_code_(INT64_MAX), create_index_arg_() + check_unique_snapshot_(0), complete_sstable_job_ret_code_(INT64_MAX), + redefinition_execution_id_(0), create_index_arg_() { } @@ -578,6 +576,7 @@ int ObIndexBuildTask::send_build_single_replica_request() target_object_id_, schema_version_, snapshot_version_, + redefinition_execution_id_, trace_id_, parallelism_, &create_index_arg_, @@ -639,6 +638,7 @@ int ObIndexBuildTask::wait_data_complement() // submit a job to complete sstable for the index table on snapshot_version if (OB_SUCC(ret) && !state_finished && !is_sstable_complete_task_submitted_) { + redefinition_execution_id_ = ObTimeUtility::current_time(); if (OB_FAIL(send_build_single_replica_request())) { LOG_WARN("fail to send build single replica request", K(ret)); } @@ -657,15 +657,13 @@ int ObIndexBuildTask::wait_data_complement() if (OB_SUCC(ret) && state_finished) { uint64_t execution_id = OB_INVALID_ID; bool dummy_equal = false; - if (OB_FAIL(get_execution_id(execution_id))) { - LOG_WARN("fail to query execution id", K(ret), K(index_table_id_)); - } else if (OB_FAIL(ObDDLChecksumOperator::check_column_checksum( - tenant_id_, execution_id, object_id_, index_table_id_, dummy_equal, root_service_->get_sql_proxy()))) { + if (OB_FAIL(ObDDLChecksumOperator::check_column_checksum( + tenant_id_, redefinition_execution_id_, object_id_, index_table_id_, task_id_, dummy_equal, root_service_->get_sql_proxy()))) { if (OB_ITER_END != ret) { - LOG_ERROR("fail to check column checksum", K(ret), K(index_table_id_), K(object_id_)); + LOG_WARN("fail to check column checksum", K(ret), K(index_table_id_), K(object_id_), K(task_id_)); state_finished = true; } else if (REACH_TIME_INTERVAL(1000L * 1000L)) { - LOG_INFO("index checksum has not been reported", K(ret), K(index_table_id_), K(object_id_)); + LOG_INFO("index checksum has not been reported", K(ret), K(index_table_id_), K(object_id_), K(task_id_)); } } } @@ -677,19 +675,6 @@ int ObIndexBuildTask::wait_data_complement() return ret; } -int ObIndexBuildTask::get_execution_id(uint64_t &execution_id) -{ - int ret = OB_SUCCESS; - execution_id = OB_INVALID_ID; - if (OB_UNLIKELY(!is_inited_)) { - ret = OB_NOT_INIT; - LOG_WARN("not init", K(ret)); - } else { - execution_id = schema_version_; - } - return ret; -} - int ObIndexBuildTask::check_need_verify_checksum(bool &need_verify) { int ret = OB_SUCCESS; @@ -776,12 +761,8 @@ int ObIndexBuildTask::verify_checksum() static int64_t checksum_wait_timeout = max(GCONF.global_index_build_single_replica_timeout / 50, 3600L * 1000L * 1000L); bool is_column_checksum_ready = false; bool dummy_equal = false; - uint64_t execution_id = OB_INVALID_ID; - int64_t pos = 0; - if (OB_FAIL(get_execution_id(execution_id))) { - LOG_WARN("get execution id failed", K(ret), K(index_table_id_)); - } else if (!wait_column_checksum_ctx_.is_inited() && OB_FAIL(wait_column_checksum_ctx_.init( - task_id_, tenant_id_, object_id_, index_table_id_, schema_version_, check_unique_snapshot_, execution_id, checksum_wait_timeout))) { + if (!wait_column_checksum_ctx_.is_inited() && OB_FAIL(wait_column_checksum_ctx_.init( + task_id_, tenant_id_, object_id_, index_table_id_, schema_version_, check_unique_snapshot_, redefinition_execution_id_, checksum_wait_timeout))) { LOG_WARN("init context of wait column checksum failed", K(ret), K(object_id_), K(index_table_id_)); } else { if (OB_FAIL(wait_column_checksum_ctx_.try_wait(is_column_checksum_ready))) { @@ -794,7 +775,7 @@ int ObIndexBuildTask::verify_checksum() // do nothing } else { if (OB_FAIL(ObDDLChecksumOperator::check_column_checksum( - tenant_id_, execution_id, object_id_, index_table_id_, dummy_equal, root_service_->get_sql_proxy()))) { + tenant_id_, redefinition_execution_id_, object_id_, index_table_id_, task_id_, dummy_equal, root_service_->get_sql_proxy()))) { if (OB_CHECKSUM_ERROR == ret && is_unique_index_) { ret = OB_ERR_DUPLICATED_UNIQUE_KEY; } @@ -836,6 +817,7 @@ int ObIndexBuildTask::update_column_checksum_calc_status( int ObIndexBuildTask::update_complete_sstable_job_status( const common::ObTabletID &tablet_id, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code) { int ret = OB_SUCCESS; @@ -851,6 +833,8 @@ int ObIndexBuildTask::update_complete_sstable_job_status( } else if (snapshot_version != snapshot_version_) { ret = OB_ERR_UNEXPECTED; LOG_WARN("snapshot version not match", K(ret), K(snapshot_version), K(snapshot_version_)); + } else if (execution_id != redefinition_execution_id_) { + LOG_INFO("receive a mismatch execution result, ignore", K(execution_id), K(redefinition_execution_id_)); } else { complete_sstable_job_ret_code_ = ret_code; sstable_complete_ts_ = ObTimeUtility::current_time(); diff --git a/src/rootserver/ddl_task/ob_index_build_task.h b/src/rootserver/ddl_task/ob_index_build_task.h index 8cadc17d0..81dce5d1f 100644 --- a/src/rootserver/ddl_task/ob_index_build_task.h +++ b/src/rootserver/ddl_task/ob_index_build_task.h @@ -30,13 +30,15 @@ public: const int64_t dest_table_id, const int64_t schema_version, const int64_t snapshot_version, + const int64_t execution_id, const common::ObCurTraceId::TraceId &trace_id, const int64_t parallelism, obrpc::ObCreateIndexArg *create_index_arg, ObRootService *root_service) : task_id_(task_id), tenant_id_(tenant_id), data_table_id_(data_table_id), dest_table_id_(dest_table_id), - schema_version_(schema_version), snapshot_version_(snapshot_version), trace_id_(trace_id), - parallelism_(parallelism), create_index_arg_(create_index_arg), root_service_(root_service) + schema_version_(schema_version), snapshot_version_(snapshot_version), execution_id_(execution_id), + trace_id_(trace_id), parallelism_(parallelism), create_index_arg_(create_index_arg), + root_service_(root_service) { set_retry_times(0); } @@ -45,7 +47,8 @@ public: virtual int process() override; virtual int64_t get_deep_copy_size() const override { return sizeof(*this); } virtual ObAsyncTask *deep_copy(char *buf, const int64_t buf_size) const override; - TO_STRING_KV(K_(data_table_id), K_(dest_table_id), K_(schema_version), K_(snapshot_version), K_(trace_id), K_(parallelism)); + TO_STRING_KV(K_(data_table_id), K_(dest_table_id), K_(schema_version), K_(snapshot_version), + K_(execution_id), K_(trace_id), K_(parallelism)); private: int64_t task_id_; @@ -54,6 +57,7 @@ private: int64_t dest_table_id_; int64_t schema_version_; int64_t snapshot_version_; + int64_t execution_id_; common::ObCurTraceId::TraceId trace_id_; int64_t parallelism_; obrpc::ObCreateIndexArg *create_index_arg_; @@ -85,6 +89,7 @@ public: int update_complete_sstable_job_status( const common::ObTabletID &tablet_id, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code); virtual int process() override; virtual bool is_valid() const override; @@ -93,7 +98,7 @@ public: virtual int64_t get_serialize_param_size() const override; static int deep_copy_index_arg(common::ObIAllocator &allocator, const obrpc::ObCreateIndexArg &source_arg, obrpc::ObCreateIndexArg &dest_arg); INHERIT_TO_STRING_KV("ObDDLTask", ObDDLTask, K(index_table_id_),K(snapshot_held_), K(is_sstable_complete_task_submitted_), - K(sstable_complete_ts_), K(check_unique_snapshot_), K(create_index_arg_)); + K(sstable_complete_ts_), K(check_unique_snapshot_), K_(redefinition_execution_id), K(create_index_arg_)); private: int prepare(); int wait_trans_end(); @@ -108,7 +113,6 @@ private: int update_index_status_in_schema( const share::schema::ObTableSchema &index_schema, const share::schema::ObIndexStatus new_status); - int get_execution_id(uint64_t &execution_id); int check_health(); int send_build_single_replica_request(); int check_build_single_replica(bool &is_end); @@ -133,6 +137,7 @@ private: int64_t check_unique_snapshot_; ObDDLWaitColumnChecksumCtx wait_column_checksum_ctx_; int64_t complete_sstable_job_ret_code_; + int64_t redefinition_execution_id_; obrpc::ObCreateIndexArg create_index_arg_; // this is not a valid arg, only has nls formats for now }; diff --git a/src/rootserver/ddl_task/ob_table_redefinition_task.cpp b/src/rootserver/ddl_task/ob_table_redefinition_task.cpp index 360b6091d..523afb08e 100644 --- a/src/rootserver/ddl_task/ob_table_redefinition_task.cpp +++ b/src/rootserver/ddl_task/ob_table_redefinition_task.cpp @@ -103,7 +103,10 @@ int ObTableRedefinitionTask::init(const ObDDLTaskRecord &task_record) return ret; } -int ObTableRedefinitionTask::update_complete_sstable_job_status(const common::ObTabletID &tablet_id, const int64_t snapshot_version, const int ret_code) +int ObTableRedefinitionTask::update_complete_sstable_job_status(const common::ObTabletID &tablet_id, + const int64_t snapshot_version, + const int64_t execution_id, + const int ret_code) { int ret = OB_SUCCESS; TCWLockGuard guard(lock_); @@ -116,6 +119,8 @@ int ObTableRedefinitionTask::update_complete_sstable_job_status(const common::Ob } else if (OB_UNLIKELY(snapshot_version_ != snapshot_version)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("error unexpected, snapshot version is not equal", K(ret), K(snapshot_version_), K(snapshot_version)); + } else if (execution_id != redefinition_execution_id_) { + LOG_INFO("receive a mismatch execution result, ignore", K(execution_id), K(redefinition_execution_id_)); } else { complete_sstable_job_ret_code_ = ret_code; LOG_INFO("table redefinition task callback", K(complete_sstable_job_ret_code_)); @@ -150,6 +155,7 @@ int ObTableRedefinitionTask::send_build_replica_request() target_object_id_, schema_version_, snapshot_version_, + redefinition_execution_id_, sql_mode, trace_id_, parallelism_, @@ -242,6 +248,7 @@ int ObTableRedefinitionTask::table_redefinition(const ObDDLTaskStatus next_task_ } if (OB_SUCC(ret) && !is_build_replica_end && 0 == build_replica_request_time_) { + redefinition_execution_id_ = ObTimeUtility::current_time(); if (OB_FAIL(send_build_replica_request())) { LOG_WARN("fail to send build replica request", K(ret)); } else { @@ -264,7 +271,7 @@ int ObTableRedefinitionTask::table_redefinition(const ObDDLTaskStatus next_task_ if (is_build_replica_end) { ret = complete_sstable_job_ret_code_; if (OB_SUCC(ret)) { - if (OB_FAIL(check_data_dest_tables_columns_checksum())) { + if (OB_FAIL(check_data_dest_tables_columns_checksum(redefinition_execution_id_))) { LOG_WARN("fail to check the columns checksum of data table and destination table", K(ret)); } } diff --git a/src/rootserver/ddl_task/ob_table_redefinition_task.h b/src/rootserver/ddl_task/ob_table_redefinition_task.h index 86cbc01d2..9989306d3 100644 --- a/src/rootserver/ddl_task/ob_table_redefinition_task.h +++ b/src/rootserver/ddl_task/ob_table_redefinition_task.h @@ -43,6 +43,7 @@ public: virtual int update_complete_sstable_job_status( const common::ObTabletID &tablet_id, const int64_t snapshot_version, + const int64_t execution_id, const int ret_code) override; protected: int table_redefinition(const share::ObDDLTaskStatus next_task_status); diff --git a/src/rootserver/ob_disaster_recovery_task_table_updater.cpp b/src/rootserver/ob_disaster_recovery_task_table_updater.cpp index 8213a2784..6ed5a2a55 100644 --- a/src/rootserver/ob_disaster_recovery_task_table_updater.cpp +++ b/src/rootserver/ob_disaster_recovery_task_table_updater.cpp @@ -17,6 +17,7 @@ #include "share/ob_define.h" #include "share/inner_table/ob_inner_table_schema_constants.h" // for OB_ALL_LS_REPLICA_TASK_TNAME #include "rootserver/ob_disaster_recovery_task_mgr.h" // for ObDRTaskMgr +#include "share/schema/ob_multi_version_schema_service.h" // for GSCHEMASERVICE namespace oceanbase { @@ -259,6 +260,8 @@ int ObDRTaskTableUpdater::process_task_( const uint64_t sql_tenant_id = gen_meta_tenant_id(task.get_tenant_id()); char task_id_to_set[OB_TRACE_STAT_BUFFER_SIZE] = ""; ObSqlString sql; + bool has_dropped = false; + if (OB_UNLIKELY(!inited_) || OB_ISNULL(sql_proxy_) || OB_ISNULL(task_mgr_)) { ret = OB_NOT_INIT; LOG_WARN("ObDRTaskTableUpdater is not inited", KR(ret)); @@ -268,42 +271,51 @@ int ObDRTaskTableUpdater::process_task_( } else if (false == task.get_task_id().to_string(task_id_to_set, sizeof(task_id_to_set))) { ret = OB_INVALID_ARGUMENT; LOG_WARN("convert task id to string failed", KR(ret), "task_id", task.get_task_id()); - } else if (OB_FAIL(trans.start(sql_proxy_, sql_tenant_id))) { - LOG_WARN("start transaction failed", KR(ret), K(sql_tenant_id)); + } else if (OB_UNLIKELY(!is_valid_tenant_id(task.get_tenant_id()))) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("invalid argument", KR(ret), "tenant_id", task.get_tenant_id()); + } else if (OB_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(task.get_tenant_id(), has_dropped))) { + LOG_WARN("fail to check if tenant has been dropped", KR(ret), "tenant_id", task.get_tenant_id()); } else { - if (OB_FAIL(sql.assign_fmt("DELETE FROM %s WHERE tenant_id = %lu AND ls_id = %lu " - "AND task_type = '%s' AND task_id = '%s'", - share::OB_ALL_LS_REPLICA_TASK_TNAME, - task.get_tenant_id(), - task.get_ls_id().id(), - ob_disaster_recovery_task_type_strs(task.get_task_type()), - task_id_to_set))) { - LOG_WARN("assign sql string failed", KR(ret), K(task)); - } else if (OB_FAIL(sql_proxy_->write(sql_tenant_id, sql.ptr(), affected_rows))) { - LOG_WARN("execute sql failed", KR(ret), "sql", sql.ptr(), K(task), K(sql_tenant_id)); - } else if (!is_single_row(affected_rows)) { - // ignore affected row check for task not exist - LOG_INFO("expected deleted single row", - K(affected_rows), K(sql), K(task), K(sql_tenant_id)); + // tenant exist, have to delete task from table and memory + if (has_dropped) { + } else if (OB_FAIL(trans.start(sql_proxy_, sql_tenant_id))) { + LOG_WARN("start transaction failed", KR(ret), K(sql_tenant_id)); + } else { + if (OB_FAIL(sql.assign_fmt("DELETE FROM %s WHERE tenant_id = %lu AND ls_id = %lu " + "AND task_type = '%s' AND task_id = '%s'", + share::OB_ALL_LS_REPLICA_TASK_TNAME, + task.get_tenant_id(), + task.get_ls_id().id(), + ob_disaster_recovery_task_type_strs(task.get_task_type()), + task_id_to_set))) { + LOG_WARN("assign sql string failed", KR(ret), K(task)); + } else if (OB_FAIL(sql_proxy_->write(sql_tenant_id, sql.ptr(), affected_rows))) { + LOG_WARN("execute sql failed", KR(ret), "sql", sql.ptr(), K(task), K(sql_tenant_id)); + } else if (!is_single_row(affected_rows)) { + // ignore affected row check for task not exist + LOG_INFO("expected deleted single row", + K(affected_rows), K(sql), K(task), K(sql_tenant_id)); + } } if (FAILEDx(task_mgr_->do_cleaning( - task.get_task_id(), - task.get_task_key(), - task.get_ret_code(), - task.get_need_clear_server_data_in_limit(), - task.get_need_record_event(), - task.get_ret_comment()))) { + task.get_task_id(), + task.get_task_key(), + task.get_ret_code(), + task.get_need_clear_server_data_in_limit(), + task.get_need_record_event(), + task.get_ret_comment()))) { LOG_WARN("fail to clean task info inside memory", KR(ret), K(task)); } else { LOG_INFO("success to delete row from ls disaster task table and do cleaning", K(affected_rows), K(sql), K(task), K(sql_tenant_id)); } - } - if (trans.is_started()) { - int trans_ret = trans.end(OB_SUCCESS == ret); - if (OB_SUCCESS != trans_ret) { - LOG_WARN("end transaction failed", KR(trans_ret)); - ret = OB_SUCCESS == ret ? trans_ret : ret; + if (trans.is_started()) { + int trans_ret = trans.end(OB_SUCCESS == ret); + if (OB_SUCCESS != trans_ret) { + LOG_WARN("end transaction failed", KR(trans_ret)); + ret = OB_SUCCESS == ret ? trans_ret : ret; + } } } return ret; diff --git a/src/rootserver/ob_root_service.cpp b/src/rootserver/ob_root_service.cpp index 4d5e99f85..b77f76c2d 100644 --- a/src/rootserver/ob_root_service.cpp +++ b/src/rootserver/ob_root_service.cpp @@ -9421,7 +9421,7 @@ int ObRootService::build_ddl_single_replica_response(const obrpc::ObDDLBuildSing ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid arguments", K(ret), K(arg)); } else if (OB_FAIL(ddl_scheduler_.on_sstable_complement_job_reply( - arg.tablet_id_/*source tablet id*/, ObDDLTaskKey(arg.dest_schema_id_, arg.schema_version_), arg.snapshot_version_, arg.ret_code_))) { + arg.tablet_id_/*source tablet id*/, ObDDLTaskKey(arg.dest_schema_id_, arg.schema_version_), arg.snapshot_version_, arg.execution_id_, arg.ret_code_))) { LOG_WARN("handle column checksum calc response failed", K(ret), K(arg)); } return ret; diff --git a/src/rootserver/restore/ob_restore_util.cpp b/src/rootserver/restore/ob_restore_util.cpp index 736429a04..39f5d9ded 100644 --- a/src/rootserver/restore/ob_restore_util.cpp +++ b/src/rootserver/restore/ob_restore_util.cpp @@ -50,6 +50,7 @@ int ObRestoreUtil::fill_physical_restore_job( job.init_restore_key(OB_SYS_TENANT_ID, job_id); job.set_status(PhysicalRestoreStatus::PHYSICAL_RESTORE_CREATE_TENANT); job.set_tenant_name(arg.tenant_name_); + job.set_initiator_tenant_id(OB_SYS_TENANT_ID); if (OB_FAIL(job.set_description(arg.description_))) { LOG_WARN("fail to set description", K(ret)); } diff --git a/src/share/allocator/ob_reserve_arena.h b/src/share/allocator/ob_reserve_arena.h index 17f766113..719c066a0 100644 --- a/src/share/allocator/ob_reserve_arena.h +++ b/src/share/allocator/ob_reserve_arena.h @@ -80,15 +80,19 @@ public: } virtual void reset() override { + if (pos_ > MAX_RESERVE_SIZE - 1) { + allocator_.reset(); + } pos_ = 0; buf_[0] = '\0'; - allocator_.reset(); } virtual void reuse() override { + if (pos_ > MAX_RESERVE_SIZE - 1) { + allocator_.reuse(); + } pos_ = 0; buf_[0] = '\0'; - allocator_.reuse(); } virtual void set_attr(const ObMemAttr &attr) { UNUSED(attr); } diff --git a/src/share/backup/ob_archive_checkpoint.cpp b/src/share/backup/ob_archive_checkpoint.cpp index f38527071..59a795e38 100644 --- a/src/share/backup/ob_archive_checkpoint.cpp +++ b/src/share/backup/ob_archive_checkpoint.cpp @@ -169,6 +169,8 @@ int ObDestRoundCheckpointer::gen_new_round_info_(const ObTenantArchiveRoundAttr need_checkpoint = true; if (OB_FAIL(new_round_info.deep_copy_from(old_round_info))) { LOG_WARN("failed to deep copy round info", K(ret), K(old_round_info), K(counter)); + } else if (counter.ls_count_ == counter.not_start_cnt_) { + // no log stream is archiving. } else if (OB_FAIL(ObTenantArchiveMgr::decide_piece_id(old_round_info.start_scn_, old_round_info.base_piece_id_, old_round_info.piece_switch_interval_, counter.max_scn_, new_round_info.used_piece_id_))) { LOG_WARN("failed to calc MAX piece id", K(ret), K(old_round_info), K(counter)); @@ -176,6 +178,9 @@ int ObDestRoundCheckpointer::gen_new_round_info_(const ObTenantArchiveRoundAttr } else if (OB_FALSE_IT(next_checkpoint_scn = MIN(max_checkpoint_scn_, counter.checkpoint_scn_))) { // Checkpoint can not over limit ts. However, if old round goes into STOPPING, then we will not // move checkpoint_scn on. + } + + if (OB_FAIL(ret)) { } else if (old_round_info.state_.is_beginning()) { if (counter.not_start_cnt_ > 0) { need_checkpoint = false; @@ -254,40 +259,45 @@ int ObDestRoundCheckpointer::generate_pieces_(const ObTenantArchiveRoundAttr &ol { int ret = OB_SUCCESS; - int64_t active_input_bytes = 0; - int64_t active_output_bytes = 0; - int64_t frozen_input_bytes = 0; - int64_t frozen_output_bytes = 0; + if (result.new_round_info_.max_scn_ == old_round_info.start_scn_) { + // No log stream started archive before disable archive, then no piece generated in the round. + LOG_INFO("no piece generated.", K(old_round_info), K(result)); + } else { + int64_t active_input_bytes = 0; + int64_t active_output_bytes = 0; + int64_t frozen_input_bytes = 0; + int64_t frozen_output_bytes = 0; - int64_t since_piece_id = 0; - if (OB_FAIL(ObTenantArchiveMgr::decide_piece_id(old_round_info.start_scn_, old_round_info.base_piece_id_, old_round_info.piece_switch_interval_, old_round_info.checkpoint_scn_, since_piece_id))) { - LOG_WARN("failed to calc since piece id", K(ret), K(old_round_info)); - } - - // generate pieces from last active and valid piece id to 'to_piece_id' - for (int64_t piece_id = since_piece_id; OB_SUCC(ret) && piece_id <= result.new_round_info_.used_piece_id_; piece_id++) { - GeneratedPiece piece; - if (OB_FAIL(generate_one_piece_(old_round_info, result.new_round_info_, summary, piece_id, piece))) { - LOG_WARN("failed to generate one piece", K(ret), K(old_round_info), K(result), K(summary), K(piece_id)); - } else if (OB_FAIL(piece_generated_cb_(round_handler_->get_sql_proxy(), old_round_info, result, piece))) { - LOG_WARN("call piece_generated_cb_ failed", K(ret), K(old_round_info), K(piece)); - } else if (OB_FAIL(result.piece_list_.push_back(piece))) { - LOG_WARN("failed to push back piece", K(ret), K(result), K(piece)); - } else if (piece.piece_info_.status_.is_frozen()) { - frozen_input_bytes += piece.piece_info_.input_bytes_; - frozen_output_bytes += piece.piece_info_.output_bytes_; - } else { - // active piece - active_input_bytes += piece.piece_info_.input_bytes_; - active_output_bytes += piece.piece_info_.output_bytes_; + int64_t since_piece_id = 0; + if (OB_FAIL(ObTenantArchiveMgr::decide_piece_id(old_round_info.start_scn_, old_round_info.base_piece_id_, old_round_info.piece_switch_interval_, old_round_info.checkpoint_scn_, since_piece_id))) { + LOG_WARN("failed to calc since piece id", K(ret), K(old_round_info)); } - } - if (OB_SUCC(ret)) { - result.new_round_info_.frozen_input_bytes_ += frozen_input_bytes; - result.new_round_info_.frozen_output_bytes_ += frozen_output_bytes; - result.new_round_info_.active_input_bytes_ = active_input_bytes; - result.new_round_info_.active_output_bytes_ = active_output_bytes; + // generate pieces from last active and valid piece id to 'to_piece_id' + for (int64_t piece_id = since_piece_id; OB_SUCC(ret) && piece_id <= result.new_round_info_.used_piece_id_; piece_id++) { + GeneratedPiece piece; + if (OB_FAIL(generate_one_piece_(old_round_info, result.new_round_info_, summary, piece_id, piece))) { + LOG_WARN("failed to generate one piece", K(ret), K(old_round_info), K(result), K(summary), K(piece_id)); + } else if (OB_FAIL(piece_generated_cb_(round_handler_->get_sql_proxy(), old_round_info, result, piece))) { + LOG_WARN("call piece_generated_cb_ failed", K(ret), K(old_round_info), K(piece)); + } else if (OB_FAIL(result.piece_list_.push_back(piece))) { + LOG_WARN("failed to push back piece", K(ret), K(result), K(piece)); + } else if (piece.piece_info_.status_.is_frozen()) { + frozen_input_bytes += piece.piece_info_.input_bytes_; + frozen_output_bytes += piece.piece_info_.output_bytes_; + } else { + // active piece + active_input_bytes += piece.piece_info_.input_bytes_; + active_output_bytes += piece.piece_info_.output_bytes_; + } + } + + if (OB_SUCC(ret)) { + result.new_round_info_.frozen_input_bytes_ += frozen_input_bytes; + result.new_round_info_.frozen_output_bytes_ += frozen_output_bytes; + result.new_round_info_.active_input_bytes_ = active_input_bytes; + result.new_round_info_.active_output_bytes_ = active_output_bytes; + } } return ret; diff --git a/src/share/backup/ob_backup_clean_util.cpp b/src/share/backup/ob_backup_clean_util.cpp index 48075a7ea..ef47f074d 100644 --- a/src/share/backup/ob_backup_clean_util.cpp +++ b/src/share/backup/ob_backup_clean_util.cpp @@ -22,7 +22,6 @@ int ObBackupCleanFileOp::func(const dirent *entry) { int ret = OB_SUCCESS; ObBackupIoAdapter util; - ObString file_name(entry->d_name); ObBackupPath tmp_path; total_file_num_++; if (OB_ISNULL(entry)) { @@ -33,8 +32,8 @@ int ObBackupCleanFileOp::func(const dirent *entry) LOG_WARN("invalid list entry, d_name is null"); } else if (OB_FAIL(tmp_path.init(path_.get_ptr()))) { LOG_WARN("failed to init tmp_path", K(ret), K(path_)); - } else if (OB_FAIL(tmp_path.join(file_name))) { - LOG_WARN("failed to join file name", K(ret), K(file_name)); + } else if (OB_FAIL(tmp_path.join(entry->d_name))) { + LOG_WARN("failed to join file name", K(ret), K(entry->d_name)); } else if (OB_FAIL(util.del_file(tmp_path.get_ptr(), storage_info_))) { // File does not exist should be considered successful if (OB_BACKUP_FILE_NOT_EXIST == ret) { @@ -49,6 +48,75 @@ int ObBackupCleanFileOp::func(const dirent *entry) return ret; } +ObBackupPrefixDeleteFileOp::ObBackupPrefixDeleteFileOp() + : is_inited_(false), + path_(), + storage_info_(NULL) +{ + filter_str_[0] = '\0'; +} + +int ObBackupPrefixDeleteFileOp::init( + const char *filter_str, + const int32_t filter_str_len, + const ObBackupPath& path, + const share::ObBackupStorageInfo *storage_info) +{ + int ret = OB_SUCCESS; + if (is_inited_) { + ret = OB_INIT_TWICE; + OB_LOG(WARN, "init twice", K(ret)); + } else if (OB_ISNULL(filter_str) || 0 == filter_str_len || path.is_empty() || OB_ISNULL(storage_info)) { + ret = OB_INVALID_ARGUMENT; + OB_LOG(WARN, "invalid argument", K(ret)); + } else if (filter_str_len > (sizeof(filter_str_) - 1)) { + ret = OB_INVALID_ARGUMENT; + OB_LOG(WARN, "the length of dir prefix too long", K(ret), K(filter_str_len)); + } else if (OB_FAIL(databuff_printf(filter_str_, sizeof(filter_str_), "%.*s", filter_str_len, filter_str))) { + OB_LOG(WARN, "failed to init filter_str", K(ret), K(filter_str), K(filter_str_len)); + } else { + path_ = path; + storage_info_ = storage_info; + is_inited_ = true; + } + return ret; +} + +int ObBackupPrefixDeleteFileOp::func(const dirent *entry) +{ + int ret = OB_SUCCESS; + ObBackupIoAdapter util; + ObBackupPath tmp_path; + if (!is_inited_) { + ret = OB_NOT_INIT; + OB_LOG(WARN, "dir prefix filter not init", K(ret)); + } else if (OB_ISNULL(entry) || OB_ISNULL(entry->d_name)) { + ret = OB_INVALID_ARGUMENT; + OB_LOG(WARN, "invalid argument", K(ret)); + } else if (STRLEN(entry->d_name) < STRLEN(filter_str_)) { + // do nothing + } else if (0 != STRNCMP(entry->d_name, filter_str_, STRLEN(filter_str_))) { + // do nothing + } else if (OB_FAIL(tmp_path.init(path_.get_ptr()))) { + LOG_WARN("failed to init tmp_path", K(ret), K(path_)); + } else if (OB_FAIL(tmp_path.join(entry->d_name))) { + LOG_WARN("failed to join file name", K(ret)); + } else if (OB_FAIL(util.del_file(tmp_path.get_ptr(), storage_info_))) { + // File does not exist should be considered successful + if (OB_BACKUP_FILE_NOT_EXIST == ret) { + LOG_INFO("file is not exist", K(ret), K(tmp_path)); + ret = OB_SUCCESS; + } else { + LOG_WARN("failed to delete file", K(ret), K(tmp_path)); + } + } else { + LOG_INFO("success to delete file", K(ret), K(tmp_path)); + } + + + return ret; +} + int ObBackupCleanUtil::delete_backup_dir_files( const ObBackupPath &path, const share::ObBackupStorageInfo *storage_info) diff --git a/src/share/backup/ob_backup_clean_util.h b/src/share/backup/ob_backup_clean_util.h index c1ec1a971..3e5eb2ba6 100644 --- a/src/share/backup/ob_backup_clean_util.h +++ b/src/share/backup/ob_backup_clean_util.h @@ -55,6 +55,27 @@ private: DISALLOW_COPY_AND_ASSIGN(ObBackupCleanFileOp); }; +class ObBackupPrefixDeleteFileOp : public ObBaseDirEntryOperator +{ +public: + ObBackupPrefixDeleteFileOp(); + virtual ~ObBackupPrefixDeleteFileOp() {} + int func(const dirent *entry) override; + int init( + const char *filter_str, + const int32_t filter_str_len, + const ObBackupPath& path, + const share::ObBackupStorageInfo *storage_info); + +public: + bool is_inited_; + ObBackupPath path_; + char filter_str_[common::MAX_PATH_SIZE]; + const share::ObBackupStorageInfo *storage_info_; +private: + DISALLOW_COPY_AND_ASSIGN(ObBackupPrefixDeleteFileOp); +}; + class ObBackupCleanUtil { public: diff --git a/src/share/backup/ob_backup_path.cpp b/src/share/backup/ob_backup_path.cpp index f0a4566b4..40123c381 100644 --- a/src/share/backup/ob_backup_path.cpp +++ b/src/share/backup/ob_backup_path.cpp @@ -524,7 +524,25 @@ int ObBackupPathUtil::get_backup_set_dir_path(const share::ObBackupDest &backup_ return ret; } -// file:///obbackup/backup_set_1_full_20211231/log_stream_1/ +int ObBackupPathUtil::get_backup_set_inner_placeholder_prefix( + const share::ObBackupSetDesc &backup_set_desc, + char *placeholder_prefix, + int64_t length) +{ + int ret = OB_SUCCESS; + const char *backup_type_str = backup_set_desc.backup_type_.is_full_backup() ? "full" : "inc"; + if (OB_ISNULL(placeholder_prefix)) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("placeholder_prefix is null", K(ret)); + } else if (OB_FAIL(databuff_printf(placeholder_prefix, length, + "backup_set_%lu_%s_", backup_set_desc.backup_set_id_, backup_type_str))) { + LOG_WARN("failed to format backup set placeholder prefix", K(ret), K(backup_set_desc)); + } + + return ret; +} + +// file:///obbackup/backup_set_1_full/backup_set_1_full_xxxx_xxxxx int ObBackupPathUtil::get_backup_set_inner_placeholder( const share::ObBackupDest &backup_set_dest, const share::ObBackupSetDesc &backup_set_desc, const palf::SCN &replay_scn, const palf::SCN &min_restore_scn, diff --git a/src/share/backup/ob_backup_path.h b/src/share/backup/ob_backup_path.h index 33ce08530..1d654d005 100644 --- a/src/share/backup/ob_backup_path.h +++ b/src/share/backup/ob_backup_path.h @@ -87,6 +87,11 @@ struct ObBackupPathUtil static int get_backup_set_dir_path(const share::ObBackupDest &backup_tenant_dest, const share::ObBackupSetDesc &desc, share::ObBackupPath &backup_path); + // backup_set_1_full_ + static int get_backup_set_inner_placeholder_prefix( + const share::ObBackupSetDesc &backup_set_desc, + char *placeholder_prefix, + int64_t length); // file:///obbackup/backup_set_1_full/backup_set_1_full_xxxx_xxxxx static int get_backup_set_inner_placeholder(const share::ObBackupDest &backup_set_dest, diff --git a/src/share/backup/ob_backup_struct.cpp b/src/share/backup/ob_backup_struct.cpp index 8dd2fae78..6f1a22437 100644 --- a/src/share/backup/ob_backup_struct.cpp +++ b/src/share/backup/ob_backup_struct.cpp @@ -1534,7 +1534,7 @@ int ObBackupDest::parse_backup_dest_str_(const char *backup_dest) } else if (OB_FAIL(get_storage_type_from_path(bakup_dest_str, type))) { LOG_WARN("failed to get storage type", K(ret)); } else { - // oss://backup_dir/?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&access_key=222 + // oss://backup_dir/?host=xxx.com&access_id=111&access_key=222 // file:///root_backup_dir" while (backup_dest[pos] != '\0') { if ('?' == backup_dest[pos]) { diff --git a/src/share/get_oer_define.py b/src/share/get_oer_define.py deleted file mode 100755 index 59949d303..000000000 --- a/src/share/get_oer_define.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/env python2 -# -*- coding: utf-8 -*- -# Author: -# -# Example: -# ./get-oer-define.py ORA-12463 -# -# Project: -# http://gitlab.alibaba-inc.com/jim.wjh/OER-tool -# - -import sys -import re -import os -from os.path import expanduser - -Usage = 'invalid argument, eg: ./get_oer_define.py ORA-00000' - -if len(sys.argv) != 2: - print (Usage) -else: - OER_GIT_PATH = expanduser("~") + "/OER_DATA" - OB_FLOW_PATH = os.environ.get('OB_FLOW_WORK_DIR') - if len(OB_FLOW_PATH) > 0 and os.path.exists(OB_FLOW_PATH): - OER_GIT_PATH = OB_FLOW_PATH + "/OER_DATA" - ERR_FILE_PATH = OER_GIT_PATH + '/ORA_V12c' - - if not os.path.exists(OER_GIT_PATH): - os.system('git clone http://gitlab.alibaba-inc.com/jim.wjh/OER.git ' + OER_GIT_PATH) - - target_ora_str = sys.argv[1] - target_ora_str_parts = sys.argv[1].split('-') - if target_ora_str_parts[0] != "ORA" or len(target_ora_str_parts[1]) != 5: - print (Usage) - sys.exit(0) - target_ora_num = int(target_ora_str_parts[1]) - target_file = '' - - for filename in os.listdir(ERR_FILE_PATH): - fragment = filename.split('_') - if filename[:3] == 'ORA' and int(fragment[1]) <= target_ora_num and target_ora_num <= int(fragment[2]): - target_file = filename - break; - - f = open(ERR_FILE_PATH + '/' + filename, 'r') - is_recording = False - result = '' - for line in f.readlines(): - if line[:3] == 'ORA': - if is_recording: - break - elif line[:9] == target_ora_str: - is_recording = True - if is_recording and re.search('[\S]+', line) != None: - result += "//" + line - - exclude_patterns = [ - "\\([^)]*\\)", #括号中的内容 - "\\'[^']*\\'", #引号中的内容 - ": string", #字符串 - "string.string", #字符串 - ] - - replacements = [ - (": string", ": %.*s"), - ("string", "%.*s"), - ] - - if len(result) > 0: - first_line = result.split('\n')[0] - - oer_msg = first_line[12:].strip() - - oer_msg_refined = oer_msg - for pattern in exclude_patterns: - oer_msg_refined = re.sub(pattern, '', oer_msg_refined) - oer_msg_refined = ' '.join(oer_msg_refined.split()) - - err_define = '_'.join(filter(None, oer_msg_refined.split(' '))).upper() - ob_err_define = 'OB_ERR_' + err_define - - #生成改造过的用户错误信息 - user_err_msg = oer_msg_refined - user_err_msg_ext = oer_msg - replace_happend = False - for replacement in replacements: - if None != re.search(replacement[0], user_err_msg_ext): - user_err_msg_ext = re.sub(replacement[0], replacement[1], user_err_msg_ext) - replace_happend = True - user_err_msg_ext = ' '.join(user_err_msg_ext.split()) - print ('\033[31mGenerated changes:\033[0m') - print (result) - print ('\033[31mGenerated changes for file ob_errno.def:\033[0m') - print ('DEFINE_ORACLE_ERROR' + ('_EXT' if replace_happend else '') + - '(' - + ob_err_define + ', -####' + ', -1' + ', "HY000"' - + ', "' + user_err_msg + '"' + ((', "' + user_err_msg_ext + '"') if replace_happend else '') - + ', ' + str(target_ora_num) - + ', "' + user_err_msg + '"' + ((', "' + user_err_msg_ext + '"') if replace_happend else '') - + ');' - ) diff --git a/src/share/inner_table/ob_inner_table_schema.12151_12200.cpp b/src/share/inner_table/ob_inner_table_schema.12151_12200.cpp index eaaca9575..de173a14c 100644 --- a/src/share/inner_table/ob_inner_table_schema.12151_12200.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12151_12200.cpp @@ -6995,6 +6995,51 @@ int ObInnerTableSchema::all_virtual_open_cursor_schema(ObTableSchema &table_sche false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CURSOR_TYPE", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 30, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CHILD_ADDRESS", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 30, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CON_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } if (OB_SUCC(ret)) { table_schema.get_part_option().set_part_num(1); table_schema.set_part_level(PARTITION_LEVEL_ONE); diff --git a/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp b/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp index 75d827e6c..6b061071f 100644 --- a/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp @@ -2031,6 +2031,51 @@ int ObInnerTableSchema::all_virtual_open_cursor_ora_schema(ObTableSchema &table_ false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CURSOR_TYPE", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 30, //column_length + 2, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CHILD_ADDRESS", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 30, //column_length + 2, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CON_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } if (OB_SUCC(ret)) { table_schema.get_part_option().set_part_num(1); table_schema.set_part_level(PARTITION_LEVEL_ONE); diff --git a/src/share/inner_table/ob_inner_table_schema.28051_28100.cpp b/src/share/inner_table/ob_inner_table_schema.28051_28100.cpp index a9700e3aa..de225ad71 100644 --- a/src/share/inner_table/ob_inner_table_schema.28051_28100.cpp +++ b/src/share/inner_table/ob_inner_table_schema.28051_28100.cpp @@ -624,6 +624,106 @@ int ObInnerTableSchema::v_sql_monitor_statname_ora_schema(ObTableSchema &table_s return ret; } +int ObInnerTableSchema::gv_open_cursor_ora_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_GV_OPEN_CURSOR_ORA_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_GV_OPEN_CURSOR_ORA_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT SVR_IP, SVR_PORT, CAST(SADDR AS VARCHAR2(8)) SADDR, CAST(SID AS NUMBER) SID, CAST(USER_NAME AS VARCHAR2(30)) USER_NAME, CAST(ADDRESS AS VARCHAR2(8)) ADDRESS, CAST(HASH_VALUE AS NUMBER) HASH_VALUE, CAST(SQL_ID AS VARCHAR2(32)) SQL_ID, CAST(SQL_TEXT AS VARCHAR2(60)) SQL_TEXT, CAST(LAST_SQL_ACTIVE_TIME as DATE) LAST_SQL_ACTIVE_TIME, CAST(SQL_EXEC_ID AS NUMBER) SQL_EXEC_ID, CAST(CURSOR_TYPE AS VARCHAR2(30)) CURSOR_TYPE, CAST(CHILD_ADDRESS AS VARCHAR2(30)) CHILD_ADDRESS, CAST(CON_ID AS NUMBER) CON_ID FROM SYS.ALL_VIRTUAL_OPEN_CURSOR )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::v_open_cursor_ora_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_V_OPEN_CURSOR_ORA_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_V_OPEN_CURSOR_ORA_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT * FROM SYS.GV$OPEN_CURSOR WHERE svr_ip = host_ip() AND svr_port = rpc_port() )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + int ObInnerTableSchema::v_timezone_names_ora_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index 54c898b40..f12ec67ff 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -1539,6 +1539,8 @@ public: static int gv_sql_plan_monitor_ora_schema(share::schema::ObTableSchema &table_schema); static int v_sql_plan_monitor_ora_schema(share::schema::ObTableSchema &table_schema); static int v_sql_monitor_statname_ora_schema(share::schema::ObTableSchema &table_schema); + static int gv_open_cursor_ora_schema(share::schema::ObTableSchema &table_schema); + static int v_open_cursor_ora_schema(share::schema::ObTableSchema &table_schema); static int v_timezone_names_ora_schema(share::schema::ObTableSchema &table_schema); static int gv_global_transaction_ora_schema(share::schema::ObTableSchema &table_schema); static int v_global_transaction_ora_schema(share::schema::ObTableSchema &table_schema); @@ -3371,6 +3373,8 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::gv_sql_plan_monitor_ora_schema, ObInnerTableSchema::v_sql_plan_monitor_ora_schema, ObInnerTableSchema::v_sql_monitor_statname_ora_schema, + ObInnerTableSchema::gv_open_cursor_ora_schema, + ObInnerTableSchema::v_open_cursor_ora_schema, ObInnerTableSchema::v_timezone_names_ora_schema, ObInnerTableSchema::gv_global_transaction_ora_schema, ObInnerTableSchema::v_global_transaction_ora_schema, @@ -4456,6 +4460,8 @@ const uint64_t tenant_space_tables [] = { OB_GV_SQL_PLAN_MONITOR_ORA_TID, OB_V_SQL_PLAN_MONITOR_ORA_TID, OB_V_SQL_MONITOR_STATNAME_ORA_TID, + OB_GV_OPEN_CURSOR_ORA_TID, + OB_V_OPEN_CURSOR_ORA_TID, OB_V_TIMEZONE_NAMES_ORA_TID, OB_GV_GLOBAL_TRANSACTION_ORA_TID, OB_V_GLOBAL_TRANSACTION_ORA_TID, @@ -6147,6 +6153,8 @@ const char* const tenant_space_table_names [] = { OB_GV_SQL_PLAN_MONITOR_ORA_TNAME, OB_V_SQL_PLAN_MONITOR_ORA_TNAME, OB_V_SQL_MONITOR_STATNAME_ORA_TNAME, + OB_GV_OPEN_CURSOR_ORA_TNAME, + OB_V_OPEN_CURSOR_ORA_TNAME, OB_V_TIMEZONE_NAMES_ORA_TNAME, OB_GV_GLOBAL_TRANSACTION_ORA_TNAME, OB_V_GLOBAL_TRANSACTION_ORA_TNAME, @@ -8775,10 +8783,10 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid, const int64_t OB_CORE_TABLE_COUNT = 4; const int64_t OB_SYS_TABLE_COUNT = 212; const int64_t OB_VIRTUAL_TABLE_COUNT = 549; -const int64_t OB_SYS_VIEW_COUNT = 596; -const int64_t OB_SYS_TENANT_TABLE_COUNT = 1362; +const int64_t OB_SYS_VIEW_COUNT = 598; +const int64_t OB_SYS_TENANT_TABLE_COUNT = 1364; const int64_t OB_CORE_SCHEMA_VERSION = 1; -const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1365; +const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1367; } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema_constants.h b/src/share/inner_table/ob_inner_table_schema_constants.h index 1f690482b..186268125 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -1287,6 +1287,8 @@ const uint64_t OB_V_OB_SERVER_SCHEMA_INFO_ORA_TID = 28058; // "V$OB_SERVER_SCHEM const uint64_t OB_GV_SQL_PLAN_MONITOR_ORA_TID = 28059; // "GV$SQL_PLAN_MONITOR_ORA" const uint64_t OB_V_SQL_PLAN_MONITOR_ORA_TID = 28060; // "V$SQL_PLAN_MONITOR_ORA" const uint64_t OB_V_SQL_MONITOR_STATNAME_ORA_TID = 28061; // "V$SQL_MONITOR_STATNAME_ORA" +const uint64_t OB_GV_OPEN_CURSOR_ORA_TID = 28064; // "GV$OPEN_CURSOR_ORA" +const uint64_t OB_V_OPEN_CURSOR_ORA_TID = 28065; // "V$OPEN_CURSOR_ORA" const uint64_t OB_V_TIMEZONE_NAMES_ORA_TID = 28066; // "V$TIMEZONE_NAMES_ORA" const uint64_t OB_GV_GLOBAL_TRANSACTION_ORA_TID = 28067; // "GV$GLOBAL_TRANSACTION_ORA" const uint64_t OB_V_GLOBAL_TRANSACTION_ORA_TID = 28068; // "V$GLOBAL_TRANSACTION_ORA" @@ -3083,6 +3085,8 @@ const char *const OB_V_OB_SERVER_SCHEMA_INFO_ORA_TNAME = "V$OB_SERVER_SCHEMA_INF const char *const OB_GV_SQL_PLAN_MONITOR_ORA_TNAME = "GV$SQL_PLAN_MONITOR"; const char *const OB_V_SQL_PLAN_MONITOR_ORA_TNAME = "V$SQL_PLAN_MONITOR"; const char *const OB_V_SQL_MONITOR_STATNAME_ORA_TNAME = "V$SQL_MONITOR_STATNAME"; +const char *const OB_GV_OPEN_CURSOR_ORA_TNAME = "GV$OPEN_CURSOR"; +const char *const OB_V_OPEN_CURSOR_ORA_TNAME = "V$OPEN_CURSOR"; const char *const OB_V_TIMEZONE_NAMES_ORA_TNAME = "V$TIMEZONE_NAMES"; const char *const OB_GV_GLOBAL_TRANSACTION_ORA_TNAME = "GV$GLOBAL_TRANSACTION"; const char *const OB_V_GLOBAL_TRANSACTION_ORA_TNAME = "V$GLOBAL_TRANSACTION"; diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index a8691fe5a..ed76040e9 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -9150,7 +9150,7 @@ def_table_schema( ) def_table_schema( - owner = 'lj229669', + owner = 'adou.ly', table_name = '__all_virtual_open_cursor', table_id = '12187', table_type = 'VIRTUAL_TABLE', @@ -9171,6 +9171,9 @@ def_table_schema( ('SQL_TEXT', 'varchar:60'), ('LAST_SQL_ACTIVE_TIME', 'timestamp'), ('SQL_EXEC_ID', 'int'), + ('CURSOR_TYPE', 'varchar:30'), + ('CHILD_ADDRESS', 'varchar:30'), + ('CON_ID', 'int'), ], partition_columns = ['SVR_IP', 'SVR_PORT'], vtable_route_policy = 'distributed', @@ -41085,60 +41088,52 @@ def_table_schema( """.replace("\n", " "), ) -#FIXME: This view will be supported later -#def_table_schema( -# owner = 'lj229669', -# table_name = 'GV$OPEN_CURSOR', -# name_postfix = '_ORA', -# database_id = 'OB_ORA_SYS_DATABASE_ID', -# table_id = '28064', -# table_type = 'SYSTEM_VIEW', -# rowkey_columns = [], -# normal_columns = [], -# gm_columns = [], -# in_tenant_space = True, -# view_definition = """ -# SELECT -# SVR_IP, -# SVR_PORT, -# SADDR, -# SID, -# USER_NAME, -# ADDRESS, -# HASH_VALUE, -# SQL_ID, -# SQL_TEXT, -# CAST(LAST_SQL_ACTIVE_TIME as DATE) LAST_SQL_ACTIVE_TIME, -# SQL_EXEC_ID FROM SYS.ALL_VIRTUAL_OPEN_CURSOR -# """.replace("\n", " ") -#) +def_table_schema( + owner = 'adou.ly', + table_name = 'GV$OPEN_CURSOR', + name_postfix = '_ORA', + database_id = 'OB_ORA_SYS_DATABASE_ID', + table_id = '28064', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + SVR_IP, + SVR_PORT, + CAST(SADDR AS VARCHAR2(8)) SADDR, + CAST(SID AS NUMBER) SID, + CAST(USER_NAME AS VARCHAR2(30)) USER_NAME, + CAST(ADDRESS AS VARCHAR2(8)) ADDRESS, + CAST(HASH_VALUE AS NUMBER) HASH_VALUE, + CAST(SQL_ID AS VARCHAR2(32)) SQL_ID, + CAST(SQL_TEXT AS VARCHAR2(60)) SQL_TEXT, + CAST(LAST_SQL_ACTIVE_TIME as DATE) LAST_SQL_ACTIVE_TIME, + CAST(SQL_EXEC_ID AS NUMBER) SQL_EXEC_ID, + CAST(CURSOR_TYPE AS VARCHAR2(30)) CURSOR_TYPE, + CAST(CHILD_ADDRESS AS VARCHAR2(30)) CHILD_ADDRESS, + CAST(CON_ID AS NUMBER) CON_ID FROM SYS.ALL_VIRTUAL_OPEN_CURSOR + """.replace("\n", " ") +) -#FIXME: This view will be supported later -#def_table_schema( -# owner = 'lj229669', -# table_name = 'V$OPEN_CURSOR', -# name_postfix = '_ORA', -# database_id = 'OB_ORA_SYS_DATABASE_ID', -# table_id = '28065', -# table_type = 'SYSTEM_VIEW', -# rowkey_columns = [], -# normal_columns = [], -# gm_columns = [], -# in_tenant_space = True, -# view_definition = """ -# SELECT -# SADDR, -# SID, -# USER_NAME, -# ADDRESS, -# HASH_VALUE, -# SQL_ID, -# SQL_TEXT, -# LAST_SQL_ACTIVE_TIME, -# SQL_EXEC_ID FROM SYS.GV$OPEN_CURSOR -# WHERE svr_ip = host_ip() AND svr_port = rpc_port() -# """.replace("\n", " ") -#) +def_table_schema( + owner = 'adou.ly', + table_name = 'V$OPEN_CURSOR', + name_postfix = '_ORA', + database_id = 'OB_ORA_SYS_DATABASE_ID', + table_id = '28065', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT * FROM SYS.GV$OPEN_CURSOR + WHERE svr_ip = host_ip() AND svr_port = rpc_port() + """.replace("\n", " ") +) def_table_schema( owner = 'dachuan.sdc', diff --git a/src/share/ob_ddl_checksum.cpp b/src/share/ob_ddl_checksum.cpp index 0a56fed10..f29f282a0 100644 --- a/src/share/ob_ddl_checksum.cpp +++ b/src/share/ob_ddl_checksum.cpp @@ -34,7 +34,9 @@ int ObDDLChecksumOperator::fill_one_item(const ObDDLChecksumItem &item, } else if (OB_FAIL(dml.add_pk_column("execution_id", item.execution_id_)) || OB_FAIL(dml.add_pk_column("tenant_id", ObSchemaUtils::get_extract_tenant_id(exec_tenant_id, tenant_id))) || OB_FAIL(dml.add_pk_column("table_id", ObSchemaUtils::get_extract_schema_id(exec_tenant_id, item.table_id_))) - || OB_FAIL(dml.add_pk_column("tablet_id", item.tablet_id_)) + // currently tablet id is not necessary, so instead we save task id in this column to distinguish different DDL + // task_id is the primary key in __all_ddl_task_status, so it can uniquely identify a DDL. + || OB_FAIL(dml.add_pk_column("tablet_id", item.ddl_task_id_)) || OB_FAIL(dml.add_pk_column("column_id", item.column_id_)) || OB_FAIL(dml.add_pk_column("task_id", item.task_id_)) || OB_FAIL(dml.add_column("checksum", item.checksum_))) { @@ -46,7 +48,7 @@ int ObDDLChecksumOperator::fill_one_item(const ObDDLChecksumItem &item, int ObDDLChecksumOperator::update_checksum( const uint64_t tenant_id, const int64_t table_id, - const int64_t tablet_id, + const int64_t ddl_task_id, const common::ObIArray &main_table_checksum, const common::ObIArray &col_ids, const int64_t schema_version, @@ -54,10 +56,10 @@ int ObDDLChecksumOperator::update_checksum( common::ObMySQLProxy &sql_proxy) { int ret = OB_SUCCESS; - if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == table_id || OB_INVALID_ID == tablet_id + if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == table_id || OB_INVALID_ID == ddl_task_id || main_table_checksum.count() <= 0 || col_ids.count() <= 0 || schema_version <= 0 || task_idx < 0)) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(table_id), K(tablet_id), + LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(table_id), K(task_idx), K(main_table_checksum.count()), K(col_ids.count()), K(schema_version), K(task_idx)); } else { const int64_t column_cnt = col_ids.count(); @@ -67,7 +69,7 @@ int ObDDLChecksumOperator::update_checksum( item.execution_id_ = schema_version; item.tenant_id_ = tenant_id; item.table_id_ = table_id; - item.tablet_id_ = tablet_id; + item.ddl_task_id_ = ddl_task_id; item.column_id_ = col_ids.at(i); item.task_id_ = task_idx; item.checksum_ = main_table_checksum.at(i); @@ -203,49 +205,28 @@ int ObDDLChecksumOperator::get_column_checksum(const ObSqlString &sql, const uin return ret; } -int ObDDLChecksumOperator::get_tablet_column_checksum(const uint64_t tenant_id, - const uint64_t execution_id, const uint64_t table_id, - const int64_t tablet_id, ObHashMap &column_checksum_map, ObMySQLProxy &sql_proxy) -{ - int ret = OB_SUCCESS; - ObSqlString sql; - const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id); - if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == execution_id || OB_INVALID_ID == table_id - || tablet_id < 0 || !column_checksum_map.created())) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(table_id), K(tablet_id), - K(column_checksum_map.created())); - } else if (OB_FAIL(sql.assign_fmt( - "SELECT column_id, checksum FROM %s " - "WHERE execution_id = %ld AND tenant_id = %ld AND table_id = %ld " - "AND tablet_id=%ld ORDER BY column_id", OB_ALL_DDL_CHECKSUM_TNAME, - execution_id, ObSchemaUtils::get_extract_tenant_id(exec_tenant_id, tenant_id), - ObSchemaUtils::get_extract_schema_id(exec_tenant_id, table_id), tablet_id))) { - LOG_WARN("fail to assign fmt", K(ret)); - } else if (OB_FAIL(get_column_checksum(sql, tenant_id, column_checksum_map, sql_proxy))) { - LOG_WARN("fail to get column checksum", K(ret), K(sql)); - } - return ret; -} - -int ObDDLChecksumOperator::get_table_column_checksum(const uint64_t tenant_id, const uint64_t execution_id, - const uint64_t table_id, common::hash::ObHashMap &column_checksum_map, +int ObDDLChecksumOperator::get_table_column_checksum( + const uint64_t tenant_id, + const uint64_t execution_id, + const uint64_t table_id, + const int64_t ddl_task_id, + common::hash::ObHashMap &column_checksum_map, ObMySQLProxy &sql_proxy) { int ret = OB_SUCCESS; ObSqlString sql; const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id); if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == execution_id || OB_INVALID_ID == table_id - || !column_checksum_map.created())) { + || OB_INVALID_ID == ddl_task_id || !column_checksum_map.created())) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(table_id), + LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(table_id), K(ddl_task_id), K(column_checksum_map.created())); } else if (OB_FAIL(sql.assign_fmt( "SELECT column_id, checksum FROM %s " - "WHERE execution_id = %ld AND tenant_id = %ld AND table_id = %ld " + "WHERE execution_id = %ld AND tenant_id = %ld AND table_id = %ld AND tablet_id = %ld " "ORDER BY column_id", OB_ALL_DDL_CHECKSUM_TNAME, execution_id, ObSchemaUtils::get_extract_tenant_id(exec_tenant_id, tenant_id), - ObSchemaUtils::get_extract_schema_id(exec_tenant_id, table_id)))) { + ObSchemaUtils::get_extract_schema_id(exec_tenant_id, table_id), ddl_task_id))) { LOG_WARN("fail to assign fmt", K(ret)); } else if (OB_FAIL(get_column_checksum(sql, tenant_id, column_checksum_map, sql_proxy))) { LOG_WARN("fail to get column checksum", K(ret), K(sql)); @@ -253,26 +234,32 @@ int ObDDLChecksumOperator::get_table_column_checksum(const uint64_t tenant_id, c return ret; } -int ObDDLChecksumOperator::check_column_checksum(const uint64_t tenant_id, const uint64_t execution_id, const uint64_t data_table_id, - const uint64_t index_table_id, bool &is_equal, common::ObMySQLProxy &sql_proxy) +int ObDDLChecksumOperator::check_column_checksum( + const uint64_t tenant_id, + const uint64_t execution_id, + const uint64_t data_table_id, + const uint64_t index_table_id, + const int64_t ddl_task_id, + bool &is_equal, + common::ObMySQLProxy &sql_proxy) { int ret = OB_SUCCESS; hash::ObHashMap data_table_column_checksums; hash::ObHashMap index_table_column_checksums; is_equal = true; if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == execution_id || OB_INVALID_ID == data_table_id - || OB_INVALID_ID == index_table_id)) { + || OB_INVALID_ID == index_table_id || OB_INVALID_ID == ddl_task_id)) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(data_table_id), K(index_table_id)); + LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(data_table_id), K(index_table_id), K(ddl_task_id)); } else if (OB_FAIL(data_table_column_checksums.create(OB_MAX_COLUMN_NUMBER / 2, ObModIds::OB_SSTABLE_CREATE_INDEX))) { LOG_WARN("fail to create column checksum map", K(ret)); } else if (OB_FAIL(index_table_column_checksums.create(OB_MAX_COLUMN_NUMBER / 2, ObModIds::OB_SSTABLE_CREATE_INDEX))) { LOG_WARN("fail to create column checksum map", K(ret)); - } else if (OB_FAIL(get_table_column_checksum(tenant_id, execution_id, data_table_id, data_table_column_checksums, sql_proxy))) { - LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), K(data_table_id)); - } else if (OB_FAIL(get_table_column_checksum(tenant_id, execution_id, index_table_id, index_table_column_checksums, + } else if (OB_FAIL(get_table_column_checksum(tenant_id, execution_id, data_table_id, ddl_task_id, data_table_column_checksums, sql_proxy))) { + LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), K(data_table_id), K(ddl_task_id)); + } else if (OB_FAIL(get_table_column_checksum(tenant_id, execution_id, index_table_id, ddl_task_id, index_table_column_checksums, sql_proxy))) { - LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), K(index_table_id)); + LOG_WARN("fail to get table column checksum", K(ret), K(execution_id), K(index_table_id), K(ddl_task_id)); } else { for (hash::ObHashMap::const_iterator iter = index_table_column_checksums.begin(); OB_SUCC(ret) && iter != index_table_column_checksums.end(); ++iter) { @@ -302,20 +289,21 @@ int ObDDLChecksumOperator::delete_checksum( const uint64_t execution_id, const uint64_t source_table_id, const uint64_t dest_table_id, + const int64_t ddl_task_id, common::ObMySQLProxy &sql_proxy) { int ret = OB_SUCCESS; ObSqlString sql; int64_t affected_rows = 0; const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id); - if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == execution_id + if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == execution_id || OB_INVALID_ID == ddl_task_id || OB_INVALID_ID == source_table_id || OB_INVALID_ID == dest_table_id)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ret), K(tenant_id), K(execution_id), K(source_table_id), K(dest_table_id)); } else if (OB_FAIL(sql.assign_fmt( "DELETE /*+ use_plan_cache(none) */ FROM %s " - "WHERE tenant_id = 0 AND execution_id = %ld AND table_id IN (%ld, %ld)", - OB_ALL_DDL_CHECKSUM_TNAME, execution_id, source_table_id, dest_table_id))) { + "WHERE tenant_id = 0 AND execution_id = %ld AND tablet_id = %ld AND table_id IN (%ld, %ld)", + OB_ALL_DDL_CHECKSUM_TNAME, execution_id, ddl_task_id, source_table_id, dest_table_id))) { LOG_WARN("fail to assign fmt", K(ret)); } else if (OB_FAIL(sql_proxy.write(tenant_id, sql.ptr(), affected_rows))) { LOG_WARN("fail to execute sql", KR(ret), K(sql)); diff --git a/src/share/ob_ddl_checksum.h b/src/share/ob_ddl_checksum.h index 2e7f6e427..4a12692c6 100644 --- a/src/share/ob_ddl_checksum.h +++ b/src/share/ob_ddl_checksum.h @@ -27,7 +27,7 @@ struct ObDDLChecksumItem { ObDDLChecksumItem() : execution_id_(common::OB_INVALID_ID), tenant_id_(common::OB_INVALID_ID), - table_id_(common::OB_INVALID_ID), tablet_id_(common::OB_INVALID_ID), + table_id_(common::OB_INVALID_ID), ddl_task_id_(0), column_id_(common::OB_INVALID_ID), task_id_(common::OB_INVALID_ID), checksum_(0) {} ~ObDDLChecksumItem() {}; @@ -36,15 +36,15 @@ struct ObDDLChecksumItem return common::OB_INVALID_ID != execution_id_ && common::OB_INVALID_ID != tenant_id_ && common::OB_INVALID_ID != table_id_ - && common::OB_INVALID_ID != tablet_id_ + && 0 < ddl_task_id_ && common::OB_INVALID_ID != column_id_; } TO_STRING_KV(K_(execution_id), K_(tenant_id), K_(table_id), - K_(tablet_id), K_(column_id), K_(task_id), K_(checksum)); + K_(ddl_task_id), K_(column_id), K_(task_id), K_(checksum)); uint64_t execution_id_; uint64_t tenant_id_; uint64_t table_id_; - int64_t tablet_id_; + int64_t ddl_task_id_; int64_t column_id_; uint64_t task_id_; int64_t checksum_; @@ -56,7 +56,7 @@ public: static int update_checksum( const uint64_t tenant_id, const int64_t table_id, - const int64_t tablet_id, + const int64_t ddl_task_id, const common::ObIArray &main_table_checksum, const common::ObIArray &col_ids, const int64_t schema_version, @@ -64,23 +64,18 @@ public: common::ObMySQLProxy &sql_proxy); static int update_checksum(const common::ObIArray &checksum_items, common::ObMySQLProxy &sql_proxy); - static int get_tablet_column_checksum( - const uint64_t tenant_id, - const uint64_t execution_id, - const uint64_t table_id, - const int64_t tablet_id, - common::hash::ObHashMap &column_checksums, - common::ObMySQLProxy &sql_proxy); static int get_table_column_checksum( const uint64_t tenant_id, const uint64_t execution_id, const uint64_t table_id, + const int64_t ddl_task_id, common::hash::ObHashMap &column_checksums, common::ObMySQLProxy &sql_proxy); static int check_column_checksum( const uint64_t tenant_id, const uint64_t execution_id, const uint64_t data_table_id, const uint64_t index_table_id, + const int64_t ddl_task_id, bool &is_equal, common::ObMySQLProxy &sql_proxy); static int delete_checksum( @@ -88,6 +83,7 @@ public: const uint64_t execution_id, const uint64_t source_table_id, const uint64_t dest_table_id, + const int64_t ddl_task_id, common::ObMySQLProxy &sql_proxy); private: static int fill_one_item(const ObDDLChecksumItem &item, diff --git a/src/share/ob_ddl_common.cpp b/src/share/ob_ddl_common.cpp index afbbd465a..89f66fe63 100644 --- a/src/share/ob_ddl_common.cpp +++ b/src/share/ob_ddl_common.cpp @@ -424,6 +424,8 @@ int ObDDLUtil::generate_build_replica_sql( const int64_t dest_table_id, const int64_t schema_version, const int64_t snapshot_version, + const int64_t execution_id, + const int64_t task_id, const int64_t parallelism, const bool use_heap_table_ddl_plan, const bool use_schema_version_hint_for_src_table, @@ -435,9 +437,11 @@ int ObDDLUtil::generate_build_replica_sql( const ObTableSchema *source_table_schema = nullptr; const ObTableSchema *dest_table_schema = nullptr; bool oracle_mode = false; - if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == data_table_id || OB_INVALID_ID == dest_table_id || schema_version <= 0 || snapshot_version <= 0)) { + if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || OB_INVALID_ID == data_table_id || OB_INVALID_ID == dest_table_id + || schema_version <= 0 || snapshot_version <= 0 || execution_id <= 0 || task_id <= 0)) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(data_table_id), K(dest_table_id), K(schema_version), K(snapshot_version)); + LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(data_table_id), K(dest_table_id), K(schema_version), + K(snapshot_version), K(execution_id), K(task_id)); } else if (OB_FAIL(ObMultiVersionSchemaService::get_instance().get_tenant_schema_guard( tenant_id, schema_guard, schema_version))) { LOG_WARN("fail to get tenant schema guard", K(ret), K(data_table_id)); @@ -636,8 +640,8 @@ int ObDDLUtil::generate_build_replica_sql( if (OB_FAIL(ret)) { } else if (oracle_mode) { - if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ monitor enable_parallel_dml parallel(%ld) use_px */INTO \"%.*s\".\"%.*s\"(%.*s) SELECT /*+ index(\"%.*s\" primary) %.*s */ %.*s from \"%.*s\".\"%.*s\" as of scn %ld %.*s", - real_parallelism, + if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ monitor enable_parallel_dml parallel(%ld) opt_param('ddl_execution_id', %ld) opt_param('ddl_task_id', %ld) use_px */INTO \"%.*s\".\"%.*s\"(%.*s) SELECT /*+ index(\"%.*s\" primary) %.*s */ %.*s from \"%.*s\".\"%.*s\" as of scn %ld %.*s", + real_parallelism, execution_id, task_id, static_cast(dest_database_name.length()), dest_database_name.ptr(), static_cast(dest_table_name.length()), dest_table_name.ptr(), static_cast(insert_column_sql_string.length()), insert_column_sql_string.ptr(), static_cast(source_table_name.length()), source_table_name.ptr(), @@ -648,8 +652,8 @@ int ObDDLUtil::generate_build_replica_sql( LOG_WARN("fail to assign sql string", K(ret)); } } else { - if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ monitor enable_parallel_dml parallel(%ld) use_px */INTO `%.*s`.`%.*s`(%.*s) SELECT /*+ index(`%.*s` primary) %.*s */ %.*s from `%.*s`.`%.*s` as of snapshot %ld %.*s", - real_parallelism, + if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ monitor enable_parallel_dml parallel(%ld) opt_param('ddl_execution_id', %ld) opt_param('ddl_task_id', %ld) use_px */INTO `%.*s`.`%.*s`(%.*s) SELECT /*+ index(`%.*s` primary) %.*s */ %.*s from `%.*s`.`%.*s` as of snapshot %ld %.*s", + real_parallelism, execution_id, task_id, static_cast(dest_database_name.length()), dest_database_name.ptr(), static_cast(dest_table_name.length()), dest_table_name.ptr(), static_cast(insert_column_sql_string.length()), insert_column_sql_string.ptr(), static_cast(source_table_name.length()), source_table_name.ptr(), @@ -716,6 +720,7 @@ int ObDDLUtil::clear_ddl_checksum(ObPhysicalPlan *phy_plan) execution_id, table_scan_table_id, phy_plan->get_ddl_table_id(), + phy_plan->get_ddl_task_id(), *GCTX.sql_proxy_))) { LOG_WARN("failed to delete checksum", K(ret)); } diff --git a/src/share/ob_ddl_common.h b/src/share/ob_ddl_common.h index 9e7ba9302..56f21903d 100644 --- a/src/share/ob_ddl_common.h +++ b/src/share/ob_ddl_common.h @@ -228,6 +228,8 @@ public: const int64_t dest_table_id, const int64_t schema_version, const int64_t snapshot_version, + const int64_t execution_id, + const int64_t task_id, const int64_t parallelism, const bool use_heap_table_ddl_plan, const bool use_schema_version_hint_for_src_table, @@ -261,23 +263,6 @@ public: || OB_EAGAIN == ret || OB_LS_LOCATION_LEADER_NOT_EXIST == ret; } - template - static int retry_with_ddl_schema_hint(F func) { - int ret = OB_SUCCESS; - int64_t retry_cnt = 10; - while (OB_SUCC(ret) && retry_cnt > 0) { - if (OB_FAIL(func())) { - if (OB_DDL_SCHEMA_VERSION_NOT_MATCH == ret && retry_cnt > 1) { - ret = OB_SUCCESS; - retry_cnt -= 1; - } - } else { - retry_cnt = 0; - } - } - return ret; - } - private: static int generate_column_name_str( const common::ObIArray &column_names, diff --git a/src/share/ob_ddl_task_executor.h b/src/share/ob_ddl_task_executor.h index 460f5b7d6..768f9b668 100644 --- a/src/share/ob_ddl_task_executor.h +++ b/src/share/ob_ddl_task_executor.h @@ -57,7 +57,7 @@ public: || common::OB_TRANS_STMT_TIMEOUT == ret_code || common::OB_RS_NOT_MASTER == ret_code || OB_TRANS_NEED_ROLLBACK == ret_code || common::OB_SCHEMA_EAGAIN == ret_code || common::OB_GTS_NOT_READY == ret_code || common::OB_ERR_SHARED_LOCK_CONFLICT == ret_code || common::OB_PARTITION_NOT_EXIST == ret_code || common::OB_PG_IS_REMOVED == ret_code || common::OB_TENANT_NOT_EXIST == ret_code - || common::OB_RPC_SEND_ERROR == ret_code; + || common::OB_RPC_SEND_ERROR == ret_code || common::OB_DDL_SCHEMA_VERSION_NOT_MATCH == ret_code; } protected: typedef common::ObCurTraceId::TraceId TaskId; diff --git a/src/share/ob_debug_sync_point.h b/src/share/ob_debug_sync_point.h index 7a576bd28..d8cf21903 100644 --- a/src/share/ob_debug_sync_point.h +++ b/src/share/ob_debug_sync_point.h @@ -241,6 +241,7 @@ class ObString; ACT(LOG_ARCHIVE_SENDER_HANDLE,)\ ACT(LOG_ARCHIVE_PUSH_LOG,)\ ACT(END_PROCESS_USER_SCHEMA,)\ + ACT(BEFROE_LOG_ARCHIVE_SCHEDULE_PREPARE,)\ ACT(BEFROE_LOG_ARCHIVE_SCHEDULE_BEGINNING,)\ ACT(BEFROE_LOG_ARCHIVE_SCHEDULE_DOING,)\ ACT(BEFROE_LOG_ARCHIVE_SCHEDULE_STOPPING,)\ @@ -415,6 +416,7 @@ class ObString; ACT(BEFORE_TABLET_GROUP_MIGRATION_GENERATE_NEXT_DAG,)\ ACT(BEFORE_BACKUP_TASK_FINISH,)\ ACT(BEFORE_UPDATE_LS_META_TABLE,)\ + ACT(BEFORE_LOAD_ARCHIVE_ROUND,)\ ACT(MAX_DEBUG_SYNC_POINT,) DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF); diff --git a/src/share/ob_errno.cpp b/src/share/ob_errno.cpp index ea433f2fd..33b26c245 100644 --- a/src/share/ob_errno.cpp +++ b/src/share/ob_errno.cpp @@ -361,10 +361,10 @@ static const _error _error_OB_READ_NOTHING = { .error_name = "OB_READ_NOTHING", .error_cause = "Internal Error", .error_solution = "Contact OceanBase Support", - .mysql_errno = -1, + .mysql_errno = ER_SP_FETCH_NO_DATA, .sqlstate = "02000", - .str_error = "Nothing to read", - .str_user_error = "Nothing to read", + .str_error = "No data - zero rows fetched, selected, or processed", + .str_user_error = "No data - zero rows fetched, selected, or processed", .oracle_errno = 1403, .oracle_str_error = "ORA-01403: no data found", .oracle_str_user_error = "ORA-01403: no data found" @@ -21861,18 +21861,6 @@ static const _error _error_OB_ERR_NAME_HAS_TOO_MANY_PARTS = { .oracle_str_error = "ORA-06563: name has too many parts", .oracle_str_user_error = "ORA-06563: name has too many parts" }; -static const _error _error_OB_ERR_SP_FETCH_NO_DATA = { - .error_name = "OB_ERR_SP_FETCH_NO_DATA", - .error_cause = "Internal Error", - .error_solution = "Contact OceanBase Support", - .mysql_errno = ER_SP_FETCH_NO_DATA, - .sqlstate = "HY000", - .str_error = "No data - zero rows fetched, selected, or processed", - .str_user_error = "No data - zero rows fetched, selected, or processed", - .oracle_errno = 600, - .oracle_str_error = "ORA-00600: internal error code, arguments: -9715, No data - zero rows fetched, selected, or processed", - .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9715, No data - zero rows fetched, selected, or processed" -}; static const _error _error_OB_SP_RAISE_APPLICATION_ERROR = { .error_name = "OB_SP_RAISE_APPLICATION_ERROR", .error_cause = "Internal Error", @@ -23784,7 +23772,6 @@ struct ObStrErrorInit _errors[-OB_ERR_MISSING_INTO_KEYWORD] = &_error_OB_ERR_MISSING_INTO_KEYWORD; _errors[-OB_ERR_CLAUSE_RETURN_ILLEGAL] = &_error_OB_ERR_CLAUSE_RETURN_ILLEGAL; _errors[-OB_ERR_NAME_HAS_TOO_MANY_PARTS] = &_error_OB_ERR_NAME_HAS_TOO_MANY_PARTS; - _errors[-OB_ERR_SP_FETCH_NO_DATA] = &_error_OB_ERR_SP_FETCH_NO_DATA; _errors[-OB_SP_RAISE_APPLICATION_ERROR] = &_error_OB_SP_RAISE_APPLICATION_ERROR; _errors[-OB_SP_RAISE_APPLICATION_ERROR_NUM] = &_error_OB_SP_RAISE_APPLICATION_ERROR_NUM; _errors[-OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN] = &_error_OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN; diff --git a/src/share/ob_errno.def b/src/share/ob_errno.def index 74a0263ab..a81b8fd28 100644 --- a/src/share/ob_errno.def +++ b/src/share/ob_errno.def @@ -111,7 +111,7 @@ DEFINE_ERROR_DEP(OB_ITEM_NOT_SETTED, -4022, -1, "HY000", "Item not set"); DEFINE_ERROR_DEP(OB_EAGAIN, -4023, -1, "HY000", "Try again"); DEFINE_ERROR_DEP(OB_BUF_NOT_ENOUGH, -4024, -1, "HY000", "Buffer not enough"); DEFINE_ERROR(OB_PARTIAL_FAILED, -4025, -1, "HY000", "Partial failed"); -DEFINE_ORACLE_ERROR_DEP(OB_READ_NOTHING, -4026, -1, "02000", "Nothing to read", 1403, "no data found"); +DEFINE_ORACLE_ERROR_DEP(OB_READ_NOTHING, -4026, ER_SP_FETCH_NO_DATA, "02000", "No data - zero rows fetched, selected, or processed", 1403, "no data found"); DEFINE_ERROR_DEP(OB_FILE_NOT_EXIST, -4027, ER_FILE_NOT_FOUND, "HY000", "File not exist"); DEFINE_ERROR_DEP(OB_DISCONTINUOUS_LOG, -4028, -1, "HY000", "Log entry not continuous"); DEFINE_ERROR(OB_SCHEMA_ERROR, -4029, -1, "HY000", "Schema error"); @@ -2010,7 +2010,6 @@ DEFINE_ORACLE_ERROR(OB_ERR_STATEMENT_STRING_IN_EXECUTE_IMMEDIATE_IS_NULL_OR_ZERO DEFINE_ORACLE_ERROR(OB_ERR_MISSING_INTO_KEYWORD, -9712, -1, "HY000", "missing INTO keyword", 925, "missing INTO keyword"); DEFINE_ORACLE_ERROR(OB_ERR_CLAUSE_RETURN_ILLEGAL, -9713, -1, "HY000", "RETURNING clause must be used with INSERT, UPDATE, or DELETE statements", 6547, "RETURNING clause must be used with INSERT, UPDATE, or DELETE statements"); DEFINE_ORACLE_ERROR(OB_ERR_NAME_HAS_TOO_MANY_PARTS, -9714, -1, "HY000", "name has too many parts", 6563, "name has too many parts"); -DEFINE_ERROR(OB_ERR_SP_FETCH_NO_DATA, -9715, ER_SP_FETCH_NO_DATA, "HY000", "No data - zero rows fetched, selected, or processed"); //////////////////////////////////////////////////////////////// // !!! text/blob || clob/blob erro code // for compat we cant not remove this errno!!!! diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index ff484c793..46f979b10 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -1588,7 +1588,6 @@ constexpr int OB_ERR_STATEMENT_STRING_IN_EXECUTE_IMMEDIATE_IS_NULL_OR_ZERO_LENGT constexpr int OB_ERR_MISSING_INTO_KEYWORD = -9712; constexpr int OB_ERR_CLAUSE_RETURN_ILLEGAL = -9713; constexpr int OB_ERR_NAME_HAS_TOO_MANY_PARTS = -9714; -constexpr int OB_ERR_SP_FETCH_NO_DATA = -9715; constexpr int OB_SP_RAISE_APPLICATION_ERROR = -20000; constexpr int OB_SP_RAISE_APPLICATION_ERROR_NUM = -21000; constexpr int OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN = -22998; @@ -1627,7 +1626,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_EAGAIN__USER_ERROR_MSG "Try again" #define OB_BUF_NOT_ENOUGH__USER_ERROR_MSG "Buffer not enough" #define OB_PARTIAL_FAILED__USER_ERROR_MSG "Partial failed" -#define OB_READ_NOTHING__USER_ERROR_MSG "Nothing to read" +#define OB_READ_NOTHING__USER_ERROR_MSG "No data - zero rows fetched, selected, or processed" #define OB_FILE_NOT_EXIST__USER_ERROR_MSG "File not exist" #define OB_DISCONTINUOUS_LOG__USER_ERROR_MSG "Log entry not continuous" #define OB_SCHEMA_ERROR__USER_ERROR_MSG "Schema error" @@ -3419,7 +3418,6 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_MISSING_INTO_KEYWORD__USER_ERROR_MSG "missing INTO keyword" #define OB_ERR_CLAUSE_RETURN_ILLEGAL__USER_ERROR_MSG "RETURNING clause must be used with INSERT, UPDATE, or DELETE statements" #define OB_ERR_NAME_HAS_TOO_MANY_PARTS__USER_ERROR_MSG "name has too many parts" -#define OB_ERR_SP_FETCH_NO_DATA__USER_ERROR_MSG "No data - zero rows fetched, selected, or processed" #define OB_SP_RAISE_APPLICATION_ERROR__USER_ERROR_MSG "%.*s" #define OB_SP_RAISE_APPLICATION_ERROR_NUM__USER_ERROR_MSG "error number argument to raise_application_error of '%d' is out of range" #define OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN__USER_ERROR_MSG "CLOB or NCLOB in multibyte character set not supported" @@ -5250,7 +5248,6 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_MISSING_INTO_KEYWORD__ORA_USER_ERROR_MSG "ORA-00925: missing INTO keyword" #define OB_ERR_CLAUSE_RETURN_ILLEGAL__ORA_USER_ERROR_MSG "ORA-06547: RETURNING clause must be used with INSERT, UPDATE, or DELETE statements" #define OB_ERR_NAME_HAS_TOO_MANY_PARTS__ORA_USER_ERROR_MSG "ORA-06563: name has too many parts" -#define OB_ERR_SP_FETCH_NO_DATA__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9715, No data - zero rows fetched, selected, or processed" #define OB_SP_RAISE_APPLICATION_ERROR__ORA_USER_ERROR_MSG "ORA%06ld: %.*s" #define OB_SP_RAISE_APPLICATION_ERROR_NUM__ORA_USER_ERROR_MSG "ORA-21000: error number argument to raise_application_error of '%d' is out of range" #define OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN__ORA_USER_ERROR_MSG "ORA-22998: CLOB or NCLOB in multibyte character set not supported" diff --git a/src/share/ob_i_tablet_scan.h b/src/share/ob_i_tablet_scan.h index 238aa0a29..de272bd0f 100644 --- a/src/share/ob_i_tablet_scan.h +++ b/src/share/ob_i_tablet_scan.h @@ -204,7 +204,7 @@ ObVTableScanParam() : for_update_wait_timeout_(-1), frozen_version_(-1), scan_allocator_(&CURRENT_CONTEXT->get_arena_allocator()), - fb_snapshot_(transaction::ObTransVersion::INVALID_TRANS_VERSION), + fb_snapshot_(), is_get_(false), force_refresh_lc_(false), output_exprs_(NULL), @@ -266,7 +266,7 @@ ObVTableScanParam() : ObIAllocator *scan_allocator_; ObTableScanStatistic main_table_scan_stat_; ObTableScanStatistic idx_table_scan_stat_; - int64_t fb_snapshot_; + palf::SCN fb_snapshot_; bool is_get_; bool force_refresh_lc_; diff --git a/src/share/ob_rpc_struct.cpp b/src/share/ob_rpc_struct.cpp index a475bd51e..eb5428ee6 100644 --- a/src/share/ob_rpc_struct.cpp +++ b/src/share/ob_rpc_struct.cpp @@ -5541,7 +5541,7 @@ OB_SERIALIZE_MEMBER(ObLogReqLoadProxyProgressRequest, agency_addr_seq_, principa OB_SERIALIZE_MEMBER(ObLogReqLoadProxyProgressResponse, err_, progress_); OB_SERIALIZE_MEMBER(ObDDLBuildSingleReplicaRequestArg, tenant_id_, ls_id_, source_tablet_id_, dest_tablet_id_, - source_table_id_, dest_schema_id_, schema_version_, snapshot_version_, ddl_type_, task_id_, parallelism_); + source_table_id_, dest_schema_id_, schema_version_, snapshot_version_, ddl_type_, task_id_, execution_id_, parallelism_); int ObDDLBuildSingleReplicaRequestArg::assign(const ObDDLBuildSingleReplicaRequestArg &other) { @@ -5556,7 +5556,6 @@ int ObDDLBuildSingleReplicaRequestArg::assign(const ObDDLBuildSingleReplicaReque snapshot_version_ = other.snapshot_version_; ddl_type_ = other.ddl_type_; task_id_ = other.task_id_; - parallelism_ = other.parallelism_; return ret; } @@ -5569,7 +5568,7 @@ int ObDDLBuildSingleReplicaRequestResult::assign(const ObDDLBuildSingleReplicaRe return ret; } -OB_SERIALIZE_MEMBER(ObDDLBuildSingleReplicaResponseArg, tenant_id_, ls_id_, tablet_id_, source_table_id_, dest_schema_id_, ret_code_, snapshot_version_, schema_version_, task_id_); +OB_SERIALIZE_MEMBER(ObDDLBuildSingleReplicaResponseArg, tenant_id_, ls_id_, tablet_id_, source_table_id_, dest_schema_id_, ret_code_, snapshot_version_, schema_version_, task_id_, execution_id_); int ObDDLBuildSingleReplicaResponseArg::assign(const ObDDLBuildSingleReplicaResponseArg &other) { @@ -5583,6 +5582,7 @@ int ObDDLBuildSingleReplicaResponseArg::assign(const ObDDLBuildSingleReplicaResp snapshot_version_ = other.snapshot_version_; schema_version_ = other.schema_version_; task_id_ = other.task_id_; + execution_id_ = other.execution_id_; return ret; } @@ -6550,7 +6550,7 @@ OB_SERIALIZE_MEMBER(ObRpcRemoteWriteDDLRedoLogArg, tenant_id_, ls_id_, redo_info ObRpcRemoteWriteDDLPrepareLogArg::ObRpcRemoteWriteDDLPrepareLogArg() : tenant_id_(OB_INVALID_ID), ls_id_(), table_key_(), start_log_ts_(0), - table_id_(0), schema_version_(0) + table_id_(0), execution_id_(0), ddl_task_id_(0) {} int ObRpcRemoteWriteDDLPrepareLogArg::init(const uint64_t tenant_id, @@ -6558,27 +6558,29 @@ int ObRpcRemoteWriteDDLPrepareLogArg::init(const uint64_t tenant_id, const storage::ObITable::TableKey &table_key, const int64_t start_log_ts, const int64_t table_id, - const int64_t schema_version) + const int64_t execution_id, + const int64_t ddl_task_id) { int ret = OB_SUCCESS; if (OB_UNLIKELY(tenant_id == OB_INVALID_ID || !ls_id.is_valid() || !table_key.is_valid() || start_log_ts <= 0 - || table_id <= 0 || schema_version <= 0)) { + || table_id <= 0 || execution_id <= 0 || ddl_task_id <= 0)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("tablet id is not valid", K(ret), K(tenant_id), K(ls_id), K(table_key), K(start_log_ts), - K(table_id), K(schema_version)); + K(table_id), K(execution_id), K(ddl_task_id)); } else { tenant_id_ = tenant_id; ls_id_ = ls_id; table_key_ = table_key; start_log_ts_ = start_log_ts; table_id_ = table_id; - schema_version_ = schema_version; + execution_id_ = execution_id; + ddl_task_id_ = ddl_task_id; } return ret; } OB_SERIALIZE_MEMBER(ObRpcRemoteWriteDDLPrepareLogArg, tenant_id_, ls_id_, table_key_, start_log_ts_, - table_id_, schema_version_); + table_id_, execution_id_, ddl_task_id_); ObRpcRemoteWriteDDLCommitLogArg::ObRpcRemoteWriteDDLCommitLogArg() : tenant_id_(OB_INVALID_ID), ls_id_(), table_key_(), start_log_ts_(0), prepare_log_ts_(0) diff --git a/src/share/ob_rpc_struct.h b/src/share/ob_rpc_struct.h index 5b1a26932..7034d8724 100644 --- a/src/share/ob_rpc_struct.h +++ b/src/share/ob_rpc_struct.h @@ -7091,7 +7091,7 @@ struct ObDDLBuildSingleReplicaRequestArg final OB_UNIS_VERSION(1); public: ObDDLBuildSingleReplicaRequestArg() : tenant_id_(OB_INVALID_ID), ls_id_(), source_tablet_id_(), dest_tablet_id_(), source_table_id_(OB_INVALID_ID), - dest_schema_id_(OB_INVALID_ID), schema_version_(0), snapshot_version_(0), ddl_type_(0), task_id_(0), parallelism_(0) {} + dest_schema_id_(OB_INVALID_ID), schema_version_(0), snapshot_version_(0), ddl_type_(0), task_id_(0), parallelism_(0), execution_id_(0) {} bool is_valid() const { return OB_INVALID_ID != tenant_id_ && ls_id_.is_valid() && source_tablet_id_.is_valid() && dest_tablet_id_.is_valid() && OB_INVALID_ID != source_table_id_ && OB_INVALID_ID != dest_schema_id_ && schema_version_ > 0 && snapshot_version_ > 0 @@ -7099,7 +7099,7 @@ public: } int assign(const ObDDLBuildSingleReplicaRequestArg &other); TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(source_tablet_id), K_(dest_tablet_id), - K_(source_table_id), K_(dest_schema_id), K_(schema_version), K_(snapshot_version), K_(task_id), K_(parallelism)); + K_(source_table_id), K_(dest_schema_id), K_(schema_version), K_(snapshot_version), K_(task_id), K_(parallelism), K_(execution_id)); public: uint64_t tenant_id_; share::ObLSID ls_id_; @@ -7112,6 +7112,7 @@ public: int64_t ddl_type_; int64_t task_id_; int64_t parallelism_; + int64_t execution_id_; }; struct ObDDLBuildSingleReplicaRequestResult final @@ -7133,12 +7134,15 @@ struct ObDDLBuildSingleReplicaResponseArg final OB_UNIS_VERSION(1); public: ObDDLBuildSingleReplicaResponseArg() - : tenant_id_(OB_INVALID_ID), ls_id_(), tablet_id_(), source_table_id_(), dest_schema_id_(OB_INVALID_ID), ret_code_(OB_SUCCESS), snapshot_version_(0), schema_version_(0), task_id_(0) + : tenant_id_(OB_INVALID_ID), ls_id_(), tablet_id_(), source_table_id_(), dest_schema_id_(OB_INVALID_ID), + ret_code_(OB_SUCCESS), snapshot_version_(0), schema_version_(0), task_id_(0), execution_id_(0) {} ~ObDDLBuildSingleReplicaResponseArg() = default; - bool is_valid() const { return OB_INVALID_ID != tenant_id_ && ls_id_.is_valid() && tablet_id_.is_valid() && OB_INVALID_ID != source_table_id_ && OB_INVALID_ID != dest_schema_id_ && snapshot_version_ > 0 && schema_version_ > 0 && task_id_ > 0; } + bool is_valid() const { return OB_INVALID_ID != tenant_id_ && ls_id_.is_valid() && tablet_id_.is_valid() + && OB_INVALID_ID != source_table_id_ && OB_INVALID_ID != dest_schema_id_ + && snapshot_version_ > 0 && schema_version_ > 0 && task_id_ > 0 && execution_id_ > 0; } int assign(const ObDDLBuildSingleReplicaResponseArg &other); - TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(tablet_id), K_(source_table_id), K_(dest_schema_id), K_(ret_code), K_(snapshot_version), K_(schema_version), K_(task_id)); + TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(tablet_id), K_(source_table_id), K_(dest_schema_id), K_(ret_code), K_(snapshot_version), K_(schema_version), K_(task_id), K_(execution_id)); public: uint64_t tenant_id_; share::ObLSID ls_id_; @@ -7149,6 +7153,7 @@ public: int64_t snapshot_version_; int64_t schema_version_; int64_t task_id_; + int64_t execution_id_; }; struct ObLogReqLoadProxyRequest @@ -7418,21 +7423,23 @@ public: const storage::ObITable::TableKey &table_key, const int64_t start_log_ts, const int64_t table_id, - const int64_t schema_version); + const int64_t execution_id, + const int64_t ddl_task_id); bool is_valid() const { return tenant_id_ != OB_INVALID_ID && ls_id_.is_valid() && table_key_.is_valid() && start_log_ts_ > 0 - && table_id_ > 0 && schema_version_ > 0; + && table_id_ > 0 && execution_id_ > 0 && ddl_task_id_ > 0; } TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(table_key), K_(start_log_ts), K_(table_id), - K_(schema_version)); + K_(execution_id), K_(ddl_task_id)); public: uint64_t tenant_id_; share::ObLSID ls_id_; storage::ObITable::TableKey table_key_; int64_t start_log_ts_; int64_t table_id_; - int64_t schema_version_; + int64_t execution_id_; + int64_t ddl_task_id_; private: DISALLOW_COPY_AND_ASSIGN(ObRpcRemoteWriteDDLPrepareLogArg); }; diff --git a/src/share/ob_thread_define.h b/src/share/ob_thread_define.h index a3d65ba23..471d4ba2d 100644 --- a/src/share/ob_thread_define.h +++ b/src/share/ob_thread_define.h @@ -38,7 +38,7 @@ TG_DEF(DDLQueueTh, DDLQueueTh, "", TG_STATIC, OB_THREAD_POOL, ThreadCountPair(ob TG_DEF(MysqlQueueTh, MysqlQueueTh, "", TG_STATIC, OB_THREAD_POOL, ThreadCountPair(GET_MYSQL_THREAD_COUNT(observer::ObSrvDeliver::MYSQL_TASK_THREAD_CNT), GET_MYSQL_THREAD_COUNT(observer::ObSrvDeliver::MINI_MODE_MYSQL_TASK_THREAD_CNT))) TG_DEF(DiagnoseQueueTh, DiagnoseQueueTh, "", TG_STATIC, OB_THREAD_POOL, ThreadCountPair(observer::ObSrvDeliver::MYSQL_DIAG_TASK_THREAD_CNT, observer::ObSrvDeliver::MINI_MODE_MYSQL_DIAG_TASK_THREAD_CNT)) TG_DEF(DdlBuild, DdlBuild, "", TG_STATIC, ASYNC_TASK_QUEUE, ThreadCountPair(16, 1), 4 << 10) -TG_DEF(LSService, LSService, "", TG_STATIC, REENTRANT_THREAD_POOL, ThreadCountPair(2 ,1)) +TG_DEF(LSService, LSService, "", TG_STATIC, REENTRANT_THREAD_POOL, ThreadCountPair(2 ,2)) TG_DEF(SimpleLSService, SimpleLSService, "", TG_STATIC, REENTRANT_THREAD_POOL, ThreadCountPair(1 ,1)) TG_DEF(IntermResGC, IntermResGC, "", TG_STATIC, TIMER) TG_DEF(ServerGTimer, ServerGTimer, "", TG_STATIC, TIMER) diff --git a/src/share/restore/ob_log_archive_source_mgr.h b/src/share/restore/ob_log_archive_source_mgr.h index baf4147b3..7172b4cde 100644 --- a/src/share/restore/ob_log_archive_source_mgr.h +++ b/src/share/restore/ob_log_archive_source_mgr.h @@ -44,7 +44,7 @@ public: // 1. nfs example // file:///data/1/ // 2. oss example - // oss://backup_dir/?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&access_key=222 + // oss://backup_dir/?host=xxx.com&access_id=111&access_key=222 // 3. cos example int add_location_source(const palf::SCN &recovery_until_scn, const ObString &archive_dest); // add source with raw pieces diff --git a/src/share/rpc/ob_async_rpc_proxy.h b/src/share/rpc/ob_async_rpc_proxy.h index c74dc8674..f1067b0f5 100644 --- a/src/share/rpc/ob_async_rpc_proxy.h +++ b/src/share/rpc/ob_async_rpc_proxy.h @@ -80,6 +80,7 @@ template void ObAsyncCB::on_timeout() { int ret = common::OB_SUCCESS; + RPC_LOG(WARN, "some error in rcode and enter on_timeout", K(AsyncCB::rcode_.rcode_)); AsyncCB::rcode_.rcode_ = common::OB_TIMEOUT; if (OB_FAIL(proxy_.receive_response())) { RPC_LOG(WARN, "proxy_ receive_response failed", K(ret)); diff --git a/src/share/scheduler/ob_dag_warning_history_mgr.h b/src/share/scheduler/ob_dag_warning_history_mgr.h index e9663accd..cdf3c80eb 100644 --- a/src/share/scheduler/ob_dag_warning_history_mgr.h +++ b/src/share/scheduler/ob_dag_warning_history_mgr.h @@ -357,7 +357,7 @@ template int ObInfoManager::get_with_no_lock(const Key key, Value *&ptr) { int ret = OB_SUCCESS; - int64_t node_index; + int64_t node_index = -1; ptr = NULL; if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; diff --git a/src/share/scheduler/ob_sys_task_stat.cpp b/src/share/scheduler/ob_sys_task_stat.cpp index a32654d0a..1ed92ca07 100644 --- a/src/share/scheduler/ob_sys_task_stat.cpp +++ b/src/share/scheduler/ob_sys_task_stat.cpp @@ -42,7 +42,7 @@ const char *sys_task_type_to_str(const ObSysTaskType &type) { STATIC_ASSERT(static_cast(MAX_SYS_TASK_TYPE) == ARRAYSIZEOF(ObSysTaskTypeStr), "sys_task_type str len is mismatch"); const char *str = ""; - if (OB_UNLIKELY(type < 0 || type > MAX_SYS_TASK_TYPE)) { + if (OB_UNLIKELY(type < 0 || type >= MAX_SYS_TASK_TYPE)) { str = "invalid task type"; } else { str = ObSysTaskTypeStr[type]; diff --git a/src/share/schema/ob_dblink_mgr.cpp b/src/share/schema/ob_dblink_mgr.cpp index 7f7ef29bb..add5fdba7 100644 --- a/src/share/schema/ob_dblink_mgr.cpp +++ b/src/share/schema/ob_dblink_mgr.cpp @@ -238,11 +238,12 @@ int ObDbLinkMgr::add_dblink(const ObDbLinkSchema &dblink_schema) LOG_WARN("failed to add dblink schema", K(ret)); } if (OB_SUCC(ret)) { - if (OB_FAIL(dblink_id_map_.set_refactored(new_dblink_schema->get_dblink_id(), + uint64_t dblink_id = new_dblink_schema->get_dblink_id(); + if (OB_FAIL(dblink_id_map_.set_refactored(dblink_id, new_dblink_schema, over_write))) { if (OB_HASH_EXIST != ret) { LOG_WARN("build dblink id hashmap failed", K(ret), - "dblink_id", new_dblink_schema->get_dblink_id()); + "dblink_id", dblink_id); } else { ret = OB_SUCCESS; } @@ -456,9 +457,7 @@ int ObDbLinkMgr::rebuild_dblink_hashmap() LOG_WARN("build dblink id hashmap failed", K(ret), "dblink_id", dblink_schema->get_dblink_id()); } else if (FALSE_IT(name_wrapper.set_tenant_id(dblink_schema->get_tenant_id()))) { - ; } else if (FALSE_IT(name_wrapper.set_dblink_name(dblink_schema->get_dblink_name()))) { - ; } else if (OB_FAIL(dblink_name_map_.set_refactored(name_wrapper, dblink_schema, over_write))) { LOG_WARN("build dblink name hashmap failed", K(ret), "dblink_name", dblink_schema->get_dblink_name()); diff --git a/src/share/schema/ob_schema_cache.cpp b/src/share/schema/ob_schema_cache.cpp index 69b6b952f..0e9ece8ac 100644 --- a/src/share/schema/ob_schema_cache.cpp +++ b/src/share/schema/ob_schema_cache.cpp @@ -752,7 +752,7 @@ int ObSchemaCache::put_tablet_cache( } else if (OB_FAIL(tablet_cache_.put(key, value))) { LOG_WARN("fail to put tablet cache", KR(ret), K(key), K(value)); } - LOG_INFO("put tablet-table cache", KR(ret), K(key), K(value)); + LOG_TRACE("put tablet-table cache", KR(ret), K(key), K(value)); return ret; } @@ -1127,8 +1127,8 @@ int ObSchemaFetcher::fetch_tenant_schema(uint64_t tenant_id, LOG_WARN("NULL ptr", K(tmp_tenant_schema), K(tenant_id), K(schema_version), K(ret)); } else { tenant_schema = tmp_tenant_schema; - LOG_INFO("fetch tenant schema succeed", K(tenant_id), K(schema_version), - "tenant_name", tenant_schema->get_tenant_name_str()); + LOG_TRACE("fetch tenant schema succeed", K(tenant_id), K(schema_version), + "tenant_name", tenant_schema->get_tenant_name_str()); } } @@ -1169,7 +1169,7 @@ int ObSchemaFetcher::fetch_sys_variable_schema( ret = OB_ERR_UNEXPECTED; LOG_WARN("sys_variable_schema is null", K(ret), K(tenant_id), K(schema_version), K(schema_status)); } else { - LOG_INFO("fetch sys variable schema succeed", K(tenant_id), K(schema_version), K(schema_status)); + LOG_TRACE("fetch sys variable schema succeed", K(tenant_id), K(schema_version), K(schema_status)); } return ret; @@ -1215,8 +1215,8 @@ int ObSchemaFetcher::fetch_database_schema(const ObRefreshSchemaStatus &schema_s LOG_WARN("NULL ptr", K(tmp_db_schema), K(database_id), K(schema_version), K(ret)); } else { database_schema = tmp_db_schema; - LOG_INFO("fetch database schema succeed", K(database_id), K(schema_version), - "database_name", database_schema->get_database_name_str()); + LOG_TRACE("fetch database schema succeed", K(database_id), K(schema_version), + "database_name", database_schema->get_database_name_str()); } } @@ -1249,8 +1249,8 @@ int ObSchemaFetcher::fetch_tablegroup_schema(const ObRefreshSchemaStatus &schema ret = OB_ERR_UNEXPECTED; LOG_WARN("NULL ptr", K(tablegroup_schema), K(tablegroup_id), K(schema_version), K(ret)); } else { - LOG_INFO("fetch tablegroup schema succeed", K(tablegroup_id), K(schema_version), - "tablegroup_name", tablegroup_schema->get_tablegroup_name()); + LOG_TRACE("fetch tablegroup schema succeed", K(tablegroup_id), K(schema_version), + "tablegroup_name", tablegroup_schema->get_tablegroup_name()); } return ret; } @@ -1285,8 +1285,8 @@ int ObSchemaFetcher::fetch_table_schema(const ObRefreshSchemaStatus &schema_stat LOG_WARN("NULL ptr", K(tmp_table_schema), K(table_id), K(schema_version), K(ret)); } else { table_schema = tmp_table_schema; - LOG_INFO("fetch table schema succeed", K(table_id), K(schema_version), - "table_name", table_schema->get_table_name_str()); + LOG_TRACE("fetch table schema succeed", K(table_id), K(schema_version), + "table_name", table_schema->get_table_name_str()); } return ret; @@ -1331,7 +1331,7 @@ int ObSchemaFetcher::fetch_table_schema(const ObRefreshSchemaStatus &schema_stat LOG_WARN("table schema is NULL", K(ret), K(table_id), K(schema_version)); } else { table_schema = tmp_table_schema; - LOG_INFO("fetch table schema succeed", K(ret), K(table_id), K(schema_version), KPC(table_schema)); + LOG_TRACE("fetch table schema succeed", K(ret), K(table_id), K(schema_version), KPC(table_schema)); } return ret; } @@ -1380,8 +1380,8 @@ int ObSchemaFetcher::fetch_##OBJECT_NAME##_info(const ObRefreshSchemaStatus &sch LOG_WARN(#OBJECT_NAME "object schema is NULL", K(ret)); \ } else { \ object_schema = tmp_object_schema; \ - LOG_INFO("fetch " #OBJECT_NAME " object info succeed", \ - K(object_id), K(schema_version), K(object_schema)); \ + LOG_TRACE("fetch " #OBJECT_NAME " object info succeed", \ + K(object_id), K(schema_version), K(object_schema)); \ } \ } \ return ret; \ diff --git a/src/share/schema/ob_schema_mgr.cpp b/src/share/schema/ob_schema_mgr.cpp index dce3561d3..fb7b78691 100644 --- a/src/share/schema/ob_schema_mgr.cpp +++ b/src/share/schema/ob_schema_mgr.cpp @@ -4528,12 +4528,15 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) ObSimpleTableSchemaV2 *table_schema = NULL; // It is expected that OB_HASH_EXIST should not appear in the rebuild process int over_write = 0; + int tmp_ret = OB_SUCCESS; + ObSimpleTableSchemaV2 *exist_schema = NULL; for (ConstTableIterator iter = table_infos_.begin(); iter != table_infos_.end() && OB_SUCC(ret); ++iter) { table_schema = *iter; - LOG_INFO("table_info is", "table_id", table_schema->get_table_id()); + exist_schema = NULL; + LOG_TRACE("table_info is", "table_id", table_schema->get_table_id()); if (OB_ISNULL(table_schema) || !table_schema->is_valid()) { ret = OB_ERR_UNEXPECTED; @@ -4556,7 +4559,14 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) over_write); if (OB_SUCCESS != hash_ret) { ret = OB_HASH_EXIST == hash_ret ? OB_SUCCESS : OB_ERR_UNEXPECTED; - LOG_ERROR("build hidden table name hashmap failed", K(ret), K(hash_ret), + tmp_ret = hidden_table_name_map_.get_refactored(table_name_wrapper, exist_schema); + LOG_ERROR("build hidden table name hashmap failed", + KR(ret), KR(hash_ret), K(tmp_ret), + "exist_table_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_id() : OB_INVALID_ID, + "exist_database_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_database_id() : OB_INVALID_ID, + "exist_session_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_session_id() : OB_INVALID_ID, + "exist_name_case_mode", OB_NOT_NULL(exist_schema) ? exist_schema->get_name_case_mode() : OB_NAME_CASE_INVALID, + "exist_table_name", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_name() : "", "table_id", table_schema->get_table_id(), "databse_id", table_schema->get_database_id(), "session_id", table_schema->get_session_id(), @@ -4568,9 +4578,9 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) if (OB_FAIL(table_schema->check_if_oracle_compat_mode(is_oracle_mode))) { LOG_WARN("fail to check if tenant mode is oracle mode", K(ret)); } else if (table_schema->is_index_table()) { - LOG_INFO("index is", "table_id", table_schema->get_table_id(), - "database_id", table_schema->get_database_id(), - "table_name", table_schema->get_table_name_str()); + LOG_TRACE("index is", "table_id", table_schema->get_table_id(), + "database_id", table_schema->get_database_id(), + "table_name", table_schema->get_table_name_str()); // oracle mode and index is not in recyclebin if (table_schema->is_in_recyclebin()) { ObIndexSchemaHashWrapper index_name_wrapper(table_schema->get_tenant_id(), @@ -4580,7 +4590,12 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) hash_ret = index_name_map_.set_refactored(index_name_wrapper, table_schema, over_write); if (OB_SUCCESS != hash_ret) { ret = OB_HASH_EXIST == hash_ret ? OB_SUCCESS : OB_ERR_UNEXPECTED; - LOG_ERROR("build index name hashmap failed", K(ret), K(hash_ret), + tmp_ret = index_name_map_.get_refactored(index_name_wrapper, exist_schema); + LOG_ERROR("build index name hashmap failed", + KR(ret), KR(hash_ret), K(tmp_ret), + "exist_table_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_id() : OB_INVALID_ID, + "exist_database_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_database_id() : OB_INVALID_ID, + "index_name", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_name() : "", "table_id", table_schema->get_table_id(), "databse_id", table_schema->get_database_id(), "index_name", table_schema->get_table_name()); @@ -4596,7 +4611,12 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) hash_ret = index_name_map_.set_refactored(cutted_index_name_wrapper, table_schema, over_write); if (OB_SUCCESS != hash_ret) { ret = OB_HASH_EXIST == hash_ret ? OB_SUCCESS : OB_ERR_UNEXPECTED; - LOG_ERROR("build index name hashmap failed", K(ret), K(hash_ret), + tmp_ret = index_name_map_.get_refactored(cutted_index_name_wrapper, exist_schema); + LOG_ERROR("build index name hashmap failed", + KR(ret), KR(hash_ret), K(tmp_ret), + "exist_table_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_id() : OB_INVALID_ID, + "exist_database_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_database_id() : OB_INVALID_ID, + "index_name", OB_NOT_NULL(exist_schema) ? exist_schema->get_origin_index_name_str() : "", "table_id", table_schema->get_table_id(), "databse_id", table_schema->get_database_id(), "index_name", table_schema->get_origin_index_name_str()); @@ -4604,16 +4624,21 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) } } } else if (table_schema->is_aux_vp_table()) { - LOG_INFO("aux_vp is", "table_id", table_schema->get_table_id(), - "database_id", table_schema->get_database_id(), - "table_name", table_schema->get_table_name_str()); + LOG_TRACE("aux_vp is", "table_id", table_schema->get_table_id(), + "database_id", table_schema->get_database_id(), + "table_name", table_schema->get_table_name_str()); ObAuxVPSchemaHashWrapper aux_vp_name_wrapper(table_schema->get_tenant_id(), table_schema->get_database_id(), table_schema->get_table_name_str()); hash_ret = aux_vp_name_map_.set_refactored(aux_vp_name_wrapper, table_schema, over_write); if (OB_SUCCESS != hash_ret) { ret = OB_HASH_EXIST == hash_ret ? OB_SUCCESS : OB_ERR_UNEXPECTED; - LOG_ERROR("build aux vp name hashmap failed", K(ret), K(hash_ret), + tmp_ret = aux_vp_name_map_.get_refactored(aux_vp_name_wrapper, exist_schema); + LOG_ERROR("build aux vp name hashmap failed", + KR(ret), KR(hash_ret), K(tmp_ret), + "exist_table_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_id() : OB_INVALID_ID, + "exist_database_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_database_id() : OB_INVALID_ID, + "index_name", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_name() : "", "table_id", table_schema->get_table_id(), "databse_id", table_schema->get_database_id(), "aux_vp_name", table_schema->get_table_name()); @@ -4621,8 +4646,8 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) } else if (table_schema->is_aux_lob_table()) { // do nothing } else { - LOG_INFO("table is", "table_id", table_schema->get_table_id(), - "database_id", table_schema->get_database_id(), + LOG_TRACE("table is", "table_id", table_schema->get_table_id(), + "database_id", table_schema->get_database_id(), "table_name", table_schema->get_table_name_str()); ObTableSchemaHashWrapper table_name_wrapper(table_schema->get_tenant_id(), table_schema->get_database_id(), @@ -4632,7 +4657,14 @@ int ObSchemaMgr::rebuild_table_hashmap(uint64_t &fk_cnt, uint64_t &cst_cnt) hash_ret = table_name_map_.set_refactored(table_name_wrapper, table_schema, over_write); if (OB_SUCCESS != hash_ret) { ret = OB_HASH_EXIST == hash_ret ? OB_SUCCESS : OB_ERR_UNEXPECTED; - LOG_ERROR("build table name hashmap failed", K(ret), K(hash_ret), + tmp_ret = table_name_map_.get_refactored(table_name_wrapper, exist_schema); + LOG_ERROR("build table name hashmap failed", + K(ret), K(hash_ret), K(tmp_ret), + "exist_table_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_id() : OB_INVALID_ID, + "exist_database_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_database_id() : OB_INVALID_ID, + "exist_session_id", OB_NOT_NULL(exist_schema) ? exist_schema->get_session_id() : OB_INVALID_ID, + "exist_name_case_mode", OB_NOT_NULL(exist_schema) ? exist_schema->get_name_case_mode() : OB_NAME_CASE_INVALID, + "exist_table_name", OB_NOT_NULL(exist_schema) ? exist_schema->get_table_name() : "", "table_id", table_schema->get_table_id(), "databse_id", table_schema->get_database_id(), "session_id", table_schema->get_session_id(), diff --git a/src/share/schema/ob_schema_struct.cpp b/src/share/schema/ob_schema_struct.cpp index 6ad3efc4d..34f3f5263 100644 --- a/src/share/schema/ob_schema_struct.cpp +++ b/src/share/schema/ob_schema_struct.cpp @@ -7442,7 +7442,10 @@ int ObPartitionUtils::set_low_bound_val_by_interval_range_by_innersql( } if (OB_SUCC(ret)) { SMART_VAR(ObMySQLProxy::MySQLResult, res) { - ObObj low_bound; + static int64_t ROW_KEY_CNT = 1; + ObObj obj_array[ROW_KEY_CNT]; + obj_array[0].reset(); + ObObj &low_bound = obj_array[0]; common::sqlclient::ObMySQLResult *result = NULL; if (OB_FAIL(sql_proxy->read(res, p.get_tenant_id(), sql_string.ptr()))) { LOG_WARN("execute sql failed", KR(ret), K(sql_string.ptr()), K(p), K(interval_range_val), @@ -7457,7 +7460,7 @@ int ObPartitionUtils::set_low_bound_val_by_interval_range_by_innersql( } else { ObRowkey low_bound_val; low_bound_val.reset(); - low_bound_val.assign(&low_bound, 1); + low_bound_val.assign(obj_array, ROW_KEY_CNT); if (OB_FAIL(p.set_low_bound_val(low_bound_val))) { LOG_WARN("fail to set low bound val", K(p), KR(ret)); } diff --git a/src/share/schema/ob_table_schema.cpp b/src/share/schema/ob_table_schema.cpp index be1e3a03d..365d6d95d 100644 --- a/src/share/schema/ob_table_schema.cpp +++ b/src/share/schema/ob_table_schema.cpp @@ -5070,7 +5070,22 @@ int ObTableSchema::get_generated_column_ids(ObIArray &column_ids) cons } return ret; } - +bool ObTableSchema::has_generated_and_partkey_column() const +{ + bool result = false; + if (has_generated_column() && is_partitioned_table() ) { + for (int64_t i = 0; i < generated_columns_.bit_count() && !result; ++i) { + if (generated_columns_.has_member(i)) { + uint64_t generated_column_id = i + OB_APP_MIN_COLUMN_ID; + const ObColumnSchemaV2 *generated_column = get_column_schema(generated_column_id); + if (generated_column->is_tbl_part_key_column()) { + result = true; + } + } + } + } + return result; +} // Because there are too many places to call this function, you must be careful when modifying this function, // and it is recommended not to modify // If you must modify this function, pay attention to whether the location of calling this function also depends on the error code diff --git a/src/share/schema/ob_table_schema.h b/src/share/schema/ob_table_schema.h index e0ffd77a6..30d75feff 100644 --- a/src/share/schema/ob_table_schema.h +++ b/src/share/schema/ob_table_schema.h @@ -1092,6 +1092,8 @@ public: int get_column_ids_without_rowkey(common::ObIArray &column_ids, const bool no_virtual = false) const; int get_generated_column_ids(common::ObIArray &column_ids) const; inline bool has_generated_column() const { return generated_columns_.num_members() > 0; } + // The table has a generated column that is a partition key. + bool has_generated_and_partkey_column() const; int add_base_table_id(uint64_t base_table_id) { return base_table_ids_.push_back(base_table_id); } int add_depend_table_id(uint64_t depend_table_id) { return depend_table_ids_.push_back(depend_table_id); } int add_depend_mock_fk_parent_table_id(uint64_t depend_table_id) { return depend_mock_fk_parent_table_ids_.push_back(depend_table_id); } @@ -1835,6 +1837,9 @@ inline bool ObSimpleTableSchemaV2::is_final_invalid_index() const { return is_final_invalid_index_status(index_status_); } + + + }//end of namespace schema }//end of namespace share }//end of namespace oceanbase diff --git a/src/sql/code_generator/ob_static_engine_cg.cpp b/src/sql/code_generator/ob_static_engine_cg.cpp index c5e35b194..f7a241245 100644 --- a/src/sql/code_generator/ob_static_engine_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_cg.cpp @@ -2556,6 +2556,8 @@ int ObStaticEngineCG::generate_basic_receive_spec(ObLogExchange &op, ObPxReceive spec.repartition_table_id_ = op.get_repartition_table_id(); if (OB_FAIL(spec.child_exprs_.init(spec.get_child()->output_.count()))) { LOG_WARN("failed to init child exprs", K(ret)); + } else if (spec.bloom_filter_id_array_.assign(op.get_bloom_filter_ids())) { + LOG_WARN("failed to append bloom filter ids", K(ret)); } else if (OB_FAIL(spec.child_exprs_.assign(spec.get_child()->output_))) { LOG_WARN("failed to append child exprs", K(ret)); } else if (OB_FAIL(init_recieve_dynamic_exprs(spec.get_child()->output_, spec))) { @@ -2945,6 +2947,7 @@ int ObStaticEngineCG::get_is_distributed(ObLogTempTableAccess &op, bool &is_dist { int ret = OB_SUCCESS; is_distributed = false; + ObLogicalOperator *parent = NULL; ObLogPlan *log_plan = op.get_plan(); const uint64_t temp_table_id = op.get_temp_table_id(); if (OB_ISNULL(log_plan)) { @@ -2954,14 +2957,26 @@ int ObStaticEngineCG::get_is_distributed(ObLogTempTableAccess &op, bool &is_dist ObIArray &temp_tables = log_plan->get_optimizer_context().get_temp_table_infos(); bool find = false; for (int64_t i = 0; OB_SUCC(ret) && !find && i < temp_tables.count(); ++i) { - if (OB_ISNULL(temp_tables.at(i))) { + if (OB_ISNULL(temp_tables.at(i)) || OB_ISNULL(temp_tables.at(i)->table_plan_)) { ret = OB_ERR_UNEXPECTED; LOG_ERROR("unexpected null", K(ret)); } else if (temp_table_id != temp_tables.at(i)->temp_table_id_) { /* do nothing */ + } else if (OB_ISNULL(parent = temp_tables.at(i)->table_plan_->get_parent())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected null", K(ret)); } else { find = true; - is_distributed = !temp_tables.at(i)->is_local_; + while (OB_NOT_NULL(parent)) { + if (log_op_def::LOG_EXCHANGE == parent->get_type()) { + is_distributed = true; + break; + } else if (log_op_def::LOG_TEMP_TABLE_TRANSFORMATION == parent->get_type()) { + break; + } else { + parent = parent->get_parent(); + } + } } } if (OB_SUCC(ret) && !find) { @@ -5953,8 +5968,15 @@ int ObStaticEngineCG::set_other_properties(const ObLogPlan &log_plan, ObPhysical if (log_plan.get_stmt()->get_table_items().count() > 0) { const TableItem *insert_table_item = log_plan.get_stmt()->get_table_item(0); if (nullptr != insert_table_item) { + int64_t ddl_execution_id = 0; + int64_t ddl_task_id = 0; + const ObOptParamHint *opt_params = &log_plan.get_stmt()->get_query_ctx()->get_global_hint().opt_params_; + OZ(opt_params->get_integer_opt_param(ObOptParamHint::DDL_EXECUTION_ID, ddl_execution_id)); + OZ(opt_params->get_integer_opt_param(ObOptParamHint::DDL_TASK_ID, ddl_task_id)); phy_plan.set_ddl_schema_version(insert_table_item->ddl_schema_version_); phy_plan.set_ddl_table_id(insert_table_item->ddl_table_id_); + phy_plan.set_ddl_execution_id(ddl_execution_id); + phy_plan.set_ddl_task_id(ddl_task_id); } } } diff --git a/src/sql/das/ob_das_batch_scan_op.cpp b/src/sql/das/ob_das_batch_scan_op.cpp index 165056cd5..ea7fc8e0b 100644 --- a/src/sql/das/ob_das_batch_scan_op.cpp +++ b/src/sql/das/ob_das_batch_scan_op.cpp @@ -60,9 +60,7 @@ int ObDASBatchScanOp::open_op() if (OB_FAIL(init_scan_param())) { LOG_WARN("init scan param failed", K(ret)); } else if (OB_FAIL(tsc_service.table_scan(scan_param_, batch_result_))) { - if (OB_SNAPSHOT_DISCARDED == ret - && transaction::ObTransVersion::INVALID_TRANS_VERSION != - scan_param_.fb_snapshot_) { + if (OB_SNAPSHOT_DISCARDED == ret && scan_param_.fb_snapshot_.is_valid()) { ret = OB_INVALID_QUERY_TIMESTAMP; } else if (OB_TRY_LOCK_ROW_CONFLICT != ret) { LOG_WARN("fail to scan table", K(scan_param_), K(ret)); diff --git a/src/sql/das/ob_das_scan_op.cpp b/src/sql/das/ob_das_scan_op.cpp index 5660e824a..22cd3506d 100644 --- a/src/sql/das/ob_das_scan_op.cpp +++ b/src/sql/das/ob_das_scan_op.cpp @@ -264,9 +264,7 @@ int ObDASScanOp::open_op() if (OB_FAIL(init_scan_param())) { LOG_WARN("init scan param failed", K(ret)); } else if (OB_FAIL(tsc_service.table_scan(scan_param_, result_))) { - if (OB_SNAPSHOT_DISCARDED == ret - && transaction::ObTransVersion::INVALID_TRANS_VERSION != - scan_param_.fb_snapshot_) { + if (OB_SNAPSHOT_DISCARDED == ret && scan_param_.fb_snapshot_.is_valid()) { ret = OB_INVALID_QUERY_TIMESTAMP; } else if (OB_TRY_LOCK_ROW_CONFLICT != ret) { LOG_WARN("fail to scan table", K(scan_param_), K(ret)); @@ -1064,9 +1062,7 @@ OB_INLINE int ObLocalIndexLookupOp::do_index_lookup() LOG_WARN("init scan param failed", K(ret)); } else if (OB_FAIL(tsc_service.table_scan(scan_param_, storage_iter))) { - if (OB_SNAPSHOT_DISCARDED == ret - && transaction::ObTransVersion::INVALID_TRANS_VERSION != - scan_param_.fb_snapshot_) { + if (OB_SNAPSHOT_DISCARDED == ret && scan_param_.fb_snapshot_.is_valid()) { ret = OB_INVALID_QUERY_TIMESTAMP; } else if (OB_TRY_LOCK_ROW_CONFLICT != ret) { LOG_WARN("fail to scan table", K(scan_param_), K(ret)); diff --git a/src/sql/das/ob_das_scan_op.h b/src/sql/das/ob_das_scan_op.h index 2d2735fdb..8814569af 100644 --- a/src/sql/das/ob_das_scan_op.h +++ b/src/sql/das/ob_das_scan_op.h @@ -92,7 +92,7 @@ public: force_refresh_lc_(false), need_check_output_datum_(false), frozen_version_(-1), - fb_snapshot_(transaction::ObTransVersion::INVALID_TRANS_VERSION), + fb_snapshot_(), timeout_ts_(-1), tx_lock_timeout_(-1), sql_mode_(SMO_DEFAULT), @@ -123,7 +123,7 @@ public: bool force_refresh_lc_; bool need_check_output_datum_; int64_t frozen_version_; - int64_t fb_snapshot_; + palf::SCN fb_snapshot_; int64_t timeout_ts_; int64_t tx_lock_timeout_; ObSQLMode sql_mode_; diff --git a/src/sql/das/ob_das_task_result.cpp b/src/sql/das/ob_das_task_result.cpp index 536541759..3d2105784 100644 --- a/src/sql/das/ob_das_task_result.cpp +++ b/src/sql/das/ob_das_task_result.cpp @@ -174,7 +174,7 @@ int ObDASTaskResultMgr::save_task_result(int64_t task_id, } if (OB_FAIL(ret)) { // do nothing - } else if (OB_FAIL(datum_store.init(INT64_MAX, + } else if (OB_FAIL(datum_store.init(4 * 1024 * 1024, // 4MB MTL_ID(), common::ObCtxIds::DEFAULT_CTX_ID, "ObDASTaskResultMgr", diff --git a/src/sql/engine/cmd/ob_alter_system_executor.cpp b/src/sql/engine/cmd/ob_alter_system_executor.cpp index 34f9d22a8..ec4dba55b 100644 --- a/src/sql/engine/cmd/ob_alter_system_executor.cpp +++ b/src/sql/engine/cmd/ob_alter_system_executor.cpp @@ -1570,6 +1570,10 @@ int ObChangeTenantExecutor::execute(ObExecContext &ctx, ObChangeTenantStmt &stmt } else if (OB_FAIL(schema_guard.check_db_access(session_priv, database_name))) { // case 3 LOG_WARN("fail to check db access", KR(ret), K(pre_effective_tenant_id), K(session_priv), K(database_name)); + } else if (session_info->get_ps_session_info_size() > 0) { // case 4 + ret = OB_OP_NOT_ALLOW; + LOG_WARN("chang tenant is not allow when prepared stmt already opened in session", KR(ret), KPC(session_info)); + LOG_USER_ERROR(OB_OP_NOT_ALLOW, "change tenant when has prepared stmt already opened in session"); } else { // switch connection if (OB_SUCC(ret)) { diff --git a/src/sql/engine/expr/ob_expr_oracle_decode.cpp b/src/sql/engine/expr/ob_expr_oracle_decode.cpp index 1001bdb34..c751e7db5 100644 --- a/src/sql/engine/expr/ob_expr_oracle_decode.cpp +++ b/src/sql/engine/expr/ob_expr_oracle_decode.cpp @@ -231,39 +231,46 @@ int ObExprOracleDecode::calc_result_typeN(ObExprResType &type, for (int64_t i = 0; OB_SUCC(ret) && i < param_num; i++) { all_literal = all_literal & types_stack[i].is_literal(); ObObjOType o_type = ob_obj_type_to_oracle_type(types_stack[i].get_calc_type()); - if (0 == i || ((i % 2) == 1 && i != param_num - 1)) { // expr and search - // 通过隐式转换矩阵判断两个类型间是否可以进行转换 - dir = OB_OBJ_IMPLICIT_CAST_DIRECTION_FOR_ORACLE[o_type][o_calc_type]; - } else { // result and default - dir = OB_OBJ_IMPLICIT_CAST_DIRECTION_FOR_ORACLE[o_type][o_result_type]; - } - if (ImplicitCastDirection::IC_NOT_SUPPORT == dir) { - ret = OB_ERR_INVALID_TYPE_FOR_OP; - LOG_WARN("invalid oracle type implict cast", - K(ret), K(o_calc_type), K(o_result_type), K(o_type), K(i)); + if (o_type >= ObOMaxType || o_result_type >= ObOMaxType || o_calc_type >= ObOMaxType) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("invalid oracle obj type", K(o_type), K(o_result_type), K(o_calc_type)); + } else { + if (0 == i || ((i % 2) == 1 && i != param_num - 1)) { // expr and search + // 通过隐式转换矩阵判断两个类型间是否可以进行转换 + dir = OB_OBJ_IMPLICIT_CAST_DIRECTION_FOR_ORACLE[o_type][o_calc_type]; + } else { // result and default + dir = OB_OBJ_IMPLICIT_CAST_DIRECTION_FOR_ORACLE[o_type][o_result_type]; + } + if (ImplicitCastDirection::IC_NOT_SUPPORT == dir) { + ret = OB_ERR_INVALID_TYPE_FOR_OP; + LOG_WARN("invalid oracle type implict cast", + K(ret), K(o_calc_type), K(o_result_type), K(o_type), K(i)); + } } } } - if (ob_is_otimestamp_type(types_stack[RESULT_TYPE_INDEX].get_type())) { - type.set_accuracy(types_stack[RESULT_TYPE_INDEX].get_accuracy()); - } - //deduce string length - if (ob_is_string_type(type.get_type()) || ob_is_raw(type.get_type())) { - ObLength len = -1; - for (int64_t i = 2; i < param_num; i += 2 /*skip conditions */) { - if (types_stack[i].get_length() > len) { - len = types_stack[i].get_length(); - } + if (OB_SUCC(ret)) { + if (ob_is_otimestamp_type(types_stack[RESULT_TYPE_INDEX].get_type())) { + type.set_accuracy(types_stack[RESULT_TYPE_INDEX].get_accuracy()); } - if (has_default) { - len = static_cast(MAX(types_stack[param_num - 1].get_length(), len)); - } - if (all_literal && lib::is_oracle_mode()) { - if (OB_FAIL(calc_result_type_for_literal(type, types_stack, param_num, type_ctx))) { - LOG_WARN("failed to calc result for literal", K(ret)); + //deduce string length + if (ob_is_string_type(type.get_type()) || ob_is_raw(type.get_type())) { + ObLength len = -1; + for (int64_t i = 2; i < param_num; i += 2 /*skip conditions */) { + if (types_stack[i].get_length() > len) { + len = types_stack[i].get_length(); + } + } + if (has_default) { + len = static_cast(MAX(types_stack[param_num - 1].get_length(), len)); + } + if (all_literal && lib::is_oracle_mode()) { + if (OB_FAIL(calc_result_type_for_literal(type, types_stack, param_num, type_ctx))) { + LOG_WARN("failed to calc result for literal", K(ret)); + } + } else { + type.set_length(len); } - } else { - type.set_length(len); } } if (OB_SUCC(ret)) { diff --git a/src/sql/engine/expr/ob_expr_user_can_access_obj.cpp b/src/sql/engine/expr/ob_expr_user_can_access_obj.cpp index 1284db9e8..3ec0b5ca8 100644 --- a/src/sql/engine/expr/ob_expr_user_can_access_obj.cpp +++ b/src/sql/engine/expr/ob_expr_user_can_access_obj.cpp @@ -202,9 +202,9 @@ int ObExprUserCanAccessObj::build_real_obj_type_for_sym( if (package_id != OB_INVALID_ID) { obj_type = static_cast(share::schema::ObObjectType::PACKAGE); obj_id = package_id; + } else { + ret = OB_TABLE_NOT_EXIST; } - } else { - ret = OB_TABLE_NOT_EXIST; } } @@ -217,9 +217,9 @@ int ObExprUserCanAccessObj::build_real_obj_type_for_sym( if (udt_id != OB_INVALID_ID) { obj_type = static_cast(share::schema::ObObjectType::TYPE); obj_id = udt_id; + } else { + ret = OB_TABLE_NOT_EXIST; } - } else { - ret = OB_TABLE_NOT_EXIST; } } } diff --git a/src/sql/engine/join/ob_join_filter_op.cpp b/src/sql/engine/join/ob_join_filter_op.cpp index fddad3fe8..18f76cb59 100644 --- a/src/sql/engine/join/ob_join_filter_op.cpp +++ b/src/sql/engine/join/ob_join_filter_op.cpp @@ -518,6 +518,7 @@ int ObJoinFilterOp::mark_rpc_filter() filter_data->bloom_filter_count_ = 0; ctx_.get_bf_ctx().filter_data_ = filter_data; ctx_.get_bf_ctx().filter_ready_ = true; + ctx_.get_bf_ctx().filter_id_ = MY_SPEC.filter_id_; ctx_.get_bf_ctx().ch_set_.reset(); ctx_.get_bf_ctx().ch_provider_ptr_ = filter_input_->share_info_.ch_provider_ptr_; } diff --git a/src/sql/engine/ob_exec_context.cpp b/src/sql/engine/ob_exec_context.cpp index 11abf7147..beeaf4be7 100644 --- a/src/sql/engine/ob_exec_context.cpp +++ b/src/sql/engine/ob_exec_context.cpp @@ -99,6 +99,7 @@ ObExecContext::ObExecContext(ObIAllocator &allocator) is_direct_local_plan_(false), sqc_handler_(nullptr), px_task_id_(-1), + px_sqc_id_(-1), bf_ctx_(), frames_(NULL), frame_cnt_(0), diff --git a/src/sql/engine/ob_exec_context.h b/src/sql/engine/ob_exec_context.h index 0e6af67d0..4509b9179 100644 --- a/src/sql/engine/ob_exec_context.h +++ b/src/sql/engine/ob_exec_context.h @@ -388,6 +388,8 @@ public: void set_sqc_handler(ObPxSqcHandler *sqc_handler) { sqc_handler_ = sqc_handler; } void set_px_task_id(const int64_t task_id) { px_task_id_ = task_id; } int64_t get_px_task_id() const { return px_task_id_; } + void set_px_sqc_id(const int64_t sqc_id) { px_sqc_id_ = sqc_id; } + int64_t get_px_sqc_id() const { return px_sqc_id_; } ObJoinFilterDataCtx &get_bf_ctx() { return bf_ctx_; } @@ -553,6 +555,7 @@ protected: // for ddl sstable insert int64_t px_task_id_; + int64_t px_sqc_id_; //bloom filter ctx ObJoinFilterDataCtx bf_ctx_; diff --git a/src/sql/engine/ob_physical_plan.cpp b/src/sql/engine/ob_physical_plan.cpp index 90f704b5a..dc2bd3eb5 100644 --- a/src/sql/engine/ob_physical_plan.cpp +++ b/src/sql/engine/ob_physical_plan.cpp @@ -115,6 +115,8 @@ ObPhysicalPlan::ObPhysicalPlan(MemoryContext &mem_context /* = CURRENT_CONTEXT * contain_pl_udf_or_trigger_(false), ddl_schema_version_(0), ddl_table_id_(0), + ddl_execution_id_(0), + ddl_task_id_(0), is_packed_(false), has_instead_of_trigger_(false) { @@ -738,7 +740,9 @@ OB_SERIALIZE_MEMBER(ObPhysicalPlan, contain_pl_udf_or_trigger_, is_packed_, has_instead_of_trigger_, - is_plain_insert_); + is_plain_insert_, + ddl_execution_id_, + ddl_task_id_); int ObPhysicalPlan::set_table_locations(const ObTablePartitionInfoArray &infos, ObSchemaGetterGuard &schema_guard) diff --git a/src/sql/engine/ob_physical_plan.h b/src/sql/engine/ob_physical_plan.h index 60802fb70..ccfd9dd7b 100644 --- a/src/sql/engine/ob_physical_plan.h +++ b/src/sql/engine/ob_physical_plan.h @@ -135,6 +135,7 @@ public: } int64_t get_evo_perf() const; int64_t get_cpu_time() const { return stat_.evolution_stat_.cpu_time_; } + int64_t get_elapsed_time() const { return stat_.evolution_stat_.elapsed_time_; } int64_t get_executions() const { return stat_.evolution_stat_.executions_; } void set_evolution(bool v) { stat_.is_evolution_ = v; } bool get_evolution() const { return stat_.is_evolution_; } @@ -330,6 +331,10 @@ public: inline int64_t get_ddl_schema_version() const { return ddl_schema_version_; } inline void set_ddl_table_id(const int64_t ddl_table_id) { ddl_table_id_ = ddl_table_id; } inline int64_t get_ddl_table_id() const { return ddl_table_id_; } + inline void set_ddl_execution_id(const int64_t ddl_execution_id) { ddl_execution_id_ = ddl_execution_id; } + inline int64_t get_ddl_execution_id() const { return ddl_execution_id_; } + inline void set_ddl_task_id(const int64_t ddl_task_id) { ddl_task_id_ = ddl_task_id; } + inline int64_t get_ddl_task_id() const { return ddl_task_id_; } public: int inc_concurrent_num(); void dec_concurrent_num(); @@ -579,6 +584,8 @@ public: bool contain_pl_udf_or_trigger_;//mark if need sync pkg variables int64_t ddl_schema_version_; int64_t ddl_table_id_; + int64_t ddl_execution_id_; + int64_t ddl_task_id_; //parallel encoding of output_expr in advance to speed up packet response bool is_packed_; bool has_instead_of_trigger_; // mask if has instead of trigger on view diff --git a/src/sql/engine/pdml/static/ob_px_sstable_insert_op.cpp b/src/sql/engine/pdml/static/ob_px_sstable_insert_op.cpp index 3d4b2e43c..e2901cb22 100644 --- a/src/sql/engine/pdml/static/ob_px_sstable_insert_op.cpp +++ b/src/sql/engine/pdml/static/ob_px_sstable_insert_op.cpp @@ -201,6 +201,7 @@ int ObPxMultiPartSSTableInsertOp::inner_get_next_row() write_sstable_param.write_major_ = true; write_sstable_param.task_cnt_ = ctx_.get_sqc_handler()->get_sqc_ctx().get_task_count(); write_sstable_param.schema_version_ = MY_SPEC.plan_->get_ddl_schema_version(); + write_sstable_param.execution_id_ = MY_SPEC.plan_->get_ddl_execution_id(); if (OB_FAIL(block_start_seq.set_parallel_degree(ddl_task_id_))) { LOG_WARN("set parallel index failed", K(ret), K(ddl_task_id_)); } diff --git a/src/sql/engine/px/exchange/ob_px_receive_op.cpp b/src/sql/engine/px/exchange/ob_px_receive_op.cpp index d3d642f04..059b020ad 100644 --- a/src/sql/engine/px/exchange/ob_px_receive_op.cpp +++ b/src/sql/engine/px/exchange/ob_px_receive_op.cpp @@ -99,13 +99,15 @@ OB_SERIALIZE_MEMBER((ObPxFifoReceiveSpec, ObPxReceiveSpec)); OB_SERIALIZE_MEMBER((ObPxReceiveSpec, ObReceiveSpec), child_exprs_, repartition_table_id_, - dynamic_const_exprs_); + dynamic_const_exprs_, + bloom_filter_id_array_); ObPxReceiveSpec::ObPxReceiveSpec(common::ObIAllocator &alloc, const ObPhyOperatorType type) : ObReceiveSpec(alloc, type), child_exprs_(alloc), repartition_table_id_(OB_INVALID_ID), - dynamic_const_exprs_(alloc) + dynamic_const_exprs_(alloc), + bloom_filter_id_array_(alloc) { repartition_table_id_ = 0; } @@ -625,7 +627,7 @@ int ObPxFifoReceiveOp::fetch_rows(const int64_t row_cnt) ObPhysicalPlanCtx *phy_plan_ctx = GET_PHY_PLAN_CTX(ctx_); if (OB_FAIL(try_link_channel())) { LOG_WARN("failed to init channel", K(ret)); - } else if (ctx_.get_bf_ctx().filter_ready_ && OB_FAIL(ObPxMsgProc::mark_rpc_filter(ctx_))) { + } else if (need_send_bloom_filter() && OB_FAIL(ObPxMsgProc::mark_rpc_filter(ctx_))) { LOG_WARN("fail to send rpc bloom filter", K(ret)); } else if (OB_FAIL(try_send_bloom_filter())) { LOG_WARN("fail to try send bloom filter", K(ret)); diff --git a/src/sql/engine/px/exchange/ob_px_receive_op.h b/src/sql/engine/px/exchange/ob_px_receive_op.h index e169ade75..2a42800db 100644 --- a/src/sql/engine/px/exchange/ob_px_receive_op.h +++ b/src/sql/engine/px/exchange/ob_px_receive_op.h @@ -77,6 +77,7 @@ public: ExprFixedArray child_exprs_; int64_t repartition_table_id_; ExprFixedArray dynamic_const_exprs_; // const expr which contain dynamic param + common::ObFixedArray bloom_filter_id_array_; //record bloom filter id will send by this pxreceive op. }; class ObPxReceiveOp : public ObReceiveOp @@ -155,6 +156,20 @@ public: } return ts_; } +protected: + OB_INLINE bool need_send_bloom_filter() { + bool is_match = false; + int64_t filter_id = ctx_.get_bf_ctx().filter_id_; + if (ctx_.get_bf_ctx().filter_ready_) { + for (int64_t i = 0; i < (static_cast(get_spec())).bloom_filter_id_array_.count(); ++i) { + if (filter_id == (static_cast(get_spec())).bloom_filter_id_array_.at(i)) { + is_match = true; + break; + } + } + } + return is_match; + } protected: ObPxTaskChSet task_ch_set_; bool iter_end_; diff --git a/src/sql/engine/px/ob_px_dtl_msg.h b/src/sql/engine/px/ob_px_dtl_msg.h index 6fd23d7e8..bb50f29e8 100644 --- a/src/sql/engine/px/ob_px_dtl_msg.h +++ b/src/sql/engine/px/ob_px_dtl_msg.h @@ -491,7 +491,7 @@ public: struct ObJoinFilterDataCtx { ObJoinFilterDataCtx() - : ch_set_(), ch_set_info_(), filter_ready_(false), filter_data_(NULL), ch_provider_ptr_(0), + : ch_set_(), ch_set_info_(), filter_ready_(false), filter_data_(NULL), ch_provider_ptr_(0), filter_id_(common::OB_INVALID_ID), compressor_type_(common::ObCompressorType::NONE_COMPRESSOR) {} ~ObJoinFilterDataCtx() = default; ObPxBloomFilterChSet ch_set_; @@ -499,6 +499,7 @@ struct ObJoinFilterDataCtx bool filter_ready_; ObPxBloomFilterData *filter_data_; uint64_t ch_provider_ptr_; + int64_t filter_id_; common::ObCompressorType compressor_type_; }; diff --git a/src/sql/engine/px/ob_px_sub_coord.cpp b/src/sql/engine/px/ob_px_sub_coord.cpp index e697d46db..9e242009b 100644 --- a/src/sql/engine/px/ob_px_sub_coord.cpp +++ b/src/sql/engine/px/ob_px_sub_coord.cpp @@ -814,6 +814,8 @@ int ObPxSubCoord::start_ddl() param.task_cnt_ = sqc_arg_.sqc_.get_task_count(); param.write_major_ = true; param.exec_ctx_ = exec_ctx; + param.execution_id_ = phy_plan->get_ddl_execution_id(); + param.ddl_task_id_ = phy_plan->get_ddl_task_id(); if (OB_FAIL(ObSSTableInsertManager::get_instance().create_table_context(param, ddl_ctrl_.context_id_))) { LOG_WARN("create table context failed", K(ret)); } else { diff --git a/src/sql/engine/px/ob_px_task_process.cpp b/src/sql/engine/px/ob_px_task_process.cpp index 3e1b8c60f..f724ef1d0 100644 --- a/src/sql/engine/px/ob_px_task_process.cpp +++ b/src/sql/engine/px/ob_px_task_process.cpp @@ -156,6 +156,7 @@ int ObPxTaskProcess::process() arg_.exec_ctx_->reference_my_plan(arg_.des_phy_plan_); arg_.exec_ctx_->set_sqc_handler(arg_.sqc_handler_); arg_.exec_ctx_->set_px_task_id(arg_.task_.get_task_id()); + arg_.exec_ctx_->set_px_sqc_id(arg_.task_.get_sqc_id()); ObMaxWaitGuard max_wait_guard(enable_perf_event ? &max_wait_desc : NULL); ObTotalWaitGuard total_wait_guard(enable_perf_event ? &total_wait_desc : NULL); diff --git a/src/sql/engine/table/ob_link_scan_op.cpp b/src/sql/engine/table/ob_link_scan_op.cpp index 48ed418b2..77385204c 100644 --- a/src/sql/engine/table/ob_link_scan_op.cpp +++ b/src/sql/engine/table/ob_link_scan_op.cpp @@ -517,6 +517,7 @@ int ObLinkScanOp::inner_get_next_row() const ObIArray &output = spec_.output_; for (int64_t i = 0; OB_SUCC(ret) && i < output.count(); i++) { ObObj value; + ObObj new_value; ObObj *res_obj = &value; ObExpr *expr = output.at(i); ObDatum &datum = expr->locate_datum_for_write(eval_ctx_); @@ -528,7 +529,6 @@ int ObLinkScanOp::inner_get_next_row() ob_is_string_or_lob_type(expr->obj_meta_.get_type()) && value.get_type() == expr->obj_meta_.get_type() && value.get_collation_type() != expr->obj_meta_.get_collation_type())))) { - ObObj new_value; DEFINE_CAST_CTX(expr->datum_meta_.cs_type_); if (OB_FAIL(ObObjCaster::to_type(expr->obj_meta_.get_type(), cast_ctx, value, new_value))) { LOG_WARN("cast obj failed", K(ret), K(value), K(expr->obj_meta_)); diff --git a/src/sql/engine/table/ob_table_scan_op.cpp b/src/sql/engine/table/ob_table_scan_op.cpp index a66288acf..f16f05183 100644 --- a/src/sql/engine/table/ob_table_scan_op.cpp +++ b/src/sql/engine/table/ob_table_scan_op.cpp @@ -38,7 +38,6 @@ namespace sql int FlashBackItem::set_flashback_query_info(ObEvalCtx &eval_ctx, ObDASScanRtDef &scan_rtdef) const { int ret = OB_SUCCESS; - int64_t time_val = transaction::ObTransVersion::INVALID_TRANS_VERSION; ObDatum *datum = NULL; const ObExpr *expr = flashback_query_expr_; scan_rtdef.need_scn_ = need_scn_; @@ -57,31 +56,27 @@ int FlashBackItem::set_flashback_query_info(ObEvalCtx &eval_ctx, ObDASScanRtDef if (ObTimestampTZType != expr->datum_meta_.type_) { ret = OB_ERR_UNEXPECTED; LOG_WARN("type not match", K(ret)); + } else if (OB_FAIL(scan_rtdef.fb_snapshot_.convert_from_ts(datum->get_otimestamp_tz().time_us_))) { + LOG_WARN("failed to convert from ts", K(ret)); } else { - // tx snapshot version are in nanosecond - time_val = datum->get_otimestamp_tz().time_us_ * 1000; - LOG_TRACE("timestamp_val result", K(time_val), K(*datum)); + LOG_TRACE("fb_snapshot_ result", K(scan_rtdef.fb_snapshot_), K(*datum)); } } else if (TableItem::USING_SCN == flashback_query_type_) { if (ObUInt64Type != expr->datum_meta_.type_) { ret = OB_ERR_UNEXPECTED; LOG_WARN("type not match", K(ret)); + } else if (OB_FAIL(scan_rtdef.fb_snapshot_.convert_for_gts(datum->get_int()))) { + LOG_WARN("failed to convert for gts", K(ret)); } else { - time_val = datum->get_int(); - LOG_TRACE("timestamp_val result", K(time_val), K(*datum)); + LOG_TRACE("fb_snapshot_ result", K(scan_rtdef.fb_snapshot_), K(*datum)); } } - - if (OB_SUCC(ret)) { - scan_rtdef.fb_snapshot_ = time_val; - } } //对于同时存在hint指定的frozen_version和flashback query指定了snapshot version的情况下, 选择保留 //flashback query指定的snapshot version, 忽略hint指定的frozen_version if (OB_SUCC(ret)) { - if (scan_rtdef.fb_snapshot_ - != transaction::ObTransVersion::INVALID_TRANS_VERSION) { + if (scan_rtdef.fb_snapshot_.is_valid()) { scan_rtdef.frozen_version_ = transaction::ObTransVersion::INVALID_TRANS_VERSION; } else { /*do nothing*/ @@ -2311,12 +2306,12 @@ int ObTableScanOp::report_ddl_column_checksum() const uint64_t table_id = MY_CTDEF.scan_ctdef_.ref_table_id_; for (int64_t i = 0; OB_SUCC(ret) && i < MY_SPEC.ddl_output_cids_.count(); ++i) { ObDDLChecksumItem item; - item.execution_id_ = MY_SPEC.plan_->get_ddl_schema_version(); + item.execution_id_ = MY_SPEC.plan_->get_ddl_execution_id(); item.tenant_id_ = MTL_ID(); item.table_id_ = table_id; - item.tablet_id_ = tablet_id.id(); + item.ddl_task_id_ = MY_SPEC.plan_->get_ddl_task_id(); item.column_id_ = MY_SPEC.ddl_output_cids_.at(i); - item.task_id_ = ctx_.get_px_task_id() << 32 | curr_scan_task_id; + item.task_id_ = ctx_.get_px_sqc_id() << 48 | ctx_.get_px_task_id() << 32 | curr_scan_task_id; item.checksum_ = i < column_checksum_.count() ? column_checksum_[i] : 0; #ifdef ERRSIM if (OB_SUCC(ret)) { diff --git a/src/sql/ob_spi.cpp b/src/sql/ob_spi.cpp index 0e9e6f9e4..d8bba06b8 100644 --- a/src/sql/ob_spi.cpp +++ b/src/sql/ob_spi.cpp @@ -1209,7 +1209,8 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx, const bool *exprs_not_null_flag, const int64_t *pl_integer_ranges, int64_t is_bulk, - bool is_forall) + bool is_forall, + int32_t array_binding_count) { int ret = OB_SUCCESS; ObWarningBuffer* wb = NULL; @@ -1231,7 +1232,7 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx, if (OB_SUCC(ret) && is_forall && !session->is_enable_batched_multi_statement()) { /* forall need rollback to for loop */ ret = OB_BATCHED_MULTI_STMT_ROLLBACK; - LOG_TRACE("cannot batch execute", K(ret)); + LOG_TRACE("cannot batch execute", K(ret), K(sql), K(type)); } HEAP_VAR(ObSPIResultSet, spi_result) { stmt::StmtType stmt_type = stmt::T_NONE; @@ -1293,7 +1294,8 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx, into_count, spi_result.get_mysql_result(), out_params, - is_forall))) { + is_forall, + array_binding_count))) { LOG_WARN("failed to open", K(id), K(type), K(ret)); } else if (OB_FAIL(inner_fetch(ctx, retry_ctrl, @@ -1660,13 +1662,15 @@ int ObSPIService::spi_execute(ObPLExecCtx *ctx, const bool *exprs_not_null_flag, const int64_t *pl_integer_ranges, bool is_bulk, - bool is_forall) + bool is_forall, + int32_t array_binding_count) { int ret = OB_SUCCESS; FLTSpanGuard(pl_spi_execute); OZ (spi_inner_execute(ctx, NULL, id, type, param_exprs, param_count, into_exprs, into_count, column_types, type_count, - exprs_not_null_flag, pl_integer_ranges, is_bulk, is_forall)); + exprs_not_null_flag, pl_integer_ranges, is_bulk, + is_forall, array_binding_count)); return ret; } @@ -3702,10 +3706,6 @@ int ObSPIService::spi_cursor_fetch(ObPLExecCtx *ctx, limit)); if (lib::is_mysql_mode() || OB_READ_NOTHING != ret) { - if (lib::is_mysql_mode() && OB_READ_NOTHING == ret) { - ret = OB_ERR_SP_FETCH_NO_DATA; - LOG_WARN("No data found", K(ret)); - } //Oracle模式的cursor发生NOT FOUND错误的时候不对外报错,而是把错误信息记录在CURSOR上,PL的CG会吞掉这个错误 SET_SPI_STATUS; } @@ -4773,7 +4773,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, int64_t into_count, ObMySQLProxy::MySQLResult &mysql_result, ObSPIOutParams &out_params, - bool is_forall) + bool is_forall, + int32_t array_binding_count) { int ret = OB_SUCCESS; int64_t query_num = 0; @@ -4788,10 +4789,11 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, } if (OB_SUCC(ret) && is_forall) { - if (OB_FAIL(get_batch_query_num(exec_params, query_num))) { - LOG_WARN("get query_num failed", K(ret)); + if (array_binding_count <= 0) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("array_binding_count is wrong", K(array_binding_count), K(ret)); } else if (OB_FAIL(ObSQLUtils::transform_pl_ext_type( - exec_params, query_num, param_allocator, batch_params))) { + exec_params, array_binding_count, param_allocator, batch_params))) { LOG_WARN("transform failed", K(ret)); } else if (OB_ISNULL(batch_params)) { ret = OB_ERR_UNEXPECTED; @@ -4801,8 +4803,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, } } - OZ (inner_open(ctx, sql, id, type, *curr_params, mysql_result, out_params, is_forall), - K(sql), K(id), K(type), K(param_count), K(out_params), K(exec_params), K(is_forall)); + OZ (inner_open(ctx, sql, id, type, *curr_params, mysql_result, out_params, is_forall, array_binding_count), + K(sql), K(id), K(type), K(param_count), K(out_params), K(exec_params), K(is_forall), K(array_binding_count)); // if failed, we need release complex parameter memory in here if (OB_FAIL(ret) @@ -4818,19 +4820,6 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, return ret; } -int ObSPIService::get_batch_query_num(ParamStore ¶ms, int64_t &query_num) -{ - int ret = OB_SUCCESS; - pl::ObPLCollection *coll = NULL; - CK (params.count() > 0); - CK (params.at(0).is_ext()); - CK (OB_NOT_NULL(coll = reinterpret_cast(params.at(0).get_ext()))); - if (OB_SUCC(ret)) { - query_num = coll->get_count(); - } - return ret; -} - int ObSPIService::inner_open(ObPLExecCtx *ctx, const char *sql, uint64_t id, @@ -4838,7 +4827,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, ParamStore &exec_params, ObMySQLProxy::MySQLResult &mysql_result, ObSPIOutParams &out_params, - bool is_forall) + bool is_forall, + int32_t array_binding_count) { int ret = OB_SUCCESS; @@ -4887,7 +4877,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx, mysql_result, true, false, - is_forall), spi_conn, id, exec_params); + is_forall, + array_binding_count), spi_conn, id, exec_params); } } } diff --git a/src/sql/ob_spi.h b/src/sql/ob_spi.h index 2e3618540..d2a6432aa 100644 --- a/src/sql/ob_spi.h +++ b/src/sql/ob_spi.h @@ -258,7 +258,8 @@ public: const bool *exprs_not_null_flag, const int64_t *pl_integer_rangs, bool is_bulk = false, - bool is_forall = false); + bool is_forall = false, + int32_t array_binding_count = 0); static int spi_execute_immediate(pl::ObPLExecCtx *ctx, const ObSqlExpression *sql, @@ -526,9 +527,8 @@ public: ParamStore &exec_params, ObMySQLProxy::MySQLResult &mysql_result, ObSPIOutParams &out_params, - bool is_forall = false); - - static int get_batch_query_num(ParamStore &exec_params, int64_t &query_num); + bool is_forall = false, + int32_t array_binding_count = 0); static void adjust_pl_status_for_xa(sql::ObExecContext &ctx, int &result); @@ -597,7 +597,8 @@ private: const bool *exprs_not_null_flag, const int64_t *pl_integer_rangs, int64_t is_bulk, - bool is_forall = false); + bool is_forall = false, + int32_t array_binding_count = 0); static int dbms_cursor_execute(pl::ObPLExecCtx *ctx, uint64_t stmt_id, @@ -638,7 +639,8 @@ private: int64_t into_count, ObMySQLProxy::MySQLResult &mysql_result, ObSPIOutParams &out_params, - bool is_forall = false); + bool is_forall = false, + int32_t array_binding_count = 0); static int inner_fetch(pl::ObPLExecCtx *ctx, observer::ObQueryRetryCtrl &retry_ctrl, diff --git a/src/sql/ob_sql_temp_table.h b/src/sql/ob_sql_temp_table.h index 677bf9305..43de40bba 100644 --- a/src/sql/ob_sql_temp_table.h +++ b/src/sql/ob_sql_temp_table.h @@ -65,8 +65,7 @@ public: ObSqlTempTableInfo() : temp_table_id_(OB_INVALID_ID), table_name_(), table_query_(NULL), - table_plan_(NULL), - is_local_(true) {} + table_plan_(NULL) {} virtual ~ObSqlTempTableInfo() {} TO_STRING_KV(K_(temp_table_id), @@ -77,7 +76,6 @@ public: common::ObString table_name_; ObSelectStmt *table_query_; ObLogicalOperator *table_plan_; - bool is_local_; }; } /* ns sql*/ diff --git a/src/sql/ob_sql_trans_control.cpp b/src/sql/ob_sql_trans_control.cpp index 5d976d523..d02bd75ea 100644 --- a/src/sql/ob_sql_trans_control.cpp +++ b/src/sql/ob_sql_trans_control.cpp @@ -589,13 +589,9 @@ int ObSqlTransControl::stmt_setup_snapshot_(ObSQLSessionInfo *session, int ret = OB_SUCCESS; auto cl = plan_ctx->get_consistency_level(); auto &snapshot = das_ctx.get_snapshot(); - palf::SCN snapshot_version; - if (session->get_read_snapshot_version() > 0) { - if (OB_FAIL(snapshot_version.convert_for_lsn_allocator(session->get_read_snapshot_version()))) { - TRANS_LOG(WARN, "convert for lsn fail", K(session->get_read_snapshot_version())); - } - snapshot.init_special_read(snapshot_version); - } else if (cl == ObConsistencyLevel::WEAK || cl == ObConsistencyLevel::FROZEN) { + if ((cl == ObConsistencyLevel::WEAK || cl == ObConsistencyLevel::FROZEN) + && !plan->is_contain_inner_table()) { + palf::SCN snapshot_version; if (OB_FAIL(txs->get_weak_read_snapshot_version(snapshot_version))) { TRANS_LOG(WARN, "get weak read snapshot fail", KPC(txs)); } else { diff --git a/src/sql/ob_sql_utils.cpp b/src/sql/ob_sql_utils.cpp index 188956da9..a1743c1d3 100644 --- a/src/sql/ob_sql_utils.cpp +++ b/src/sql/ob_sql_utils.cpp @@ -4399,12 +4399,15 @@ int ObSQLUtils::get_one_group_params(int64_t pos, ParamStore &src, ParamStore &o ObObjParam &obj = src.at(i); pl::ObPLCollection *coll = NULL; ObObj *data = NULL; - CK (obj.is_ext()); - CK (OB_NOT_NULL(coll = reinterpret_cast(obj.get_ext()))); - CK (coll->get_count() > pos); - CK (1 == coll->get_column_count()); - CK (OB_NOT_NULL(data = reinterpret_cast(coll->get_data()))); - OX (obj_params.push_back(*(data + pos))); + if (OB_UNLIKELY(!obj.is_ext())) { + OZ (obj_params.push_back(obj)); + } else { + CK (OB_NOT_NULL(coll = reinterpret_cast(obj.get_ext()))); + CK (coll->get_count() > pos); + CK (1 == coll->get_column_count()); + CK (OB_NOT_NULL(data = reinterpret_cast(coll->get_data()))); + OX (obj_params.push_back(*(data + pos))); + } } return ret; } @@ -4438,12 +4441,17 @@ int ObSQLUtils::init_elements_info(ParamStore &src, ParamStore &dst) ObObjParam &obj = src.at(i); pl::ObPLCollection *coll = NULL; ObObj *data = NULL; - CK (obj.is_ext()); - CK (OB_NOT_NULL(coll = reinterpret_cast(obj.get_ext()))); CK (dst.at(i).is_ext_sql_array()); CK (OB_NOT_NULL(array_params = reinterpret_cast(dst.at(i).get_ext()))); - if (OB_SUCC(ret)) { - array_params->element_ = coll->get_element_type(); + if (OB_FAIL(ret)) { + } else if (OB_UNLIKELY(!obj.is_ext())) { + array_params->element_.set_meta_type(obj.get_meta()); + array_params->element_.set_accuracy(obj.get_accuracy()); + } else { + CK (OB_NOT_NULL(coll = reinterpret_cast(obj.get_ext()))); + if (OB_SUCC(ret)) { + array_params->element_ = coll->get_element_type(); + } } } return ret; diff --git a/src/sql/optimizer/ob_join_order.cpp b/src/sql/optimizer/ob_join_order.cpp index 0e0d51d5d..775109037 100644 --- a/src/sql/optimizer/ob_join_order.cpp +++ b/src/sql/optimizer/ob_join_order.cpp @@ -1139,6 +1139,8 @@ int ObJoinOrder::will_use_das(const uint64_t table_id, bool &create_basic_path) { int ret = OB_SUCCESS; + create_das_path = false; + create_basic_path = false; IndexInfoEntry *index_info_entry; bool force_das_tsc = false; bool is_batch_update_table = false; @@ -1164,6 +1166,8 @@ int ObJoinOrder::will_use_das(const uint64_t table_id, } if(OB_SUCC(ret)) { + bool hint_force_das = false; + bool hint_force_no_das = false; force_das_tsc = get_plan()->get_optimizer_context().in_nested_sql() || get_plan()->get_optimizer_context().has_pl_udf() || is_batch_update_table; @@ -1171,9 +1175,17 @@ int ObJoinOrder::will_use_das(const uint64_t table_id, //batch update table(multi queries or arraybinding) //contain nested sql(pl udf or in nested sql) //trigger or foreign key in the top sql not force to use DAS TSC - if (force_das_tsc || - (index_info_entry->is_index_global() && - get_plan()->get_optimizer_context().get_parallel() < 2)) { + if (force_das_tsc) { + create_das_path = true; + create_basic_path = false; + } else if (OB_FAIL(get_plan()->get_log_plan_hint().check_use_das(table_id, hint_force_das, + hint_force_no_das))) { + LOG_WARN("table_item is null", K(ret), K(table_id)); + } else if (hint_force_das || hint_force_no_das) { + create_das_path = hint_force_das; + create_basic_path = hint_force_no_das; + } else if (index_info_entry->is_index_global() && + get_plan()->get_optimizer_context().get_parallel() < 2) { create_das_path = true; create_basic_path = false; } else if ((helper.is_inner_path_ || get_tables().is_subset(get_plan()->get_subq_pdfilter_tset())) && @@ -1185,7 +1197,8 @@ int ObJoinOrder::will_use_das(const uint64_t table_id, create_das_path = false; create_basic_path = true; } - LOG_TRACE("will use das", K(force_das_tsc), K(helper.is_inner_path_), K(create_das_path), K(create_basic_path)); + LOG_TRACE("will use das", K(force_das_tsc), K(hint_force_das), K(hint_force_no_das), + K(helper.is_inner_path_), K(create_das_path), K(create_basic_path)); } return ret; } diff --git a/src/sql/optimizer/ob_log_exchange.h b/src/sql/optimizer/ob_log_exchange.h index a5628a56f..cc3e44470 100644 --- a/src/sql/optimizer/ob_log_exchange.h +++ b/src/sql/optimizer/ob_log_exchange.h @@ -140,6 +140,7 @@ public: bool is_rollup_hybrid() { return is_rollup_hybrid_; } log_op_def::ObLogOpType get_px_batch_op_type() { return px_batch_op_type_;} common::ObIArray &get_pruning_table_locations() { return table_locations_; } + common::ObIArray &get_bloom_filter_ids() { return filter_id_array_; } int gen_px_pruning_table_locations(); int allocate_startup_expr_post()override; void set_old_unblock_mode(bool old_unblock_mode) { is_old_unblock_mode_ = old_unblock_mode; } @@ -228,6 +229,7 @@ private: ObRawExpr *random_expr_; common::ObSEArray table_locations_; + common::ObSEArray filter_id_array_; // new shuffle method for non-preserved side in naaj // broadcast 1st line && null join key bool need_null_aware_shuffle_; diff --git a/src/sql/optimizer/ob_log_join.cpp b/src/sql/optimizer/ob_log_join.cpp index 85fc61c1e..a75cd06b4 100644 --- a/src/sql/optimizer/ob_log_join.cpp +++ b/src/sql/optimizer/ob_log_join.cpp @@ -701,14 +701,16 @@ int ObLogJoin::print_join_hint_outline(const ObDMLStmt &stmt, char *buf = plan_text.buf; int64_t &buf_len = plan_text.buf_len; int64_t &pos = plan_text.pos; + const char* algo_str = T_PQ_DISTRIBUTE == hint_type + ? ObJoinHint::get_dist_algo_str(get_dist_method()) + : NULL; if (OB_FAIL(BUF_PRINTF("%s%s(@\"%.*s\" ", ObQueryHint::get_outline_indent(plan_text.is_oneline_), ObHint::get_hint_name(hint_type), qb_name.length(), qb_name.ptr()))) { LOG_WARN("fail to print pq map hint head", K(ret)); } else if (OB_FAIL(print_join_tables_in_hint(stmt, plan_text, table_set))) { LOG_WARN("fail to print join tables", K(ret)); - } else if (T_PQ_DISTRIBUTE == hint_type && - OB_FAIL(BUF_PRINTF(" %s", ObJoinHint::get_dist_algo_str(get_dist_method())))) { + } else if (NULL != algo_str && OB_FAIL(BUF_PRINTF(" %s", algo_str))) { LOG_WARN("fail to print distribute method", K(ret)); } else if (OB_FAIL(BUF_PRINTF(")"))) { } else { /* do nothing */ } @@ -1162,6 +1164,16 @@ int ObLogJoin::set_use_batch(ObLogicalOperator* root) if(OB_FAIL(SMART_CALL(set_use_batch(root->get_child(first_child))))) { LOG_WARN("failed to check use batch nlj", K(ret)); } + } else if (log_op_def::LOG_SET == root->get_type()) { + for (int64_t i = 0; OB_SUCC(ret) && i < root->get_num_of_child(); ++i) { + ObLogicalOperator *child = root->get_child(i); + if (OB_ISNULL(child)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("invalid child", K(ret)); + } else if(OB_FAIL(SMART_CALL(set_use_batch(child)))) { + LOG_WARN("failed to check use batch nlj", K(ret)); + } + } } else { /*do nothing*/ } return ret; } diff --git a/src/sql/optimizer/ob_log_plan.cpp b/src/sql/optimizer/ob_log_plan.cpp index 3e90510be..6b57dbdd8 100644 --- a/src/sql/optimizer/ob_log_plan.cpp +++ b/src/sql/optimizer/ob_log_plan.cpp @@ -5595,8 +5595,6 @@ int ObLogPlan::create_temp_table_transformation_plan(ObLogicalOperator *&top, LOG_WARN("failed to allocate exchange as top", K(ret)); } else if (OB_FAIL(child_ops.push_back(temp))) { LOG_WARN("failed to push back child ops", K(ret)); - } else { - info->is_local_ = !temp_table_insert.at(i)->is_sharding(); } } if (OB_FAIL(ret)) { @@ -6757,7 +6755,7 @@ int ObLogPlan::adjust_sort_expr_ordering(ObIArray &sort_exprs, const ObDMLStmt *stmt = NULL; const EqualSets &equal_sets = child_op.get_output_equal_sets(); const ObIArray &const_exprs = child_op.get_output_const_exprs(); - bool input_ordering_used = false; + int64_t prefix_count = -1; bool input_ordering_all_used = false; if (OB_ISNULL(stmt = child_op.get_stmt())) { ret = OB_ERR_UNEXPECTED; @@ -6767,12 +6765,12 @@ int ObLogPlan::adjust_sort_expr_ordering(ObIArray &sort_exprs, child_op.get_op_ordering(), equal_sets, const_exprs, - input_ordering_used, + prefix_count, input_ordering_all_used, sort_directions))) { LOG_WARN("failed to adjust exprs by ordering", K(ret)); - } else if (input_ordering_used) { - // do nothing + } else if (input_ordering_all_used) { + /* sort_exprs use input ordering, need not sort */ } else { bool adjusted = false; if (stmt->is_select_stmt() && check_win_func) { @@ -6785,6 +6783,9 @@ int ObLogPlan::adjust_sort_expr_ordering(ObIArray &sort_exprs, } else if (cur_expr->get_partition_exprs().count() == 0 && cur_expr->get_order_items().count() == 0) { // win_func over(), do nothing + } else if (prefix_count > 0) { + /* used part of input ordering, do not adjust now*/ + adjusted = true; } else if (OB_FAIL(adjust_exprs_by_win_func(sort_exprs, *cur_expr, equal_sets, @@ -6792,18 +6793,30 @@ int ObLogPlan::adjust_sort_expr_ordering(ObIArray &sort_exprs, sort_directions))) { LOG_WARN("failed to adjust exprs by win func", K(ret)); } else { + /* use no input ordering, adjusted by win func*/ adjusted = true; } } } if (OB_SUCC(ret) && !adjusted && stmt->get_order_item_size() > 0) { - if (OB_FAIL(ObOptimizerUtil::adjust_exprs_by_ordering(sort_exprs, - stmt->get_order_items(), - equal_sets, - const_exprs, - input_ordering_used, - input_ordering_all_used, - sort_directions))) { + if (prefix_count > 0) { + /* used part of input ordering, try adjust sort_exprs after prefix_count by order item */ + if (OB_FAIL(adjust_postfix_sort_expr_ordering(stmt->get_order_items(), + child_op.get_fd_item_set(), + equal_sets, + const_exprs, + prefix_count, + sort_exprs, + sort_directions))) { + LOG_WARN("failed to adjust exprs by ordering", K(ret)); + } + } else if (OB_FAIL(ObOptimizerUtil::adjust_exprs_by_ordering(sort_exprs, + stmt->get_order_items(), + equal_sets, + const_exprs, + prefix_count, + input_ordering_all_used, + sort_directions))) { LOG_WARN("failed to adjust exprs by ordering", K(ret)); } } @@ -6811,6 +6824,113 @@ int ObLogPlan::adjust_sort_expr_ordering(ObIArray &sort_exprs, return ret; } +int ObLogPlan::adjust_postfix_sort_expr_ordering(const ObIArray &ordering, + const ObFdItemSet &fd_item_set, + const EqualSets &equal_sets, + const ObIArray &const_exprs, + const int64_t prefix_count, + ObIArray &sort_exprs, + ObIArray &sort_directions) +{ + int ret = OB_SUCCESS; + LOG_DEBUG("begin adjust postfix sort expr ordering", K(prefix_count), K(fd_item_set), K(equal_sets), + K(sort_exprs), K(sort_directions), K(ordering)); + if (OB_UNLIKELY(prefix_count < 0 || prefix_count >= sort_exprs.count()) + || OB_UNLIKELY(sort_directions.count() != sort_exprs.count())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected params", K(ret), K(prefix_count), K(sort_exprs.count()), + K(sort_directions.count())); + } else if (ordering.count() < prefix_count) { + /* do nothing */ + } else { + ObSEArray new_sort_exprs; + ObSEArray new_sort_directions; + bool check_next = false; + bool can_adjust = true; + int64_t idx = 0; + for (int64_t i = 0; OB_SUCC(ret) && can_adjust && i < prefix_count; ++i) { + check_next = true; + while (OB_SUCC(ret) && check_next && idx < ordering.count()) { + // after ObOptimizerUtil::adjust_exprs_by_ordering, there is not const exprs in sort_exprs. + if (sort_directions.at(i) == ordering.at(idx).order_type_ + && ObOptimizerUtil::is_expr_equivalent(sort_exprs.at(i), ordering.at(idx).expr_, equal_sets)) { + check_next = false; + } else if (OB_FAIL(ObOptimizerUtil::is_const_or_equivalent_expr(ordering, equal_sets, + const_exprs, idx, check_next))) { + LOG_WARN("failed to check is const or equivalent exprs", K(ret)); + } else if (!check_next && + OB_FAIL(ObOptimizerUtil::is_expr_is_determined(new_sort_exprs, fd_item_set, + equal_sets, const_exprs, + ordering.at(idx).expr_, + check_next))) { + LOG_WARN("failed to check is expr is determined", K(ret)); + } else if (check_next) { + ++idx; + } + } + if (OB_FAIL(ret)) { + } else if (check_next) { + can_adjust = false; + } else if (OB_FAIL(new_sort_exprs.push_back(sort_exprs.at(i))) + || OB_FAIL(new_sort_directions.push_back(sort_directions.at(i)))) { + LOG_WARN("failed to add prefix expr/direction", K(ret)); + } else { + ++idx; + } + } + if (OB_SUCC(ret) && idx < ordering.count() && can_adjust) { + ObSqlBitSet<> added_sort_exprs; + for (int64_t i = idx; OB_SUCC(ret) && can_adjust && i < ordering.count(); ++i) { + can_adjust = false; + for (int64_t j = prefix_count; OB_SUCC(ret) && !can_adjust && j < sort_exprs.count(); ++j) { + if (ObOptimizerUtil::is_expr_equivalent(sort_exprs.at(j), ordering.at(i).expr_, equal_sets)) { + can_adjust = true; + if (added_sort_exprs.has_member(j)) { + /* do nothing */ + } else if (OB_FAIL(added_sort_exprs.add_member(j))) { + LOG_WARN("failed to add bit set", K(ret)); + } else if (OB_FAIL(new_sort_exprs.push_back(sort_exprs.at(j))) + || OB_FAIL(new_sort_directions.push_back(ordering.at(i).order_type_))) { + LOG_WARN("Failed to add prefix expr/direction", K(ret)); + } + } + } + if (OB_FAIL(ret) || can_adjust) { + } else if (OB_FAIL(ObOptimizerUtil::is_const_or_equivalent_expr(ordering, equal_sets, + const_exprs, i, can_adjust))) { + LOG_WARN("failed to check is const or equivalent exprs", K(ret)); + } else if (!can_adjust && OB_FAIL(ObOptimizerUtil::is_expr_is_determined(new_sort_exprs, + fd_item_set, + equal_sets, + const_exprs, + ordering.at(i).expr_, + can_adjust))) { + LOG_WARN("failed to check is expr is determined", K(ret)); + } + } + if (OB_SUCC(ret) && can_adjust) { + for (int64_t i = prefix_count; OB_SUCC(ret) && i < sort_exprs.count(); ++i) { + if (added_sort_exprs.has_member(i)) { + /* do nothing */ + } else if (OB_FAIL(new_sort_exprs.push_back(sort_exprs.at(i))) + || OB_FAIL(new_sort_directions.push_back(sort_directions.at(i)))) { + LOG_WARN("failed to add prefix expr / direction", K(ret)); + } + } + LOG_DEBUG("adjusted postfix sort expr ordering", K(new_sort_exprs), K(new_sort_directions)); + if (OB_SUCC(ret)) { + if (OB_FAIL(sort_exprs.assign(new_sort_exprs))) { + LOG_WARN("assign adjusted exprs failed", K(ret)); + } else if (OB_FAIL(sort_directions.assign(new_sort_directions))) { + LOG_WARN("failed to assign order types", K(ret)); + } + } + } + } + } + return ret; +} + /** * @brief adjust_exprs_by_win_func * 根据 window function 调整 exprs 的顺序。先匹配 window function 的 @@ -6866,13 +6986,13 @@ int ObLogPlan::adjust_exprs_by_win_func(ObIArray &exprs, if (OB_SUCC(ret) && all_part_used && win_expr.get_order_items().count() > 0 && rest_exprs.count() > 0) { - bool input_ordering_used = false; + int64_t prefix_count = -1; bool input_ordering_all_used = false; if (OB_FAIL(ObOptimizerUtil::adjust_exprs_by_ordering(rest_exprs, win_expr.get_order_items(), equal_sets, const_exprs, - input_ordering_used, + prefix_count, input_ordering_all_used, rest_order_types))) { LOG_WARN("failed to adjust exprs by ordering", K(ret)); diff --git a/src/sql/optimizer/ob_log_plan.h b/src/sql/optimizer/ob_log_plan.h index 05814580f..3c4256650 100644 --- a/src/sql/optimizer/ob_log_plan.h +++ b/src/sql/optimizer/ob_log_plan.h @@ -836,6 +836,14 @@ public: const ObIArray &conditions, ObIArray &directions); + int adjust_postfix_sort_expr_ordering(const ObIArray &ordering, + const ObFdItemSet &fd_item_set, + const EqualSets &equal_sets, + const ObIArray &const_exprs, + const int64_t prefix_count, + ObIArray &sort_exprs, + ObIArray &sort_directions); + int get_minimal_cost_candidates(const ObIArray &candidates, ObIArray &best_candidates); diff --git a/src/sql/optimizer/ob_log_set.cpp b/src/sql/optimizer/ob_log_set.cpp index 492074db4..7b53ca89f 100644 --- a/src/sql/optimizer/ob_log_set.cpp +++ b/src/sql/optimizer/ob_log_set.cpp @@ -827,7 +827,8 @@ int ObLogSet::get_used_pq_set_hint(const ObPQSetHint *&used_hint) const ObIArray &dist_methods = used_hint->get_dist_methods(); if (OB_FAIL(construct_pq_set_hint(hint))) { LOG_WARN("fail to construct pq set hint", K(ret)); - } else if (dist_methods.count() != hint.get_dist_methods().count()) { + } else if (dist_methods.count() != hint.get_dist_methods().count() + || 0 != hint.get_left_branch().case_compare(used_hint->get_left_branch())) { used_hint = NULL; } else { for (int64_t i = 0; NULL != used_hint && i < dist_methods.count(); ++i) { @@ -862,7 +863,7 @@ int ObLogSet::print_outline_data(planText &plan_text) LOG_WARN("fail to print buffer", K(ret), K(buf), K(buf_len), K(pos)); } else if (OB_FAIL(construct_pq_set_hint(hint))) { LOG_WARN("fail to construct pq set hint", K(ret)); - } else if (hint.get_dist_methods().empty()) { + } else if (hint.get_dist_methods().empty() && hint.get_left_branch().empty()) { /*do nothing*/ } else if (OB_FALSE_IT(hint.set_qb_name(qb_name))) { } else if (hint.print_hint(plan_text)) { @@ -874,6 +875,22 @@ int ObLogSet::print_outline_data(planText &plan_text) int ObLogSet::construct_pq_set_hint(ObPQSetHint &hint) { int ret = OB_SUCCESS; + const ObSelectStmt *stmt = static_cast(get_stmt()); + const ObSelectStmt *left_stmt = get_left_stmt(); + ObString left_branch; + if (OB_ISNULL(stmt) || OB_ISNULL(left_stmt)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected NULL", K(ret), K(stmt), K(left_stmt)); + } else if (!stmt->is_set_distinct() + || 2 < stmt->get_set_query().count() + || stmt->get_set_query(0) == left_stmt) { + /* do nothing */ + } else if (OB_FAIL(left_stmt->get_qb_name(left_branch))) { + LOG_WARN("unexpected NULL", K(ret), K(stmt)); + } else { + hint.set_left_branch(left_branch); + } + if (DistAlgo::DIST_BASIC_METHOD != set_dist_algo_) { int64_t random_none_idx = OB_INVALID_INDEX; if (DistAlgo::DIST_SET_RANDOM == set_dist_algo_) { diff --git a/src/sql/optimizer/ob_log_table_scan.cpp b/src/sql/optimizer/ob_log_table_scan.cpp index c743b6b4f..41054fc13 100644 --- a/src/sql/optimizer/ob_log_table_scan.cpp +++ b/src/sql/optimizer/ob_log_table_scan.cpp @@ -1202,6 +1202,9 @@ int ObLogTableScan::print_used_hint(planText &plan_text) } else if (NULL != table_hint->parallel_hint_ && table_hint->parallel_hint_->get_parallel() > 1 && OB_FAIL(table_hint->parallel_hint_->print_hint(plan_text))) { LOG_WARN("failed to print table parallel hint", K(ret)); + } else if (NULL != table_hint->use_das_hint_ && (table_hint->use_das_hint_->is_enable_hint() ? use_das() : !use_das()) + && OB_FAIL(table_hint->use_das_hint_->print_hint(plan_text))) { + LOG_WARN("failed to print table parallel hint", K(ret)); } else if (table_hint->index_list_.empty()) { /*do nothing*/ } else if (OB_UNLIKELY(table_hint->index_list_.count() != table_hint->index_hints_.count() @@ -1247,31 +1250,24 @@ int ObLogTableScan::print_outline_data(planText &plan_text) int64_t &pos = plan_text.pos; TableItem *table_item = NULL; ObString qb_name; - ObItemType index_type = ref_table_id_ == index_table_id_ ? T_FULL_HINT: T_INDEX_HINT; const ObDMLStmt *stmt = NULL; const ObTableParallelHint *parallel_hint = NULL; - if (OB_ISNULL(get_plan()) || OB_ISNULL(stmt = get_plan()->get_stmt()) - || OB_ISNULL(stmt->get_query_ctx())) { + if (OB_ISNULL(get_plan()) || OB_ISNULL(stmt = get_plan()->get_stmt())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected NULl", K(ret), K(get_plan()), K(stmt)); - } else if (OB_FAIL(stmt->get_query_ctx()->get_qb_name(stmt->get_stmt_id(), qb_name))) { + } else if (OB_FAIL(stmt->get_qb_name(qb_name))) { LOG_WARN("fail to get qb_name", K(ret), K(stmt->get_stmt_id())); } else if (OB_ISNULL(table_item = stmt->get_table_item_by_id(table_id_))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("fail to get table item", K(ret), "table_id", table_id_); - } else if (T_FULL_HINT == index_type && // parallel hint - NULL != (parallel_hint = get_plan()->get_log_plan_hint().get_parallel_hint(table_id_)) && - parallel_hint->get_parallel() > 1) { - if (OB_FAIL(BUF_PRINTF("%s%s(@\"%.*s\" ", - ObQueryHint::get_outline_indent(plan_text.is_oneline_), - ObHint::get_hint_name(T_TABLE_PARALLEL), - qb_name.length(), - qb_name.ptr()))) { - LOG_WARN("fail to print index hint", K(ret)); - } else if (OB_FAIL(get_plan()->print_outline_table(plan_text, table_item))) { - LOG_WARN("fail to print index hint table", K(ret)); - } else if (OB_FAIL(BUF_PRINTF(" %ld)", parallel_hint->get_parallel()))) { - LOG_WARN("fail print parallel", K(ret), K_(parallel)); + } else if (NULL != (parallel_hint = get_plan()->get_log_plan_hint().get_parallel_hint(table_id_)) && + parallel_hint->get_parallel() > 1) { // parallel hint + ObTableParallelHint temp_hint; + temp_hint.set_parallel(parallel_hint->get_parallel()); + temp_hint.set_qb_name(qb_name); + temp_hint.get_table().set_table(*table_item); + if (OB_FAIL(temp_hint.print_hint(plan_text))) { + LOG_WARN("failed to print table parallel hint", K(ret)); } } @@ -1287,19 +1283,24 @@ int ObLogTableScan::print_outline_data(planText &plan_text) && log_op_def::LOG_JOIN == get_parent()->get_type() && static_cast(get_parent())->is_late_mat()) { // late materialization right table, do not print index hint. - } else if (OB_FAIL(BUF_PRINTF("%s%s(@\"%.*s\" ", - ObQueryHint::get_outline_indent(plan_text.is_oneline_), - ObHint::get_hint_name(index_type), - qb_name.length(), - qb_name.ptr()))) { - LOG_WARN("fail to print index hint", K(ret)); - } else if (OB_FAIL(get_plan()->print_outline_table(plan_text, table_item))) { - LOG_WARN("fail to print index hint table", K(ret)); - } else if (T_INDEX_HINT == index_type && - OB_FAIL(BUF_PRINTF(" \"%.*s\"", get_index_name().length(), get_index_name().ptr()))) { - LOG_WARN("fail to print index name", K(ret)); - } else if (OB_FAIL(BUF_PRINTF(")"))) { - } else { /*do nothing*/ } + } else { + ObIndexHint index_hint(ref_table_id_ == index_table_id_ ? T_FULL_HINT: T_INDEX_HINT); + index_hint.set_qb_name(qb_name); + index_hint.get_table().set_table(*table_item); + if (T_INDEX_HINT == index_hint.get_hint_type()) { + index_hint.get_index_name().assign(get_index_name().ptr(), get_index_name().length()); + } + if (OB_FAIL(index_hint.print_hint(plan_text))) { + LOG_WARN("failed to print index hint", K(ret)); + } else if (use_das()) { + ObIndexHint use_das_hint(T_USE_DAS_HINT); + use_das_hint.set_qb_name(qb_name); + use_das_hint.get_table().set_table(*table_item); + if (OB_FAIL(use_das_hint.print_hint(plan_text))) { + LOG_WARN("failed to print use das hint", K(ret)); + } + } + } return ret; } diff --git a/src/sql/optimizer/ob_logical_operator.cpp b/src/sql/optimizer/ob_logical_operator.cpp index 2483ddb70..59cc9d511 100644 --- a/src/sql/optimizer/ob_logical_operator.cpp +++ b/src/sql/optimizer/ob_logical_operator.cpp @@ -5102,7 +5102,6 @@ int ObLogicalOperator::allocate_normal_join_filter(const ObIArrayset_is_create_filter(false); join_filter_create->set_filter_id(filter_id); join_filter_use->set_filter_id(filter_id); - filter_id++; join_filter_create->set_child(first_child, get_child(first_child)); get_child(first_child)->set_parent(join_filter_create); join_filter_create->set_parent(this); @@ -5124,6 +5123,9 @@ int ObLogicalOperator::allocate_normal_join_filter(const ObIArrayset_is_use_filter_shuffle(true); join_filter_use->set_is_use_filter_shuffle(true); + if (OB_FAIL(mark_bloom_filter_id_to_receive_op(join_filter_use, filter_id))) { + LOG_WARN("failed to mark bloom filter id to receive op", K(filter_id), K(join_filter_use)); + } } if ((is_partition_wise_ && !right_has_exchange) || DIST_PARTITION_NONE == join_dist_algo) { join_filter_create->set_is_non_shared_join_filter(); @@ -5135,7 +5137,7 @@ int ObLogicalOperator::allocate_normal_join_filter(const ObIArraycompute_property()); OZ(join_filter_use->compute_property()); } - + filter_id++; for (int j = 0; j < info.lexprs_.count() && OB_SUCC(ret); ++j) { ObRawExpr *lexpr = info.lexprs_.at(j); ObRawExpr *rexpr = info.rexprs_.at(j); @@ -5150,6 +5152,29 @@ int ObLogicalOperator::allocate_normal_join_filter(const ObIArrayget_parent())) { + } else if (NULL != parent) { + if (log_op_def::LOG_EXCHANGE == parent->get_type() && + static_cast(parent)->is_consumer()) { + if (OB_FAIL(static_cast(parent)->get_bloom_filter_ids().push_back(filter_id))) { + LOG_WARN("ObLogExchange failed to record bloom filter id", K(parent), K(filter_id), K(ret)); + } else { + LOG_DEBUG("ObLogExchange succ to record bloom filter id", K(parent), K(filter_id)); + } + } else if (OB_FAIL(SMART_CALL(mark_bloom_filter_id_to_receive_op(parent, filter_id)))) { + LOG_WARN("mark bloom filter id to receive op failed", K(ret)); + } + } + return ret; +} + int ObLogicalOperator::allocate_bf_node_for_hash_join(AllocBloomFilterContext &ctx) { int ret = OB_SUCCESS; diff --git a/src/sql/optimizer/ob_logical_operator.h b/src/sql/optimizer/ob_logical_operator.h index 197f48a9b..05d283aaa 100644 --- a/src/sql/optimizer/ob_logical_operator.h +++ b/src/sql/optimizer/ob_logical_operator.h @@ -1779,6 +1779,7 @@ private: int64_t &filter_id); int allocate_normal_join_filter(const ObIArray &infos, int64_t &filter_id); + int mark_bloom_filter_id_to_receive_op(ObLogicalOperator *filter_use, int64_t filter_id); int push_down_bloom_filter_expr(ObLogicalOperator *op, ObLogicalOperator *join_filter_op, double join_filter_rate); /* manual set dop for each dfo */ diff --git a/src/sql/optimizer/ob_optimizer.cpp b/src/sql/optimizer/ob_optimizer.cpp index 93b1aa7fb..1cee7dd08 100644 --- a/src/sql/optimizer/ob_optimizer.cpp +++ b/src/sql/optimizer/ob_optimizer.cpp @@ -247,9 +247,13 @@ int ObOptimizer::get_stmt_max_table_parallel_hint(ObDMLStmt &stmt, int ret = OB_SUCCESS; ObSEArray child_stmts; ObQueryCtx *query_ctx = NULL; - max_table_hint = std::max(max_table_hint, stmt.get_stmt_hint().get_max_table_parallel()); - if (OB_FAIL(stmt.get_child_stmts(child_stmts))) { + int64_t cur_max_table_hint = ObGlobalHint::UNSET_PARALLEL; + if (OB_FAIL(stmt.get_stmt_hint().get_max_table_parallel(stmt, cur_max_table_hint))) { + LOG_WARN("failed to get max table parallel", K(ret)); + } else if (OB_FAIL(stmt.get_child_stmts(child_stmts))) { LOG_WARN("failed to get child stmts", K(ret)); + } else { + max_table_hint = std::max(max_table_hint, cur_max_table_hint); } for (int64_t i = 0; OB_SUCC(ret) && i < child_stmts.count(); i++) { if (OB_ISNULL(child_stmts.at(i))) { diff --git a/src/sql/optimizer/ob_optimizer_util.cpp b/src/sql/optimizer/ob_optimizer_util.cpp index b5386d4a5..a6d7c2c04 100644 --- a/src/sql/optimizer/ob_optimizer_util.cpp +++ b/src/sql/optimizer/ob_optimizer_util.cpp @@ -366,13 +366,13 @@ int ObOptimizerUtil::adjust_exprs_by_ordering(ObIArray &exprs, const ObIArray &ordering, const EqualSets &equal_sets, const ObIArray &const_exprs, - bool &ordering_used, + int64_t &prefix_count, bool &ordering_all_used, ObIArray &directions, ObIArray *match_map /*=NULL*/) { int ret = OB_SUCCESS; - ordering_used = false; + prefix_count = -1; ordering_all_used = false; ObSEArray adjusted_exprs; ObSEArray order_types; @@ -398,7 +398,6 @@ int ObOptimizerUtil::adjust_exprs_by_ordering(ObIArray &exprs, //已经和其它序的表达式对应了,不再参与比较 } else if (is_expr_equivalent(sort_key.expr_, exprs.at(j), equal_sets)) { is_found = true; - ordering_used = true; if (OB_FAIL(adjusted_exprs.push_back(exprs.at(j)))) { LOG_WARN("store ordered expr failed", K(ret), K(i), K(j)); } else if (OB_FAIL(expr_map.push_back(j))) { @@ -412,7 +411,8 @@ int ObOptimizerUtil::adjust_exprs_by_ordering(ObIArray &exprs, } } if (OB_SUCC(ret)) { - ordering_all_used = ordering_used; + prefix_count = adjusted_exprs.count(); + ordering_all_used = prefix_count > 0; } for (int64_t j = 0; OB_SUCC(ret) && j < exprs.count(); ++j) { if (expr_idxs.has_member(j)) { @@ -3094,6 +3094,29 @@ int ObOptimizerUtil::split_child_exprs(const ObFdItem *fd_item, return ret; } +int ObOptimizerUtil::is_expr_is_determined(const ObIArray &exprs, + const ObFdItemSet &fd_item_set, + const EqualSets &equal_sets, + const ObIArray &const_exprs, + const ObRawExpr *expr, + bool &is_determined) +{ + int ret = OB_SUCCESS; + is_determined = false; + const ObFdItem *fd_item = NULL; + for (int64_t fd_idx = 0; OB_SUCC(ret) && !is_determined && fd_idx < fd_item_set.count(); ++fd_idx) { + if (OB_ISNULL(fd_item = fd_item_set.at(fd_idx))) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get null fd item", K(ret)); + } else if (OB_FAIL(is_exprs_contain_fd_parent(exprs, *fd_item, equal_sets, const_exprs, is_determined))) { + LOG_WARN("failed to check is exprs contain fd parent", K(ret)); + } else if (is_determined && OB_FAIL(fd_item->check_expr_in_child(expr, equal_sets, is_determined))) { + LOG_WARN("failed to check expr in fd child", K(ret)); + } + } + return ret; +} + int ObOptimizerUtil::is_exprs_contain_fd_parent(const ObIArray &exprs, const ObFdItem &fd_item, const EqualSets &equal_sets, @@ -3738,7 +3761,7 @@ int ObOptimizerUtil::decide_sort_keys_for_merge_style_op(const ObDMLStmt *stmt, MergeKeyInfo *&interesting_key) { int ret = OB_SUCCESS; - bool input_ordering_used = false; + int64_t prefix_count = -1; bool input_ordering_all_used = false; ObSEArray order_items; ObSEArray final_items; @@ -3750,13 +3773,13 @@ int ObOptimizerUtil::decide_sort_keys_for_merge_style_op(const ObDMLStmt *stmt, input_ordering, equal_sets, const_exprs, - input_ordering_used, + prefix_count, input_ordering_all_used, merge_key.order_directions_, &merge_key.map_array_))) { LOG_WARN("failed to adjust expr by ordering", K(ret)); - } else if (input_ordering_all_used || input_ordering_used || NULL == interesting_key) { - if (!input_ordering_all_used && !input_ordering_used && + } else if (prefix_count > 0 || input_ordering_all_used || NULL == interesting_key) { + if (!input_ordering_all_used && prefix_count <= 0 && OB_FAIL(create_interesting_merge_key(stmt, merge_exprs, stmt_equal_sets, merge_key))) { LOG_WARN("failed to create interesting key", K(ret)); } else if (OB_FAIL(ObOptimizerUtil::make_sort_keys(merge_key.order_exprs_, @@ -3782,7 +3805,7 @@ int ObOptimizerUtil::decide_sort_keys_for_merge_style_op(const ObDMLStmt *stmt, merge_key.need_sort_, merge_key.prefix_pos_))) { LOG_WARN("failed to check need sort", K(ret)); - } else if (input_ordering_used) { + } else if (prefix_count > 0) { /*do nothing*/ } else { interesting_key = &merge_key; @@ -4428,9 +4451,32 @@ int ObOptimizerUtil::simplify_exprs(const ObFdItemSet &fd_item_set, equal_sets, const_exprs, is_contain))) { LOG_WARN("failed to check is order unique", K(ret)); } else if (is_contain) { - ObSEArray new_root_exprs; - bool eliminate_new = false; + ObSEArray left_domain; + ObSEArray right_domain; int64_t expr_idx = -1; + // 生成新的root exprs集合 + for (int64_t j = 0; OB_SUCC(ret) && j < root_exprs.count(); ++j) { + if (OB_FAIL(left_domain.push_back(root_exprs.at(j)))) { + LOG_WARN("failed to push back root expr", K(ret)); + } else if (OB_FAIL(fd_item->check_expr_in_child(root_exprs.at(j), equal_sets, is_in_child))) { + LOG_WARN("failed to check expr in child", K(ret)); + } else if (is_in_child) { + // root expr可以被其它expr决定 + } else if (OB_FAIL(right_domain.push_back(root_exprs.at(j)))) { + LOG_WARN("failed to push back root expr", K(ret)); + } + } + for (int64_t j = 0; OB_SUCC(ret) && j < parent_exprs->count(); ++j) { + if (find_equal_expr(candi_exprs, parent_exprs->at(j), equal_sets, expr_idx)) { + if (OB_FAIL(right_domain.push_back(candi_exprs.at(expr_idx)))) { + LOG_WARN("failed to push back root expr", K(ret)); + } else if (eliminate_set.has_member(expr_idx)) { + // do nothing + } else if (OB_FAIL(left_domain.push_back(candi_exprs.at(expr_idx)))) { + LOG_WARN("failed to push back root expr", K(ret)); + } + } + } // 检查当前fd item能否消除新的candi expr for (int64_t j = 0; OB_SUCC(ret) && j < candi_exprs.count(); ++j) { if (eliminate_set.has_member(j)) { @@ -4443,30 +4489,13 @@ int ObOptimizerUtil::simplify_exprs(const ObFdItemSet &fd_item_set, // do nothing } else if (OB_FAIL(eliminate_set.add_member(j))) { LOG_WARN("failed to add member", K(ret)); - } else { - eliminate_new = true; - } - } - // 生成新的root exprs集合 - for (int64_t j = 0; OB_SUCC(ret) && j < root_exprs.count(); ++j) { - if (OB_FAIL(fd_item->check_expr_in_child(root_exprs.at(j), equal_sets, is_in_child))) { - LOG_WARN("failed to check expr in child", K(ret)); - } else if (is_in_child) { - // root expr可以被其它expr决定 - } else if (OB_FAIL(new_root_exprs.push_back(root_exprs.at(j)))) { - LOG_WARN("failed to push back root expr", K(ret)); - } - } - for (int64_t j = 0; OB_SUCC(ret) && j < parent_exprs->count(); ++j) { - if (find_equal_expr(candi_exprs, parent_exprs->at(j), equal_sets, expr_idx)) { - if (OB_FAIL(new_root_exprs.push_back(candi_exprs.at(expr_idx)))) { - LOG_WARN("failed to push back root expr", K(ret)); - } } } // 如果当前fd item消除了新的candi expr或者新的root expr集合比旧的root expr集合数量更少, 则用 // 新的root expr集合替换旧的 - if (OB_SUCC(ret) && (eliminate_new || new_root_exprs.count() < root_exprs.count())) { + if (OB_SUCC(ret)) { + ObIArray &new_root_exprs = left_domain.count() <= right_domain.count() + ? left_domain : right_domain; if (OB_FAIL(root_exprs.assign(new_root_exprs))) { LOG_WARN("failed to assign exprs", K(ret)); } @@ -4539,6 +4568,8 @@ int ObOptimizerUtil::simplify_ordered_exprs(const ObFdItemSet &fd_item_set, order_exprs.reset(); ObSEArray extended_order_exprs; ObSEArray fd_set_parent_exprs; + ObSEArray subquery_exprs; + ObRawExpr *first_removed_expr = NULL; if (OB_FAIL(get_fd_set_parent_exprs(fd_item_set, fd_set_parent_exprs))) { LOG_WARN("failed to get fd set parent exprs ", K(ret)); } @@ -4552,11 +4583,8 @@ int ObOptimizerUtil::simplify_ordered_exprs(const ObFdItemSet &fd_item_set, LOG_WARN("failed to check is const expr", K(ret)); } else if (is_const) {//const expr 不需要排序 /*do nothing*/ - } else if (eliminate_set.has_member(i)) {//已被移除的 epxr - if (order_exprs.empty() && - OB_FAIL(order_exprs.push_back(expr))) { - LOG_WARN("failed to push back exprs", K(ret)); - } else { /*do nothing*/ } + } else if (eliminate_set.has_member(i)) { + first_removed_expr = NULL == first_removed_expr ? expr : first_removed_expr; } else if (OB_FAIL(order_exprs.push_back(expr))) { LOG_WARN("failed to push back exprs", K(ret)); } else if (OB_FAIL(extended_order_exprs.push_back(expr))) { @@ -4585,9 +4613,15 @@ int ObOptimizerUtil::simplify_ordered_exprs(const ObFdItemSet &fd_item_set, } else if (OB_FAIL(fd_item->check_expr_in_child(candi_exprs.at(j), equal_sets, is_in_child))) { LOG_WARN("failed to check expr in fd child", K(ret)); - } else if (is_in_child && !candi_exprs.at(j)->has_flag(CNT_SUB_QUERY)) { - // 不消除 order expr 中的 subquery, 为了检测输出多行时报错 - ret = eliminate_set.add_member(j); + } else if (!is_in_child) { + /*do nothing*/ + } else if (OB_FAIL(eliminate_set.add_member(j))) { + LOG_WARN("failed to add member", K(ret)); + } else if (candi_exprs.at(j)->has_flag(CNT_SUB_QUERY) + && OB_FAIL(subquery_exprs.push_back(candi_exprs.at(j)))) { + /* to check output more than one row, do not remove subquery in order expr. + append subqueries to end of order_exprs */ + LOG_WARN("failed to push back exprs", K(ret)); } } if (OB_FAIL(ret)) { @@ -4603,6 +4637,13 @@ int ObOptimizerUtil::simplify_ordered_exprs(const ObFdItemSet &fd_item_set, } } } + if (OB_FAIL(ret)) { + } else if (OB_FAIL(append(order_exprs, subquery_exprs))) { + LOG_WARN("failed to append exprs", K(ret)); + } else if (order_exprs.empty() && NULL != first_removed_expr + && OB_FAIL(order_exprs.push_back(first_removed_expr))) { + LOG_WARN("failed to push back exprs", K(ret)); + } return ret; } diff --git a/src/sql/optimizer/ob_optimizer_util.h b/src/sql/optimizer/ob_optimizer_util.h index 1370556e6..c4a168f54 100644 --- a/src/sql/optimizer/ob_optimizer_util.h +++ b/src/sql/optimizer/ob_optimizer_util.h @@ -119,7 +119,7 @@ public: const common::ObIArray &ordering, const EqualSets &equal_sets, const common::ObIArray &const_exprs, - bool &ordering_used, + int64_t &prefix_count, bool &ordering_all_used, common::ObIArray &directions, common::ObIArray *match_map = NULL); @@ -621,6 +621,13 @@ public: ObIArray &exprs, ObIArray &child_exprs); + static int is_expr_is_determined(const ObIArray &exprs, + const ObFdItemSet &fd_item_set, + const EqualSets &equal_sets, + const ObIArray &const_exprs, + const ObRawExpr *expr, + bool &is_determined); + static int is_exprs_contain_fd_parent(const ObIArray &exprs, const ObFdItem &fd_item, const EqualSets &equal_sets, diff --git a/src/sql/optimizer/ob_select_log_plan.cpp b/src/sql/optimizer/ob_select_log_plan.cpp index bddb4bdcc..3f590e5a6 100644 --- a/src/sql/optimizer/ob_select_log_plan.cpp +++ b/src/sql/optimizer/ob_select_log_plan.cpp @@ -75,6 +75,7 @@ int ObSelectLogPlan::candi_allocate_group_by() bool having_has_rownum = false; const ObSelectStmt *stmt = NULL; ObLogicalOperator *best_plan = NULL; + ObSEArray reduce_exprs; ObSEArray group_by_exprs; ObSEArray rollup_exprs; ObSEArray group_by_directions; @@ -114,6 +115,7 @@ int ObSelectLogPlan::candi_allocate_group_by() ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(best_plan), K(ret)); } else if (OB_FAIL(get_groupby_rollup_exprs(best_plan, + reduce_exprs, group_by_exprs, rollup_exprs, group_by_directions, @@ -133,7 +135,8 @@ int ObSelectLogPlan::candi_allocate_group_by() LOG_WARN("failed to allocate filter", K(ret)); } else { /*do nothing*/ } } else { - if (OB_FAIL(candi_allocate_normal_group_by(group_by_exprs, + if (OB_FAIL(candi_allocate_normal_group_by(reduce_exprs, + group_by_exprs, group_by_directions, rollup_exprs, rollup_directions, @@ -153,6 +156,7 @@ int ObSelectLogPlan::candi_allocate_group_by() } int ObSelectLogPlan::get_groupby_rollup_exprs(const ObLogicalOperator *top, + ObIArray &reduce_exprs, ObIArray &group_by_exprs, common::ObIArray &rollup_exprs, ObIArray &group_directions, @@ -160,8 +164,8 @@ int ObSelectLogPlan::get_groupby_rollup_exprs(const ObLogicalOperator *top, { int ret = OB_SUCCESS; // gather all group by columns - ObSEArray candi_group_exprs; const ObSelectStmt *stmt = get_stmt(); + reduce_exprs.reuse(); if (OB_ISNULL(stmt) || OB_ISNULL(top)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret), K(stmt), K(top)); @@ -182,7 +186,7 @@ int ObSelectLogPlan::get_groupby_rollup_exprs(const ObLogicalOperator *top, && !group_expr->has_flag(CNT_SUB_QUERY) && !group_expr->get_expr_levels().has_member(stmt->get_current_level()))) { //no need to group a const expr, skip it - } else if (OB_FAIL(candi_group_exprs.push_back(group_expr))) { + } else if (OB_FAIL(reduce_exprs.push_back(group_expr))) { LOG_WARN("failed to push array", K(ret)); } else { /*do nothing*/ } } @@ -190,7 +194,7 @@ int ObSelectLogPlan::get_groupby_rollup_exprs(const ObLogicalOperator *top, if (OB_FAIL(ObOptimizerUtil::simplify_exprs(top->get_fd_item_set(), top->get_output_equal_sets(), top->get_output_const_exprs(), - candi_group_exprs, + reduce_exprs, group_by_exprs))) { LOG_WARN("failed to simplify group exprs", K(ret)); } else if (OB_FAIL(ObOptimizerUtil::find_stmt_expr_direction(*stmt, @@ -214,13 +218,14 @@ int ObSelectLogPlan::get_groupby_rollup_exprs(const ObLogicalOperator *top, } // do nothing } if (OB_SUCC(ret)) { - LOG_TRACE("succeed to get group by exprs and rollup exprs", K(group_by_exprs), K(rollup_exprs)); + LOG_TRACE("succeed to get group by exprs and rollup exprs", K(reduce_exprs), K(group_by_exprs), K(rollup_exprs)); } } return ret; } -int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray &group_by_exprs, +int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -238,7 +243,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & groupby_helper))) { LOG_WARN("failed to init group by helper", K(ret)); } else if (groupby_helper.can_three_stage_pushdown_) { - if (OB_FAIL(candi_allocate_three_stage_group_by(group_by_exprs, + if (OB_FAIL(candi_allocate_three_stage_group_by(reduce_exprs, + group_by_exprs, group_directions, rollup_exprs, rollup_directions, @@ -249,7 +255,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & groupby_plans))) { LOG_WARN("failed to candi allocate three stage group by", K(ret)); } - } else if (OB_FAIL(candi_allocate_normal_group_by(group_by_exprs, + } else if (OB_FAIL(candi_allocate_normal_group_by(reduce_exprs, + group_by_exprs, group_directions, rollup_exprs, rollup_directions, @@ -264,7 +271,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & LOG_TRACE("succeed to allocate group by using hint", K(groupby_plans.count()), K(groupby_helper)); } else if (OB_FAIL(get_log_plan_hint().check_status())) { LOG_WARN("failed to generate plans with hint", K(ret)); - } else if (OB_FAIL(candi_allocate_normal_group_by(group_by_exprs, + } else if (OB_FAIL(candi_allocate_normal_group_by(reduce_exprs, + group_by_exprs, group_directions, rollup_exprs, rollup_directions, @@ -296,7 +304,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & } // create three-stage push down plan -int ObSelectLogPlan::candi_allocate_three_stage_group_by(const ObIArray &group_by_exprs, +int ObSelectLogPlan::candi_allocate_three_stage_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -319,13 +328,14 @@ int ObSelectLogPlan::candi_allocate_three_stage_group_by(const ObIArrayis_distributed() && !group_by_exprs.empty() && - OB_FAIL(candidate_plan.plan_tree_->check_sharding_compatible_with_reduce_expr(group_by_exprs, + } else if (candidate_plan.plan_tree_->is_distributed() && !reduce_exprs.empty() && + OB_FAIL(candidate_plan.plan_tree_->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check if sharding compatible with distinct expr", K(ret)); } else if (!candidate_plan.plan_tree_->is_distributed() || is_partition_wise) { bool can_ignore_merge_plan = !(groupby_plans.empty() || groupby_helper.force_use_merge_); - if (OB_FAIL(create_merge_group_plan(group_by_exprs, + if (OB_FAIL(create_merge_group_plan(reduce_exprs, + group_by_exprs, group_directions, rollup_exprs, rollup_directions, @@ -391,7 +401,8 @@ int ObSelectLogPlan::get_valid_aggr_algo(const ObIArray &group_by_ex return ret; } -int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray &group_by_exprs, +int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -418,7 +429,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & } else { for (int64_t i = 0; OB_SUCC(ret) && i < best_plans.count(); i++) { candidate_plan = best_plans.at(i); - if (OB_FAIL(create_hash_group_plan(group_by_exprs, + if (OB_FAIL(create_hash_group_plan(reduce_exprs, + group_by_exprs, rollup_exprs, aggr_items, having_exprs, @@ -441,7 +453,7 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & bool is_needed = false; bool is_plan_valid = true; if (OB_FAIL(should_create_rollup_pushdown_plan(candidate_plan.plan_tree_, - group_by_exprs, + reduce_exprs, rollup_exprs, groupby_helper, is_needed))) { @@ -455,7 +467,8 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & candidate_plan.plan_tree_))) { LOG_WARN("failed to create rollup pushdown plan", K(ret)); } - } else if (OB_FAIL(create_merge_group_plan(group_by_exprs, + } else if (OB_FAIL(create_merge_group_plan(reduce_exprs, + group_by_exprs, group_directions, rollup_exprs, rollup_directions, @@ -479,7 +492,7 @@ int ObSelectLogPlan::candi_allocate_normal_group_by(const ObIArray & } int ObSelectLogPlan::should_create_rollup_pushdown_plan(ObLogicalOperator *top, - const ObIArray &group_by_exprs, + const ObIArray &reduce_exprs, const ObIArray &rollup_exprs, GroupingOpHelper &groupby_helper, bool &is_needed) @@ -494,7 +507,7 @@ int ObSelectLogPlan::should_create_rollup_pushdown_plan(ObLogicalOperator *top, } else if (rollup_exprs.empty() || !groupby_helper.can_rollup_pushdown_) { // do nothing } else if (top->is_distributed() && - OB_FAIL(top->check_sharding_compatible_with_reduce_expr(group_by_exprs, + OB_FAIL(top->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check is partition wise", K(ret)); } else if (!top->is_distributed() || is_partition_wise ) { @@ -630,7 +643,8 @@ LOG_WARN("failed to set rollup id expr", K(ret)); return ret; } -int ObSelectLogPlan::create_hash_group_plan(const ObIArray &group_by_exprs, +int ObSelectLogPlan::create_hash_group_plan(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &rollup_exprs, const ObIArray &aggr_items, const ObIArray &having_exprs, @@ -646,7 +660,7 @@ int ObSelectLogPlan::create_hash_group_plan(const ObIArray &group_by LOG_WARN("get unexpected null", K(top), K(get_stmt()), K(ret)); } else if (OB_FALSE_IT(origin_child_card = top->get_card())) { } else if (top->is_distributed() && - OB_FAIL(top->check_sharding_compatible_with_reduce_expr(group_by_exprs, + OB_FAIL(top->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check if sharding compatible", K(ret)); } else if (!top->is_distributed() || is_partition_wise) { @@ -851,7 +865,8 @@ top = topk_op; return ret; } -int ObSelectLogPlan::create_merge_group_plan(const ObIArray &group_by_exprs, +int ObSelectLogPlan::create_merge_group_plan(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -926,7 +941,7 @@ int ObSelectLogPlan::create_merge_group_plan(const ObIArray &group_b // if need sort and no further op needs the output order, not generate merge groupby is_plan_valid = false; } else if (top->is_distributed() && - OB_FAIL(top->check_sharding_compatible_with_reduce_expr(group_by_exprs, + OB_FAIL(top->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check if sharding compatiable with reduce expr", K(ret)); } else if (!top->is_distributed() || is_partition_wise) { @@ -1165,6 +1180,7 @@ int ObSelectLogPlan::candi_allocate_distinct() bool is_unique = false; const ObSelectStmt *stmt = NULL; ObLogicalOperator *best_plan = NULL; + ObSEArray reduce_exprs; ObSEArray distinct_exprs; ObSEArray candi_subquery_exprs; @@ -1180,7 +1196,7 @@ int ObSelectLogPlan::candi_allocate_distinct() } else if (OB_ISNULL(best_plan)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret)); - } else if (OB_FAIL(get_distinct_exprs(best_plan, distinct_exprs))) { + } else if (OB_FAIL(get_distinct_exprs(best_plan, reduce_exprs, distinct_exprs))) { LOG_WARN("failed to get select columns", K(ret)); } else if (distinct_exprs.empty()) { // if all the distinct exprs are const, we add limit operator instead of distinct operator @@ -1225,6 +1241,7 @@ int ObSelectLogPlan::candi_allocate_distinct() candidate_plan = best_candidates.at(i); if (OB_FAIL(create_hash_distinct_plan(candidate_plan.plan_tree_, distinct_helper, + reduce_exprs, distinct_exprs))) { LOG_WARN("failed to create hash distinct plan", K(ret)); } else if (OB_FAIL(distinct_plans.push_back(candidate_plan))) { @@ -1242,6 +1259,7 @@ int ObSelectLogPlan::candi_allocate_distinct() candidate_plan = candidates_.candidate_plans_.at(i); if (OB_FAIL(create_merge_distinct_plan(candidate_plan.plan_tree_, distinct_helper, + reduce_exprs, distinct_exprs, distinct_directions, is_plan_valid, @@ -1266,16 +1284,17 @@ int ObSelectLogPlan::candi_allocate_distinct() } int ObSelectLogPlan::get_distinct_exprs(const ObLogicalOperator *top, + ObIArray &reduce_exprs, ObIArray &distinct_exprs) { int ret = OB_SUCCESS; const ObSelectStmt *select_stmt = get_stmt(); + reduce_exprs.reuse(); if (OB_ISNULL(select_stmt) || OB_ISNULL(top)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(select_stmt), K(top), K(ret)); } else { ObRawExpr *select_expr = NULL; - ObSEArray candi_exprs; for (int64_t i = 0; OB_SUCC(ret) && i < select_stmt->get_select_item_size(); ++i) { bool is_const = false; select_expr = select_stmt->get_select_item(i).expr_; @@ -1289,7 +1308,7 @@ int ObSelectLogPlan::get_distinct_exprs(const ObLogicalOperator *top, LOG_WARN("failed to check whether is const expr", K(ret)); } else if (is_const) { //skip it - } else if (OB_FAIL(candi_exprs.push_back(select_expr))) { + } else if (OB_FAIL(reduce_exprs.push_back(select_expr))) { LOG_WARN("push expr to distinct exprs failed", K(ret)); } else { /*do nothing*/ } } @@ -1298,7 +1317,7 @@ int ObSelectLogPlan::get_distinct_exprs(const ObLogicalOperator *top, } else if (OB_FAIL(ObOptimizerUtil::simplify_exprs(top->get_fd_item_set(), top->get_output_equal_sets(), top->get_output_const_exprs(), - candi_exprs, + reduce_exprs, distinct_exprs))) { LOG_WARN("failed to simplify exprs", K(ret)); } else { /*do nothing*/ } @@ -1308,6 +1327,7 @@ int ObSelectLogPlan::get_distinct_exprs(const ObLogicalOperator *top, int ObSelectLogPlan::create_hash_distinct_plan(ObLogicalOperator *&top, GroupingOpHelper &distinct_helper, + ObIArray &reduce_exprs, ObIArray &distinct_exprs) { int ret = OB_SUCCESS; @@ -1317,7 +1337,7 @@ int ObSelectLogPlan::create_hash_distinct_plan(ObLogicalOperator *&top, ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(top), K(ret)); } else if (top->is_distributed() && - OB_FAIL(top->check_sharding_compatible_with_reduce_expr(distinct_exprs, + OB_FAIL(top->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check sharding compatible with reduce expr", K(ret)); } else if (!top->is_distributed() || is_partition_wise) { @@ -1353,6 +1373,7 @@ int ObSelectLogPlan::create_hash_distinct_plan(ObLogicalOperator *&top, int ObSelectLogPlan::create_merge_distinct_plan(ObLogicalOperator *&top, GroupingOpHelper &distinct_helper, + ObIArray &reduce_exprs, ObIArray &distinct_exprs, ObIArray &directions, bool &is_plan_valid, @@ -1397,7 +1418,7 @@ int ObSelectLogPlan::create_merge_distinct_plan(ObLogicalOperator *&top, // if no further order needed, not generate merge style distinct is_plan_valid = false; } else if (top->is_distributed() && - OB_FAIL(top->check_sharding_compatible_with_reduce_expr(distinct_exprs, + OB_FAIL(top->check_sharding_compatible_with_reduce_expr(reduce_exprs, is_partition_wise))) { LOG_WARN("failed to check sharding compatiable with reduce exprs", K(ret)); } else if (!top->is_distributed() || is_partition_wise) { @@ -2664,6 +2685,11 @@ int ObSelectLogPlan::generate_merge_set_plans(const EqualSets &equal_sets, ObSEArray, 8> right_merge_keys; bool force_merge = MERGE_SET == get_log_plan_hint().get_valid_set_algo(); bool can_ignore_merge_plan = !(no_hash_plans || (!ignore_hint && force_merge)); + bool no_swap = false; + bool swap = false; + if (OB_FAIL(get_allowed_branch_order(ignore_hint, set_op, no_swap, swap))) { + LOG_WARN("failed to get allowed branch order", K(ret)); + } for (int64_t i = 0; OB_SUCC(ret) && i < left_candidate_list.count(); i++) { merge_key_list.reuse(); if (OB_FAIL(init_merge_set_structure(allocator, @@ -2690,28 +2716,27 @@ int ObSelectLogPlan::generate_merge_set_plans(const EqualSets &equal_sets, } for (int64_t i = 0; OB_SUCC(ret) && i < left_candidate_list.count(); i++) { for (int64_t j = 0; OB_SUCC(ret) && j < right_candidate_list.count(); j++) { - if (OB_FAIL(inner_generate_merge_set_plans(equal_sets, - left_set_keys, - right_set_keys, - left_merge_keys.at(i), - set_op, - left_candidate_list.at(i), - right_candidate_list.at(j), - ignore_hint, - no_hash_plans, - merge_set_plans))) { + if (no_swap && OB_FAIL(inner_generate_merge_set_plans(equal_sets, + left_set_keys, + right_set_keys, + left_merge_keys.at(i), + set_op, + left_candidate_list.at(i), + right_candidate_list.at(j), + ignore_hint, + no_hash_plans, + merge_set_plans))) { LOG_WARN("failed to generate merge set plans", K(ret)); - } else if (ObSelectStmt::EXCEPT != set_op && - OB_FAIL(inner_generate_merge_set_plans(equal_sets, - right_set_keys, - left_set_keys, - right_merge_keys.at(j), - set_op, - right_candidate_list.at(j), - left_candidate_list.at(i), - ignore_hint, - no_hash_plans, - merge_set_plans))) { + } else if (swap && OB_FAIL(inner_generate_merge_set_plans(equal_sets, + right_set_keys, + left_set_keys, + right_merge_keys.at(j), + set_op, + right_candidate_list.at(j), + left_candidate_list.at(i), + ignore_hint, + no_hash_plans, + merge_set_plans))) { LOG_WARN("failed to inner generate merge set plans", K(ret)); } else { /*do nothing*/} } @@ -3055,6 +3080,31 @@ int ObSelectLogPlan::create_merge_set_plan(const EqualSets &equal_sets, return ret; } +int ObSelectLogPlan::get_allowed_branch_order(const bool ignore_hint, + const ObSelectStmt::SetOperator set_op, + bool &no_swap, + bool &swap) +{ + int ret = OB_SUCCESS; + no_swap = true; + swap = ObSelectStmt::EXCEPT != set_op; + bool hint_valid = false; + bool need_swap = false; + if (ignore_hint) { + /* do nothing */ + } else if (OB_FAIL(get_log_plan_hint().check_valid_set_left_branch(get_stmt(), + hint_valid, + need_swap))) { + LOG_WARN("failed to check valid set left branch", K(ret)); + } else if (!hint_valid) { + /* do nothing */ + } else { + no_swap &= !need_swap; + swap &= need_swap; + } + return ret; +} + int ObSelectLogPlan::generate_hash_set_plans(const EqualSets &equal_sets, const ObIArray &left_set_keys, const ObIArray &right_set_keys, @@ -3065,24 +3115,27 @@ int ObSelectLogPlan::generate_hash_set_plans(const EqualSets &equal_sets, ObIArray &hash_set_plans) { int ret = OB_SUCCESS; - if (OB_FAIL(inner_generate_hash_set_plans(equal_sets, - left_set_keys, - right_set_keys, - set_op, - left_best_plans, - right_best_plans, - ignore_hint, - hash_set_plans))) { + bool no_swap = false; + bool swap = false; + if (OB_FAIL(get_allowed_branch_order(ignore_hint, set_op, no_swap, swap))) { + LOG_WARN("failed to get allowed branch order", K(ret)); + } else if (no_swap && OB_FAIL(inner_generate_hash_set_plans(equal_sets, + left_set_keys, + right_set_keys, + set_op, + left_best_plans, + right_best_plans, + ignore_hint, + hash_set_plans))) { LOG_WARN("failed to generate hash set plans", K(ret)); - } else if (ObSelectStmt::EXCEPT != set_op && - OB_FAIL(inner_generate_hash_set_plans(equal_sets, - right_set_keys, - left_set_keys, - set_op, - right_best_plans, - left_best_plans, - ignore_hint, - hash_set_plans))) { + } else if (swap && OB_FAIL(inner_generate_hash_set_plans(equal_sets, + right_set_keys, + left_set_keys, + set_op, + right_best_plans, + left_best_plans, + ignore_hint, + hash_set_plans))) { LOG_WARN("failed to generate hash set plans", K(ret)); } else { /*do nothing*/ } return ret; @@ -4095,7 +4148,7 @@ int ObSelectLogPlan::get_sort_keys_for_window_function(const ObLogicalOperator * ObSEArray part_directions; ObSEArray output_sort_keys; bool is_const = false; - bool input_ordering_used = false; + int64_t prefix_count = -1; bool input_ordering_all_used = false; sort_keys.reuse(); if (OB_ISNULL(top) || OB_ISNULL(win_expr)) { @@ -4112,7 +4165,7 @@ int ObSelectLogPlan::get_sort_keys_for_window_function(const ObLogicalOperator * ordering, top->get_output_equal_sets(), top->get_output_const_exprs(), - input_ordering_used, + prefix_count, input_ordering_all_used, part_directions))) { LOG_WARN("failed to adjust exprs by ordering", K(ret)); diff --git a/src/sql/optimizer/ob_select_log_plan.h b/src/sql/optimizer/ob_select_log_plan.h index f48053eff..72ace7600 100644 --- a/src/sql/optimizer/ob_select_log_plan.h +++ b/src/sql/optimizer/ob_select_log_plan.h @@ -62,12 +62,14 @@ private: // @brief Get all the group by exprs, rollup exprs and their directions. int get_groupby_rollup_exprs(const ObLogicalOperator *op, + common::ObIArray &reduce_exprs, common::ObIArray &group_by_exprs, common::ObIArray &rollup_exprs, common::ObIArray &group_directions, common::ObIArray &rollup_directions); - int candi_allocate_normal_group_by(const ObIArray &group_by_exprs, + int candi_allocate_normal_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -80,7 +82,8 @@ private: const bool ignore_hint, bool &use_hash_valid, bool &use_merge_valid); - int candi_allocate_normal_group_by(const ObIArray &group_by_exprs, + int candi_allocate_normal_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -91,7 +94,8 @@ private: const bool ignore_hint, ObIArray &groupby_plans); - int candi_allocate_three_stage_group_by(const ObIArray &group_by_exprs, + int candi_allocate_three_stage_group_by(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -101,7 +105,8 @@ private: GroupingOpHelper &groupby_helper, ObIArray &groupby_plans); - int create_hash_group_plan(const ObIArray &group_by_exprs, + int create_hash_group_plan(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &rollup_exprs, const ObIArray &aggr_items, const ObIArray &having_exprs, @@ -128,7 +133,7 @@ private: int64_t topk_precision); int should_create_rollup_pushdown_plan(ObLogicalOperator *top, - const ObIArray &groupby_exprs, + const ObIArray &reduce_exprs, const ObIArray &rollup_exprs, GroupingOpHelper &groupby_helper, bool &is_needed); @@ -140,7 +145,8 @@ private: GroupingOpHelper &groupby_helper, ObLogicalOperator *&top); - int create_merge_group_plan(const ObIArray &group_by_exprs, + int create_merge_group_plan(const ObIArray &reduce_exprs, + const ObIArray &group_by_exprs, const ObIArray &group_directions, const ObIArray &rollup_exprs, const ObIArray &rollup_directions, @@ -168,14 +174,17 @@ private: // @brief Get all the distinct exprs int get_distinct_exprs(const ObLogicalOperator *top, + common::ObIArray &reduce_exprs, common::ObIArray &distinct_exprs); int create_hash_distinct_plan(ObLogicalOperator *&top, GroupingOpHelper &distinct_helper, + ObIArray &reduce_exprs, ObIArray &distinct_exprs); int create_merge_distinct_plan(ObLogicalOperator *&top, GroupingOpHelper &distinct_helper, + ObIArray &reduce_exprs, ObIArray &distinct_exprs, ObIArray &directions, bool &is_plan_valid, @@ -247,6 +256,11 @@ private: int get_pure_set_exprs(ObIArray &pure_set_exprs); + int get_allowed_branch_order(const bool ignore_hint, + const ObSelectStmt::SetOperator set_op, + bool &no_swap, + bool &swap); + /** * @brief create_hash_set * create hash-based set operation diff --git a/src/sql/optimizer/ob_table_location.cpp b/src/sql/optimizer/ob_table_location.cpp index 704882745..4f1e59b34 100644 --- a/src/sql/optimizer/ob_table_location.cpp +++ b/src/sql/optimizer/ob_table_location.cpp @@ -5063,7 +5063,7 @@ int ObTableLocation::try_split_integer_range(const common::ObIArrayborder_flag_.inclusive_end()) { end_val--; } - if (end_val - start_val + 1 > MAX_INTEGER_RANGE_SPLITE_COUNT) { + if (end_val - start_val >= MAX_INTEGER_RANGE_SPLITE_COUNT || end_val - start_val < 0) { all_part = true; } else if (OB_FAIL(int_ranges.push_back(std::pair(start_val, end_val)))) { LOG_WARN("fail to push back integer range", K(ret)); diff --git a/src/sql/parser/sql_parser_mysql_mode.l b/src/sql/parser/sql_parser_mysql_mode.l index c44401060..7d0ca2ff1 100644 --- a/src/sql/parser/sql_parser_mysql_mode.l +++ b/src/sql/parser/sql_parser_mysql_mode.l @@ -877,6 +877,8 @@ Timestamp{whitespace}?\"[^\"]*\" { } INDEX { return INDEX_HINT; } NO_INDEX { return NO_INDEX_HINT; } +USE_DAS { return USE_DAS_HINT; } +NO_USE_DAS { return NO_USE_DAS_HINT; } USE_NL { return USE_NL; } NO_USE_NL { return NO_USE_NL; } USE_NL_MATERIALIZATION { return USE_NL_MATERIALIZATION; } diff --git a/src/sql/parser/sql_parser_mysql_mode.y b/src/sql/parser/sql_parser_mysql_mode.y index f8ec544f5..a15c47795 100644 --- a/src/sql/parser/sql_parser_mysql_mode.y +++ b/src/sql/parser/sql_parser_mysql_mode.y @@ -166,7 +166,7 @@ COALESCE_SQ NO_COALESCE_SQ COUNT_TO_EXISTS NO_COUNT_TO_EXISTS LEFT_TO_ANTI NO_LE ELIMINATE_JOIN NO_ELIMINATE_JOIN PUSH_LIMIT NO_PUSH_LIMIT PULLUP_EXPR NO_PULLUP_EXPR WIN_MAGIC NO_WIN_MAGIC // optimize hint -INDEX_HINT FULL_HINT NO_INDEX_HINT LEADING_HINT ORDERED +INDEX_HINT FULL_HINT NO_INDEX_HINT USE_DAS_HINT NO_USE_DAS_HINT LEADING_HINT ORDERED USE_NL USE_MERGE USE_HASH NO_USE_HASH NO_USE_MERGE NO_USE_NL USE_NL_MATERIALIZATION NO_USE_NL_MATERIALIZATION USE_HASH_AGGREGATION NO_USE_HASH_AGGREGATION @@ -474,7 +474,7 @@ END_P SET_VAR DELIMITER %type optimize_stmt %type dump_memory_stmt %type create_savepoint_stmt rollback_savepoint_stmt release_savepoint_stmt -%type opt_qb_name parallel_hint +%type opt_qb_name parallel_hint pq_set_hint_desc %type create_tablespace_stmt drop_tablespace_stmt tablespace rotate_master_key_stmt %type alter_tablespace_stmt %type permanent_tablespace permanent_tablespace_options permanent_tablespace_option alter_tablespace_actions alter_tablespace_action opt_force_purge @@ -6389,31 +6389,37 @@ REDUNDANT { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 1; + $$->is_hidden_const_ = 1; } | COMPACT { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 2; + $$->is_hidden_const_ = 1; } | DYNAMIC { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 3; + $$->is_hidden_const_ = 1; } | COMPRESSED { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 4; + $$->is_hidden_const_ = 1; } | CONDENSED { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 5; + $$->is_hidden_const_ = 1; } | DEFAULT { malloc_terminal_node($$, result->malloc_pool_, T_INT); $$->value_ = 3; + $$->is_hidden_const_ = 1; } ; /***************************************************************************** @@ -8482,6 +8488,14 @@ INDEX_HINT '(' qb_name_option relation_factor_in_hint NAME_OB ')' { malloc_non_terminal_node($$, result->malloc_pool_, T_FULL_HINT, 2, $3, $4); } +| USE_DAS_HINT '(' qb_name_option relation_factor_in_hint ')' +{ + malloc_non_terminal_node($$, result->malloc_pool_, T_USE_DAS_HINT, 2, $3, $4); +} +| NO_USE_DAS_HINT '(' qb_name_option relation_factor_in_hint ')' +{ + malloc_non_terminal_node($$, result->malloc_pool_, T_NO_USE_DAS_HINT, 2, $3, $4); +} | LEADING_HINT '(' qb_name_option relation_factor_in_leading_hint_list ')' { malloc_non_terminal_node($$, result->malloc_pool_, T_LEADING, 2, $3, $4); @@ -8576,6 +8590,10 @@ INDEX_HINT '(' qb_name_option relation_factor_in_hint NAME_OB ')' (void)($7); /* unused */ malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_DISTRIBUTE, 4, $3, $4, $6, $8); } +| PQ_DISTRIBUTE '(' qb_name_option relation_factor_in_pq_hint ')' +{ + malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_DISTRIBUTE, 4, $3, $4, NULL, NULL); +} | PQ_MAP '(' qb_name_option relation_factor_in_hint ')' { malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_MAP, 2, $3, $4); @@ -8587,11 +8605,9 @@ INDEX_HINT '(' qb_name_option relation_factor_in_hint NAME_OB ')' merge_nodes(method_list, result, T_DISTRIBUTE_METHOD_LIST, $5); malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_DISTRIBUTE_WINDOW, 2, $3, method_list); } -| PQ_SET '(' qb_name_option distribute_method_list ')' +| PQ_SET '(' pq_set_hint_desc ')' { - ParseNode *method_list = NULL; - merge_nodes(method_list, result, T_DISTRIBUTE_METHOD_LIST, $4); - malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_SET, 2, $3, method_list); + $$ = $3; } | GBY_PUSHDOWN opt_qb_name { @@ -8635,6 +8651,29 @@ INDEX_HINT '(' qb_name_option relation_factor_in_hint NAME_OB ')' } ; +pq_set_hint_desc: +'@' qb_name_string qb_name_string distribute_method_list +{ + ParseNode *method_list = NULL; + merge_nodes(method_list, result, T_DISTRIBUTE_METHOD_LIST, $4); + malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_SET, 3, $2, $3, method_list); +} +| '@' qb_name_string distribute_method_list +{ + ParseNode *method_list = NULL; + merge_nodes(method_list, result, T_DISTRIBUTE_METHOD_LIST, $3); + malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_SET, 3, $2, NULL, method_list); +} +| '@' qb_name_string qb_name_string +{ + malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_SET, 3, $2, $3, NULL); +} +| '@' qb_name_string +{ + malloc_non_terminal_node($$, result->malloc_pool_, T_PQ_SET, 3, $2, NULL, NULL); +} +; + opt_qb_name: '(' qb_name_option ')' { diff --git a/src/sql/plan_cache/ob_sql_parameterization.cpp b/src/sql/plan_cache/ob_sql_parameterization.cpp index fce62bcec..57a53d985 100644 --- a/src/sql/plan_cache/ob_sql_parameterization.cpp +++ b/src/sql/plan_cache/ob_sql_parameterization.cpp @@ -784,7 +784,7 @@ int ObSqlParameterization::check_and_generate_param_info(const ObIArraynum_child_; ++i) { ObRawExpr* raw_expr = NULL; CK (OB_NOT_NULL(params_node->children_[i])); - OZ (pl::ObPLResolver::resolve_raw_expr(*params_node->children_[i], params_, raw_expr)); + if (OB_SUCC(ret) && params_.is_execute_call_stmt_) { + ObArray columns; + ObArray sys_vars; + ObArray aggr_exprs; + ObArray win_exprs; + ObArray sub_query_info; + ObArray udf_info; + ObArray op_exprs; + if (OB_FAIL(ObRawExprUtils::build_raw_expr(*params_.expr_factory_, + *params_.session_info_, + params_.schema_checker_, + params_.secondary_namespace_, + T_PL_SCOPE, + NULL/*ObStmt*/, + params_.param_list_, + NULL/*external_param_info*/, + *params_node->children_[i], + raw_expr, + columns, + sys_vars, + aggr_exprs, + win_exprs, + sub_query_info, + udf_info, + op_exprs, + true, + static_cast(params_.tg_timing_event_)))) { + LOG_WARN("failed to build raw expr", K(ret)); + } + } else { + OZ (pl::ObPLResolver::resolve_raw_expr(*params_node->children_[i], params_, raw_expr)); + } CK (OB_NOT_NULL(raw_expr)); OZ (check_param_expr_legal(raw_expr)); OZ (expr_params.push_back(raw_expr)); @@ -269,9 +300,9 @@ int ObCallProcedureResolver::resolve(const ParseNode &parse_tree) } } } + ObSEArray expr_params; // 获取routine schem info if (OB_SUCC(ret)) { - ObSEArray expr_params; if (OB_NOT_NULL(params_node) && OB_FAIL(resolve_param_exprs(params_node, expr_params))) { LOG_WARN("failed to resolve param exprs", K(ret)); @@ -310,7 +341,12 @@ int ObCallProcedureResolver::resolve(const ParseNode &parse_tree) } } // 解析参数列表 - OZ (resolve_cparams(params_node, proc_info, stmt)); + if (OB_SUCC(ret) && params_.is_execute_call_stmt_) { + OZ (stmt->add_params(expr_params)); + OX (stmt->set_can_direct_use_param(true)); + } else { + OZ (resolve_cparams(params_node, proc_info, stmt)); + } if (OB_SUCC(ret)) { if (OB_INVALID_ID == proc_info->get_package_id()) { diff --git a/src/sql/resolver/cmd/ob_resource_resolver.h b/src/sql/resolver/cmd/ob_resource_resolver.h index 6ea33278c..dfa4be61e 100644 --- a/src/sql/resolver/cmd/ob_resource_resolver.h +++ b/src/sql/resolver/cmd/ob_resource_resolver.h @@ -246,7 +246,7 @@ public: name = "IOPS_WEIGHT"; break; default: - LOG_ERROR("invalid item type for RESOURCE UNIT", K(type)); + LOG_WARN("invalid item type for RESOURCE UNIT", K(type)); name = "UNKNOWN"; break; } @@ -319,12 +319,12 @@ int ObResourceUnitOptionResolver::check_value_(const ValueT value, // iops weight is allowed to set zero print_invalid_argument_user_error_(type, ", value should be positive"); ret = common::OB_INVALID_ARGUMENT; - LOG_ERROR("param can't be zero", KR(ret), K(type), K(value)); + LOG_WARN("param can't be zero", KR(ret), K(type), K(value)); } } else if (OB_UNLIKELY(value < 0)) { print_invalid_argument_user_error_(type, ", value can not be negative"); ret = common::OB_INVALID_ARGUMENT; - LOG_ERROR("param can not be negative", KR(ret), K(type), K(value)); + LOG_WARN("param can not be negative", KR(ret), K(type), K(value)); } else { // succ } @@ -397,14 +397,14 @@ int ObResourceUnitOptionResolver::resolve_varchar_(ParseNode *child, const Ob parse_int_value = common::ObConfigCapacityParser::get(buf.ptr(), valid); } else { ret = common::OB_INVALID_ARGUMENT; - LOG_ERROR("invalid option node type", KR(ret), K(type), K(buf)); + LOG_WARN("invalid option node type", KR(ret), K(type), K(buf)); } if (OB_FAIL(ret)) { } else if (!valid) { print_invalid_argument_user_error_(type, ", parse int value error"); ret = common::OB_ERR_PARSE_SQL; - LOG_ERROR("parse varchar value to int fail", KR(ret), K(type), K(buf), K(valid)); + LOG_WARN("parse varchar value to int fail", KR(ret), K(type), K(buf), K(valid)); } } return ret; @@ -475,7 +475,7 @@ int ObResourceUnitOptionResolver::resolve_option_(ParseNode *option_node, sha } else { /* won't be here */ ret = common::OB_ERR_UNEXPECTED; - LOG_ERROR("unknown resource unit option, unexprected", KR(ret), K(option_type), + LOG_WARN("unknown resource unit option, unexprected", KR(ret), K(option_type), K(parse_int_value)); } } diff --git a/src/sql/resolver/ddl/ob_drop_sequence_resolver.cpp b/src/sql/resolver/ddl/ob_drop_sequence_resolver.cpp index 8cefdb676..910bf6d21 100644 --- a/src/sql/resolver/ddl/ob_drop_sequence_resolver.cpp +++ b/src/sql/resolver/ddl/ob_drop_sequence_resolver.cpp @@ -59,7 +59,7 @@ int ObDropSequenceResolver::resolve(const ParseNode &parse_tree) if (OB_SUCC(ret)) { if (OB_UNLIKELY(NULL == (mystmt = create_stmt()))) { ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_ERROR("failed to drop select stmt"); + LOG_WARN("failed to drop select stmt", K(ret)); } else { stmt_ = mystmt; } @@ -74,7 +74,7 @@ int ObDropSequenceResolver::resolve(const ParseNode &parse_tree) sequence_name, db_name))) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR("invalid parse_tree", K(ret)); + LOG_WARN("invalid parse_tree", K(ret)); } else if (sequence_name.length() > OB_MAX_SEQUENCE_NAME_LENGTH) { ret = OB_ERR_TOO_LONG_IDENT; LOG_USER_ERROR(OB_ERR_TOO_LONG_IDENT, sequence_name.length(), sequence_name.ptr()); diff --git a/src/sql/resolver/ddl/ob_trigger_resolver.cpp b/src/sql/resolver/ddl/ob_trigger_resolver.cpp index 2fe5ad926..06a2738d6 100644 --- a/src/sql/resolver/ddl/ob_trigger_resolver.cpp +++ b/src/sql/resolver/ddl/ob_trigger_resolver.cpp @@ -471,6 +471,7 @@ int ObTriggerResolver::resolve_timing_point(int16_t before_or_after, int16_t stm const ObString &trigger_body = trigger_arg.trigger_info_.get_trigger_body(); parse_result.is_for_trigger_ = 1; parse_result.mysql_compatible_comment_ = 0; + parse_result.is_dynamic_sql_ = 0; OZ (pl_parser.parse(trigger_body, trigger_body, parse_result)); CK (OB_NOT_NULL(parse_tree = parse_result.result_tree_)); CK (T_STMT_LIST == parse_tree->type_); diff --git a/src/sql/resolver/dml/ob_del_upd_resolver.cpp b/src/sql/resolver/dml/ob_del_upd_resolver.cpp index 969507186..33f61bba7 100644 --- a/src/sql/resolver/dml/ob_del_upd_resolver.cpp +++ b/src/sql/resolver/dml/ob_del_upd_resolver.cpp @@ -1628,6 +1628,7 @@ bool ObDelUpdResolver::need_all_columns(const ObTableSchema &table_schema, int64 table_schema.get_foreign_key_infos().count() > 0 || table_schema.get_trigger_list().count() > 0 || table_schema.has_check_constraint() || + table_schema.has_generated_and_partkey_column() || binlog_row_image == ObBinlogRowImage::FULL); } diff --git a/src/sql/resolver/dml/ob_dml_resolver.cpp b/src/sql/resolver/dml/ob_dml_resolver.cpp index 6cde8ec68..3270d7574 100644 --- a/src/sql/resolver/dml/ob_dml_resolver.cpp +++ b/src/sql/resolver/dml/ob_dml_resolver.cpp @@ -84,6 +84,7 @@ ObDMLResolver::ObDMLResolver(ObResolverParams ¶ms) with_clause_without_record_(false), is_prepare_stage_(params.is_prepare_stage_), in_pl_(params.secondary_namespace_ || params.is_dynamic_sql_ || params.is_dbms_sql_), + resolve_alias_for_subquery_(true), current_view_level_(0), view_ref_id_(OB_INVALID_ID), is_resolving_view_(false), @@ -7645,7 +7646,6 @@ int ObDMLResolver::check_oracle_outer_join_condition(const ObRawExpr *expr) return ret; } -// bugfix: https://workitem.aone.alibaba-inc.com/req/37137663 // in some cases, oracle_outer_join is allowed in IN/OR int ObDMLResolver::check_oracle_outer_join_in_or_validity(const ObRawExpr *expr, ObIArray &right_tables) @@ -9410,7 +9410,9 @@ int ObDMLResolver::resolve_optimize_hint(const ParseNode &hint_node, switch (hint_node.type_) { case T_INDEX_HINT: case T_NO_INDEX_HINT: - case T_FULL_HINT: { + case T_FULL_HINT: + case T_USE_DAS_HINT: + case T_NO_USE_DAS_HINT: { if (OB_FAIL(resolve_index_hint(hint_node, opt_hint))) { LOG_WARN("failed to resolve index hint", K(ret)); } @@ -9555,11 +9557,11 @@ int ObDMLResolver::resolve_index_hint(const ParseNode &index_node, LOG_WARN("Failed to resolve qb name node", K(ret)); } else if (OB_FAIL(resolve_table_relation_in_hint(*table_node, index_hint->get_table()))) { LOG_WARN("Resolve table relation fail", K(ret)); - } else if (T_FULL_HINT == index_hint->get_hint_type()) { + } else if (T_FULL_HINT == index_hint->get_hint_type() || + T_USE_DAS_HINT == index_hint->get_hint_type()) { index_hint->set_qb_name(qb_name); opt_hint = index_hint; - } else if (OB_UNLIKELY(!index_hint->is_access_path_hint()) || - OB_UNLIKELY(3 != index_node.num_child_) || + } else if (OB_UNLIKELY(3 != index_node.num_child_) || OB_ISNULL(index_name_node = index_node.children_[2])) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected index hint", K(ret), K(index_node.type_), K(index_node.num_child_), @@ -9732,35 +9734,40 @@ int ObDMLResolver::resolve_pq_distribute_hint(const ParseNode &hint_node, int ret = OB_SUCCESS; opt_hint = NULL; if (OB_UNLIKELY(4 != hint_node.num_child_) - || OB_ISNULL(hint_node.children_[1]) - || OB_ISNULL(hint_node.children_[2]) - || OB_ISNULL(hint_node.children_[3])) { + || OB_ISNULL(hint_node.children_[1])) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected PQ Distribute hint node", K(ret), K(hint_node.num_child_)); } else { - ObItemType outer = hint_node.children_[2]->type_; - ObItemType inner = hint_node.children_[3]->type_; DistAlgo dist_algo = DistAlgo::DIST_INVALID_METHOD; - if (T_DISTRIBUTE_HASH == outer && T_DISTRIBUTE_HASH == inner) { - dist_algo = DistAlgo::DIST_HASH_HASH; - } else if (T_DISTRIBUTE_BROADCAST == outer && T_DISTRIBUTE_NONE == inner) { - dist_algo = DistAlgo::DIST_BROADCAST_NONE; - } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_BROADCAST == inner) { - dist_algo = DistAlgo::DIST_NONE_BROADCAST; - } else if (T_DISTRIBUTE_PARTITION == outer && T_DISTRIBUTE_NONE == inner) { - dist_algo = DistAlgo::DIST_PARTITION_NONE; - } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_PARTITION == inner) { - dist_algo = DistAlgo::DIST_NONE_PARTITION; - } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_NONE == inner) { - dist_algo = DistAlgo::DIST_PARTITION_WISE; - } else if (T_DISTRIBUTE_LOCAL == outer && T_DISTRIBUTE_LOCAL == inner) { - dist_algo = DistAlgo::DIST_PULL_TO_LOCAL; - } else if (T_DISTRIBUTE_BC2HOST == outer && T_DISTRIBUTE_NONE == inner) { - dist_algo = DistAlgo::DIST_BC2HOST_NONE; - } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_ALL == inner) { - dist_algo = DistAlgo::DIST_NONE_ALL; - } else if (T_DISTRIBUTE_ALL == outer && T_DISTRIBUTE_NONE == inner) { - dist_algo = DistAlgo::DIST_ALL_NONE; + if (OB_ISNULL(hint_node.children_[2]) && OB_ISNULL(hint_node.children_[3])) { + dist_algo = DistAlgo::DIST_BASIC_METHOD; + } else if (OB_ISNULL(hint_node.children_[2]) || OB_ISNULL(hint_node.children_[3])) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected PQ Distribute null child", K(ret), K(hint_node.children_[2]), K(hint_node.children_[2])); + } else { + ObItemType outer = hint_node.children_[2]->type_; + ObItemType inner = hint_node.children_[3]->type_; + if (T_DISTRIBUTE_HASH == outer && T_DISTRIBUTE_HASH == inner) { + dist_algo = DistAlgo::DIST_HASH_HASH; + } else if (T_DISTRIBUTE_BROADCAST == outer && T_DISTRIBUTE_NONE == inner) { + dist_algo = DistAlgo::DIST_BROADCAST_NONE; + } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_BROADCAST == inner) { + dist_algo = DistAlgo::DIST_NONE_BROADCAST; + } else if (T_DISTRIBUTE_PARTITION == outer && T_DISTRIBUTE_NONE == inner) { + dist_algo = DistAlgo::DIST_PARTITION_NONE; + } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_PARTITION == inner) { + dist_algo = DistAlgo::DIST_NONE_PARTITION; + } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_NONE == inner) { + dist_algo = DistAlgo::DIST_PARTITION_WISE; + } else if (T_DISTRIBUTE_LOCAL == outer && T_DISTRIBUTE_LOCAL == inner) { + dist_algo = DistAlgo::DIST_PULL_TO_LOCAL; + } else if (T_DISTRIBUTE_BC2HOST == outer && T_DISTRIBUTE_NONE == inner) { + dist_algo = DistAlgo::DIST_BC2HOST_NONE; + } else if (T_DISTRIBUTE_NONE == outer && T_DISTRIBUTE_ALL == inner) { + dist_algo = DistAlgo::DIST_NONE_ALL; + } else if (T_DISTRIBUTE_ALL == outer && T_DISTRIBUTE_NONE == inner) { + dist_algo = DistAlgo::DIST_ALL_NONE; + } } if (DistAlgo::DIST_INVALID_METHOD != dist_algo) { @@ -9788,21 +9795,22 @@ int ObDMLResolver::resolve_pq_set_hint(const ParseNode &hint_node, { int ret = OB_SUCCESS; opt_hint = NULL; - const ParseNode *dist_methods_node = NULL; ObSEArray dist_methods; ObString qb_name; + ObString left_branch; ObPQSetHint *pq_dis_hint = NULL; int64_t random_none_idx = OB_INVALID_INDEX; - if (OB_UNLIKELY(2 != hint_node.num_child_) - || OB_ISNULL(dist_methods_node = hint_node.children_[1]) - || OB_UNLIKELY(T_DISTRIBUTE_METHOD_LIST != dist_methods_node->type_)) { + bool is_valid = false; + if (OB_UNLIKELY(3 != hint_node.num_child_)) { ret = OB_ERR_UNEXPECTED; - LOG_WARN("unexpected pq_set hint node", K(ret), K(hint_node.num_child_), K(dist_methods_node)); + LOG_WARN("unexpected pq_set hint node", K(ret), K(hint_node.num_child_)); } else if (OB_FAIL(resolve_qb_name_node(hint_node.children_[0], qb_name))) { LOG_WARN("failed to resolve query block name", K(ret)); - } else if (OB_FAIL(get_valid_dist_methods(*dist_methods_node, dist_methods))) { + } else if (OB_FAIL(resolve_qb_name_node(hint_node.children_[1], left_branch))) { + LOG_WARN("failed to resolve query block name", K(ret)); + } else if (OB_FAIL(get_valid_dist_methods(hint_node.children_[2], dist_methods, is_valid))) { LOG_WARN("failed to get valid dist methods", K(ret)); - } else if (dist_methods.empty()) { + } else if (!is_valid) { /* do nothing */ } else if (OB_FAIL(ObQueryHint::create_hint(allocator_, hint_node.type_, pq_dis_hint))) { LOG_WARN("failed to create hint", K(ret)); @@ -9810,26 +9818,40 @@ int ObDMLResolver::resolve_pq_set_hint(const ParseNode &hint_node, LOG_WARN("failed to assign dist methods", K(ret)); } else { pq_dis_hint->set_qb_name(qb_name); + pq_dis_hint->set_left_branch(left_branch); opt_hint = pq_dis_hint; } return ret; } -int ObDMLResolver::get_valid_dist_methods(const ParseNode &dist_methods_node, - ObIArray &dist_methods) +int ObDMLResolver::get_valid_dist_methods(const ParseNode *dist_methods_node, + ObIArray &dist_methods, + bool &is_valid) { int ret = OB_SUCCESS; dist_methods.reuse(); - for (int64_t i = 0; OB_SUCC(ret) && i < dist_methods_node.num_child_; ++i) { - if (OB_ISNULL(dist_methods_node.children_[i])) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("unexpected null", K(ret), K(i)); - } else if (OB_FAIL(dist_methods.push_back(dist_methods_node.children_[i]->type_))) { - LOG_WARN("failed to push back", K(ret)); + is_valid = false; + if (OB_ISNULL(dist_methods_node)) { + is_valid = true; + } else if (OB_UNLIKELY(T_DISTRIBUTE_METHOD_LIST != dist_methods_node->type_)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected pq_set hint node", K(ret), K(get_type_name(dist_methods_node->type_))); + } else if (OB_UNLIKELY(2 > dist_methods_node->num_child_)) { + /* do nothing */ + } else { + is_valid = true; + for (int64_t i = 0; OB_SUCC(ret) && i < dist_methods_node->num_child_; ++i) { + if (OB_ISNULL(dist_methods_node->children_[i])) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected null", K(ret), K(i)); + } else if (OB_FAIL(dist_methods.push_back(dist_methods_node->children_[i]->type_))) { + LOG_WARN("failed to push back", K(ret)); + } + } + if (OB_SUCC(ret) && !ObPQSetHint::is_valid_dist_methods(dist_methods)) { + dist_methods.reuse(); + is_valid = false; } - } - if (OB_SUCC(ret) && !ObPQSetHint::is_valid_dist_methods(dist_methods)) { - dist_methods.reuse(); } return ret; } diff --git a/src/sql/resolver/dml/ob_dml_resolver.h b/src/sql/resolver/dml/ob_dml_resolver.h index 4b9ac937f..681bf849d 100644 --- a/src/sql/resolver/dml/ob_dml_resolver.h +++ b/src/sql/resolver/dml/ob_dml_resolver.h @@ -652,7 +652,9 @@ private: const ObTableSchema *table_schema); int resolve_multi_qb_name_list(const ParseNode *qb_name_node, common::ObIArray &qb_name_list); int resolve_qb_name_list(const ParseNode *qb_name_node, ObIArray &qb_name_list); - int get_valid_dist_methods(const ParseNode &dist_methods_node, ObIArray &dist_methods); + int get_valid_dist_methods(const ParseNode *dist_methods_node, + ObIArray &dist_methods, + bool &is_valid); int find_table_index_infos(const ObString &index_name, const TableItem *table_item, bool &find_it, @@ -709,6 +711,7 @@ protected: bool with_clause_without_record_; bool is_prepare_stage_; bool in_pl_; + bool resolve_alias_for_subquery_; int32_t current_view_level_; uint64_t view_ref_id_; bool is_resolving_view_; diff --git a/src/sql/resolver/dml/ob_dml_stmt.cpp b/src/sql/resolver/dml/ob_dml_stmt.cpp index 17ae986f3..6ca5e3d29 100644 --- a/src/sql/resolver/dml/ob_dml_stmt.cpp +++ b/src/sql/resolver/dml/ob_dml_stmt.cpp @@ -4140,15 +4140,11 @@ int ObDMLStmt::hint_table_may_used(ObCollationType cs_type, { int ret = OB_SUCCESS; may_appear = false; - for (int64_t i = 0; !may_appear && OB_SUCC(ret) && i < table_items_.count(); ++i) { - if (OB_ISNULL(table_items_.at(i))) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("get unexpected null", K(ret)); - } else { - may_appear = hint_table.is_match_table_item(cs_type, *table_items_.at(i)); - } - } - if (OB_SUCC(ret) && !may_appear) { + if (OB_FAIL(check_hint_table_matched_table_item(cs_type, hint_table, may_appear))) { + LOG_WARN("failed to check hint table matched table item", K(ret)); + } else if (may_appear) { + /* do nohting */ + } else { ObSEArray child_stmts; if (is_set_stmt() && OB_FAIL(ObDMLStmt::get_child_stmts(child_stmts))) { // for set stmt, do not check union set child stmt. @@ -4169,6 +4165,23 @@ int ObDMLStmt::hint_table_may_used(ObCollationType cs_type, return ret; } +int ObDMLStmt::check_hint_table_matched_table_item(ObCollationType cs_type, + const ObTableInHint &hint_table, + bool &matched) const +{ + int ret = OB_SUCCESS; + matched = false; + for (int64_t i = 0; !matched && OB_SUCC(ret) && i < table_items_.count(); ++i) { + if (OB_ISNULL(table_items_.at(i))) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get unexpected null", K(ret)); + } else { + matched = hint_table.is_match_table_item(cs_type, *table_items_.at(i)); + } + } + return ret; +} + int ObDMLStmt::CheckConstraintItem::deep_copy(ObIRawExprCopier &expr_copier, const CheckConstraintItem &other) { diff --git a/src/sql/resolver/dml/ob_dml_stmt.h b/src/sql/resolver/dml/ob_dml_stmt.h index 2db649d06..226c9483a 100644 --- a/src/sql/resolver/dml/ob_dml_stmt.h +++ b/src/sql/resolver/dml/ob_dml_stmt.h @@ -678,6 +678,9 @@ public: int hint_table_may_used(ObCollationType cs_type, const ObTableInHint &hint_table, bool &may_appear) const; + int check_hint_table_matched_table_item(ObCollationType cs_type, + const ObTableInHint &hint_table, + bool &matched) const; virtual bool has_subquery() const; inline bool has_order_by() const { return (get_order_item_size() > 0); } int add_joined_table(JoinedTable *joined_table) { return joined_tables_.push_back(joined_table); } diff --git a/src/sql/resolver/dml/ob_hint.cpp b/src/sql/resolver/dml/ob_hint.cpp index 427448991..f16b4d312 100644 --- a/src/sql/resolver/dml/ob_hint.cpp +++ b/src/sql/resolver/dml/ob_hint.cpp @@ -530,6 +530,14 @@ bool ObOptParamHint::is_param_val_valid(const OptParamType param_type, const ObO is_valid = val.is_int() && (0 <= val.get_int() && 65535 >= val.get_int()); break; } + case DDL_EXECUTION_ID: { + is_valid = val.is_int() && (0 < val.get_int()); + break; + } + case DDL_TASK_ID: { + is_valid = val.is_int() && (0 < val.get_int()); + break; + } default: LOG_TRACE("invalid opt param val", K(param_type), K(val)); break; @@ -645,6 +653,7 @@ ObItemType ObHint::get_hint_type(ObItemType type) case T_NO_PULLUP_EXPR : return T_PULLUP_EXPR; // optimize hint + case T_NO_USE_DAS_HINT: return T_USE_DAS_HINT; case T_ORDERED: return T_LEADING; case T_NO_USE_MERGE: return T_USE_MERGE; case T_NO_USE_HASH: return T_USE_HASH; @@ -700,6 +709,7 @@ const char* ObHint::get_hint_name(ObItemType type, bool is_enable_hint /* defaul case T_INDEX_HINT: return "INDEX"; case T_FULL_HINT: return "FULL"; case T_NO_INDEX_HINT: return "NO_INDEX"; + case T_USE_DAS_HINT: return is_enable_hint ? "USE_DAS" : "NO_USE_DAS"; case T_LEADING: return is_enable_hint ? "LEADING" : "ORDERED"; case T_USE_MERGE: return is_enable_hint ? "USE_MERGE" : "NO_USE_MERGE"; case T_USE_HASH: return is_enable_hint ? "USE_HASH" : "NO_USE_HASH"; @@ -1473,7 +1483,7 @@ int ObSemiToInnerHint::print_hint_desc(planText &plan_text) const //do nothing } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF("("))) { LOG_WARN("failed to print hint", K(ret)); - } else if (OB_FAIL(ObTableInHint::print_join_tables_in_hint(plan_text, tables_))) { + } else if (OB_FAIL(ObTableInHint::print_join_tables_in_hint(plan_text, tables_, true))) { LOG_WARN("failed to print tables", K(ret)); } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF(")"))) { LOG_WARN("failed to print hint", K(ret)); @@ -1621,8 +1631,9 @@ int ObIndexHint::print_hint_desc(planText &plan_text) const int64_t &pos = plan_text.pos; if (OB_FAIL(table_.print_table_in_hint(plan_text))) { LOG_WARN("fail to print table in hint", K(ret)); - } else if (T_FULL_HINT != hint_type_ && - OB_FAIL(BUF_PRINTF(" \"%.*s\"", index_name_.length(), index_name_.ptr()))) { + } else if (T_FULL_HINT == hint_type_ || T_USE_DAS_HINT == hint_type_) { + /* do nothing */ + } else if (OB_FAIL(BUF_PRINTF(" \"%.*s\"", index_name_.length(), index_name_.ptr()))) { LOG_WARN("fail to print index name", K(ret)); } return ret; @@ -1646,6 +1657,7 @@ int ObJoinHint::print_hint_desc(planText &plan_text) const char *buf = plan_text.buf; int64_t &buf_len = plan_text.buf_len; int64_t &pos = plan_text.pos; + const char* algo_str = get_dist_algo_str(); if (OB_UNLIKELY(tables_.empty())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected join hint", K(ret)); @@ -1655,7 +1667,8 @@ int ObJoinHint::print_hint_desc(planText &plan_text) const LOG_WARN("failed to print join tables", K(ret)); } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF(")"))) { LOG_WARN("failed to print hint", K(ret)); - } else if (T_PQ_DISTRIBUTE == hint_type_ && OB_FAIL(BUF_PRINTF(" %s", get_dist_algo_str()))) { + } else if (T_PQ_DISTRIBUTE == hint_type_ && NULL != algo_str + && OB_FAIL(BUF_PRINTF(" %s", get_dist_algo_str()))) { LOG_WARN("failed to print dist algo", K(ret)); } return ret; @@ -1740,6 +1753,7 @@ int ObJoinFilterHint::print_hint_desc(planText &plan_text) const int ObPQSetHint::assign(const ObPQSetHint &other) { int ret = OB_SUCCESS; + left_branch_ = other.left_branch_; if (OB_FAIL(dist_methods_.assign(other.dist_methods_))) { LOG_WARN("fail to assign dist methods", K(ret)); } else if (OB_FAIL(ObOptHint::assign(other))) { @@ -1843,6 +1857,9 @@ int ObPQSetHint::print_hint_desc(planText &plan_text) const if (OB_UNLIKELY(false == is_valid_dist_methods(dist_methods_))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected pq set hint", K(ret)); + } else if (!left_branch_.empty() + && OB_FAIL(BUF_PRINTF(" \"%.*s\"", left_branch_.length(), left_branch_.ptr()))) { + LOG_WARN("failed to print left branch qb name", K(ret)); } for (int i = 0; OB_SUCC(ret) && i < dist_methods_.count(); ++i) { if (OB_FAIL(BUF_PRINTF(" %s", get_dist_method_str(dist_methods_.at(i))))) { @@ -1864,7 +1881,9 @@ DistAlgo ObPQSetHint::get_dist_algo(const ObIArray &dist_methods, { DistAlgo dist_algo = DistAlgo::DIST_INVALID_METHOD; random_none_idx = OB_INVALID_INDEX; - if (dist_methods.count() < 2) { + if (dist_methods.empty()) { + dist_algo = DistAlgo::DIST_BASIC_METHOD; + } else if (dist_methods.count() < 2) { /* do nothing */ } else if (2 == dist_methods.count()) { const ObItemType method1 = dist_methods.at(0); @@ -2251,11 +2270,13 @@ bool ObTableInHint::is_match_table_items(ObCollationType cs_type, return bret; } -void ObTableInHint::reset(const TableItem& table) +void ObTableInHint::set_table(const TableItem& table) { - qb_name_.reset(); - db_name_.assign_ptr(table.database_name_.ptr(), table.database_name_.length()); + qb_name_.assign_ptr(table.qb_name_.ptr(), table.qb_name_.length()); table_name_.assign_ptr(table.get_table_name().ptr(), table.get_table_name().length()); + if (table.is_basic_table()) { + db_name_.assign_ptr(table.database_name_.ptr(), table.database_name_.length()); + } } const char *ObWindowDistHint::get_dist_algo_str(WinDistAlgo dist_algo) diff --git a/src/sql/resolver/dml/ob_hint.h b/src/sql/resolver/dml/ob_hint.h index aae4269de..f493d3d91 100644 --- a/src/sql/resolver/dml/ob_hint.h +++ b/src/sql/resolver/dml/ob_hint.h @@ -70,6 +70,8 @@ struct ObOptParamHint DEF(HIDDEN_COLUMN_VISIBLE,) \ DEF(ROWSETS_ENABLED,) \ DEF(ROWSETS_MAX_ROWS,) \ + DEF(DDL_EXECUTION_ID,) \ + DEF(DDL_TASK_ID,) \ DECLARE_ENUM(OptParamType, opt_param, OPT_PARAM_TYPE_DEF, static); @@ -245,7 +247,7 @@ struct ObTableInHint bool ignore_qb_name = false); void reset() { qb_name_.reset(); db_name_.reset(); table_name_.reset(); } - void reset(const TableItem& table); + void set_table(const TableItem& table); DECLARE_TO_STRING; @@ -706,7 +708,7 @@ private: class ObTableParallelHint : public ObOptHint { public: - ObTableParallelHint(ObItemType hint_type) + ObTableParallelHint(ObItemType hint_type = T_TABLE_PARALLEL) : ObOptHint(hint_type), parallel_(ObGlobalHint::UNSET_PARALLEL) { set_hint_class(HINT_TABLE_PARALLEL); @@ -788,7 +790,8 @@ class ObPQSetHint : public ObOptHint public: ObPQSetHint(ObItemType hint_type = T_PQ_SET) : ObOptHint(hint_type), - dist_methods_() + dist_methods_(), + left_branch_() { set_hint_class(HINT_PQ_SET); } @@ -804,11 +807,13 @@ class ObPQSetHint : public ObOptHint ObIArray &get_dist_methods() { return dist_methods_; } int set_pq_set_hint(const DistAlgo dist_algo, const int64_t child_num, const int64_t random_none_idx); DistAlgo get_dist_algo(int64_t &random_none_idx) const { return get_dist_algo(dist_methods_, random_none_idx); } - - INHERIT_TO_STRING_KV("ObHint", ObHint, K_(dist_methods)); + const ObString &get_left_branch() const { return left_branch_; } + void set_left_branch(const ObString &left_branch) { return left_branch_.assign_ptr(left_branch.ptr(), left_branch.length()); } + INHERIT_TO_STRING_KV("ObHint", ObHint, K_(dist_methods), K_(left_branch)); private: common::ObSEArray dist_methods_; + common::ObString left_branch_; // qb_name for first branch of set, used for union distinct / intersect }; class ObJoinOrderHint : public ObOptHint { diff --git a/src/sql/resolver/dml/ob_select_resolver.cpp b/src/sql/resolver/dml/ob_select_resolver.cpp index 41ed5440e..68daf1cfc 100644 --- a/src/sql/resolver/dml/ob_select_resolver.cpp +++ b/src/sql/resolver/dml/ob_select_resolver.cpp @@ -5433,20 +5433,21 @@ int ObSelectResolver::resolve_alias_column_ref( } // subquery cannot ref parent aggr/window function alias - // SELECT SUM(c1) OVER () AS c, (SELECT SUM(c) from t2) FROM t1; - // SELECT SUM(c1) AS c, (SELECT SUM(c) from t2) FROM t1; - if(OB_SUCC(ret) && current_level_ < q_name.current_resolve_level_ && T_FIELD_LIST_SCOPE == current_scope_) { + // SELECT SUM(c1) OVER () AS c, (SELECT c from t2) FROM t1; + // SELECT SUM(c1) AS c, (SELECT c from t2) FROM t1; + // SELECT SUM(c1) AS c FROM t1 having (SELECT SUM(c) from t2) > 0; + if(OB_SUCC(ret) && current_level_ < q_name.current_resolve_level_) { bool cnt_aggr = false; if (OB_FAIL(ObRawExprUtils::cnt_current_level_aggr_expr( real_ref_expr, current_level_, cnt_aggr))) { LOG_WARN("check cnt_current level aggr expr failed", K(ret)); } else if (cnt_aggr) { - ret = OB_ERR_BAD_FIELD_ERROR; + ret = OB_ILLEGAL_REFERENCE; } else if (OB_FAIL(ObRawExprUtils::cnt_current_level_window_expr( real_ref_expr, current_level_, cnt_aggr))) { LOG_WARN("check cnt_current level window expr failed", K(ret)); } else if (cnt_aggr) { - ret = OB_ERR_BAD_FIELD_ERROR; + ret = OB_ILLEGAL_REFERENCE; } } @@ -5772,6 +5773,8 @@ int ObSelectResolver::resolve_subquery_info(const ObIArray &subq subquery_resolver.set_parent_namespace_resolver(this); subquery_resolver.set_current_view_level(current_view_level_); set_query_ref_expr(info.ref_expr_); + resolve_alias_for_subquery_ = !(T_FIELD_LIST_SCOPE == current_scope_ + && info.parents_expr_info_.has_member(IS_AGG)); if (OB_FAIL(subquery_resolver.add_parent_gen_col_exprs(gen_col_exprs_))) { LOG_WARN("failed to add parent gen col exprs", K(ret)); } @@ -5818,7 +5821,7 @@ int ObSelectResolver::resolve_column_ref_for_subquery( } else if (OB_FAIL(resolve_table_column_ref(q_name, real_ref_expr))) { LOG_WARN_IGNORE_COL_NOTFOUND(ret, "resolve table column failed", K(ret), K(q_name)); } - if (OB_ERR_BAD_FIELD_ERROR == ret) { + if (OB_ERR_BAD_FIELD_ERROR == ret && resolve_alias_for_subquery_) { if (OB_FAIL(resolve_alias_column_ref(q_name, real_ref_expr))) { LOG_WARN_IGNORE_COL_NOTFOUND(ret, "resolve alias column ref failed", K(ret), K(q_name)); } diff --git a/src/sql/resolver/dml/ob_sql_hint.cpp b/src/sql/resolver/dml/ob_sql_hint.cpp index 009f75328..beab0cbcc 100644 --- a/src/sql/resolver/dml/ob_sql_hint.cpp +++ b/src/sql/resolver/dml/ob_sql_hint.cpp @@ -272,6 +272,7 @@ int ObQueryHint::check_ddl_schema_version_from_hint(const ObDMLStmt &stmt, OB_UNLIKELY(ddlSchemaVersionHint.schema_version_ != item->ddl_schema_version_)) { ret = OB_DDL_SCHEMA_VERSION_NOT_MATCH; LOG_USER_ERROR(OB_DDL_SCHEMA_VERSION_NOT_MATCH); + LOG_WARN("failed to check ddl schema version", K(ret), K(item->ddl_schema_version_), K(ddlSchemaVersionHint.schema_version_)); } return ret; } @@ -1088,26 +1089,27 @@ int ObStmtHint::init_stmt_hint(const ObDMLStmt &stmt, set_query_hint(&query_hint); ObString qb_name; const ObHints *qb_hints = NULL; - const ObHints *stmt_id_hints = use_stmt_id_hints - ? query_hint.get_stmt_id_hints(stmt.get_stmt_id()) - : NULL; - if (OB_FAIL(query_hint.get_qb_name(stmt.get_stmt_id(), qb_name))) { - LOG_WARN("failed to get qb name", K(ret), K(stmt.get_stmt_id()), K(qb_name)); - } else if (OB_FALSE_IT(qb_hints = query_hint.get_qb_hints(qb_name))) { - } else if (NULL == qb_hints && NULL == stmt_id_hints) { + ObSEArray all_hints; + if (OB_FAIL(stmt.get_qb_name(qb_name))) { + LOG_WARN("failed to get qb name", K(ret)); + } else if (NULL != (qb_hints = query_hint.get_qb_hints(qb_name)) + && OB_FAIL(all_hints.assign(qb_hints->hints_))) { + LOG_WARN("failed to assign hints", K(ret)); + } else if (use_stmt_id_hints + && NULL != (qb_hints = query_hint.get_stmt_id_hints(stmt.get_stmt_id())) + && OB_FAIL(append(all_hints, qb_hints->hints_))) { + LOG_WARN("failed to append hints", K(ret)); + } else if (all_hints.empty()) { /* do nothing */ } else { - const int64_t M = NULL == qb_hints ? 0 : qb_hints->hints_.count(); - const int64_t N = NULL == stmt_id_hints ? M : M + stmt_id_hints->hints_.count(); ObHint *hint = NULL; bool may_used = false; ObSEArray all_tables; ObSEArray conflict_hints; - for (int64_t i = 0; OB_SUCC(ret) && i < N; ++i) { - hint = i < M ? qb_hints->hints_.at(i) : stmt_id_hints->hints_.at(i - M); + for (int64_t i = 0; OB_SUCC(ret) && i < all_hints.count(); ++i) { may_used = false; all_tables.reuse(); - if (OB_ISNULL(hint)) { + if (OB_ISNULL(hint = all_hints.at(i))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected null", K(ret), K(hint)); } else if (OB_FAIL(hint->get_all_table_in_hint(all_tables))) { @@ -1455,17 +1457,28 @@ int ObStmtHint::reset_explicit_trans_hint(ObItemType hint_type) return ret; } -int64_t ObStmtHint::get_max_table_parallel() const +int ObStmtHint::get_max_table_parallel(const ObDMLStmt &stmt, int64_t &max_table_parallel) const { - int64_t max_table_parallel = ObGlobalHint::UNSET_PARALLEL; + int ret = OB_SUCCESS; + max_table_parallel = ObGlobalHint::UNSET_PARALLEL; const ObHint *hint = NULL; - for (int64_t i = 0; i < other_opt_hints_.count(); ++i) { + bool matched = false; + if (OB_ISNULL(query_hint_)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected null", K(ret), K(query_hint_)); + } + for (int64_t i = 0; OB_SUCC(ret) && i < other_opt_hints_.count(); ++i) { if (OB_NOT_NULL(hint = other_opt_hints_.at(i)) && hint->is_table_parallel_hint()) { - max_table_parallel = std::max(max_table_parallel, + if (OB_FAIL(stmt.check_hint_table_matched_table_item(query_hint_->cs_type_, + static_cast(hint)->get_table(), matched))) { + LOG_WARN("failed to check hint table matched table item", K(ret)); + } else if (matched) { + max_table_parallel = std::max(max_table_parallel, static_cast(hint)->get_parallel()); + } } } - return max_table_parallel; + return ret; } bool ObStmtHint::has_enable_hint(ObItemType hint_type) const @@ -1604,6 +1617,10 @@ int ObLogPlanHint::add_index_hint(const ObDMLStmt &stmt, LOG_WARN("failed to get log table hint by hint", K(ret)); } else if (NULL == log_table_hint) { /* do nothing */ + } else if (T_USE_DAS_HINT == index_hint.get_hint_type()) { + if (NULL == log_table_hint->use_das_hint_ || index_hint.is_enable_hint()) { + log_table_hint->use_das_hint_ = &index_hint; + } } else if (OB_FAIL(log_table_hint->index_hints_.push_back(&index_hint))) { LOG_WARN("failed to push back", K(ret)); } @@ -1779,6 +1796,22 @@ const ObTableParallelHint *ObLogPlanHint::get_parallel_hint(uint64_t table_id) c return NULL == log_table_hint ? NULL : log_table_hint->parallel_hint_; } +int ObLogPlanHint::check_use_das(uint64_t table_id, bool &force_das, bool &force_no_das) const +{ + int ret = OB_SUCCESS; + force_das = false; + force_no_das = false; + const LogTableHint *log_table_hint = get_log_table_hint(table_id); + const ObHint *hint = NULL == log_table_hint ? NULL : log_table_hint->use_das_hint_; + if (NULL != hint) { + force_das = hint->is_enable_hint(); + force_no_das = hint->is_disable_hint(); + } else if (is_outline_data_) { + force_no_das = true; + } + return ret; +} + int ObLogPlanHint::check_use_join_filter(uint64_t filter_table_id, const ObRelIds &left_tables, bool part_join_filter, @@ -1847,6 +1880,45 @@ DistAlgo ObLogPlanHint::get_valid_set_dist_algo(int64_t *random_none_idx /* defa return set_dist_algo; } +int ObLogPlanHint::check_valid_set_left_branch(const ObSelectStmt *select_stmt, + bool &hint_valid, + bool &need_swap) const +{ + int ret = OB_SUCCESS; + hint_valid = false; + need_swap = false; + const ObPQSetHint *pq_set_hint = NULL; + ObString left_child; + ObString right_child; + if (OB_UNLIKELY(!select_stmt->is_set_stmt() + || !select_stmt->is_set_distinct() + || 2 > select_stmt->get_set_query().count()) + || OB_ISNULL(select_stmt->get_set_query(0)) + || OB_ISNULL(select_stmt->get_set_query(1))) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected set_op stmt", K(ret), K(select_stmt)); + } else if (NULL == (pq_set_hint = static_cast(get_normal_hint(T_PQ_SET)))) { + hint_valid = is_outline_data_; + need_swap = false; + } else if (pq_set_hint->get_left_branch().empty()) { + hint_valid = true; + need_swap = false; + } else if (OB_FAIL(select_stmt->get_set_query(0)->get_qb_name(left_child)) + || OB_FAIL(select_stmt->get_set_query(1)->get_qb_name(right_child))) { + LOG_WARN("failed to get qb name", K(ret)); + } else if (0 == pq_set_hint->get_left_branch().case_compare(left_child)) { + hint_valid = true; + need_swap = false; + } else if (0 == pq_set_hint->get_left_branch().case_compare(right_child)) { + hint_valid = true; + need_swap = true; + } else { + hint_valid = false; + need_swap = false; + } + return ret; +} + // generate spm evolution plan, throw a error code when can not get valid hint int ObLogPlanHint::check_status() const { @@ -2128,6 +2200,7 @@ int LogTableHint::assign(const LogTableHint &other) table_ = other.table_; index_type_ = other.index_type_; parallel_hint_ = other.parallel_hint_; + use_das_hint_ = other.use_das_hint_; if (OB_FAIL(index_list_.assign(other.index_list_))) { LOG_WARN("failed to assign index list", K(ret)); } else if (OB_FAIL(index_hints_.assign(other.index_hints_))) { diff --git a/src/sql/resolver/dml/ob_sql_hint.h b/src/sql/resolver/dml/ob_sql_hint.h index 22d716c7a..b967bc31e 100644 --- a/src/sql/resolver/dml/ob_sql_hint.h +++ b/src/sql/resolver/dml/ob_sql_hint.h @@ -223,7 +223,8 @@ struct ObStmtHint int merge_hint(ObHint &hint, ObHintMergePolicy policy, ObIArray &conflict_hints); int merge_normal_hint(ObHint &hint, ObHintMergePolicy policy, ObIArray &conflict_hints); int reset_explicit_trans_hint(ObItemType hint_type); - int64_t get_max_table_parallel() const; + int get_max_table_parallel(const ObDMLStmt &stmt, int64_t &max_table_parallel) const; + bool has_enable_hint(ObItemType hint_type) const; bool has_disable_hint(ObItemType hint_type) const; @@ -280,15 +281,18 @@ struct LogTableHint { LogTableHint() : table_(NULL), index_type_(T_INVALID), - parallel_hint_(NULL) {} + parallel_hint_(NULL), + use_das_hint_(NULL) {} LogTableHint(const TableItem *table) : table_(table), index_type_(T_INVALID), - parallel_hint_(NULL) {} + parallel_hint_(NULL), + use_das_hint_(NULL) {} int assign(const LogTableHint &other); int init_index_hints(ObSqlSchemaGuard &schema_guard); bool is_no_index_hint() const { return T_NO_INDEX_HINT == index_type_; } bool is_index_hint() const { return T_INDEX_HINT == index_type_; } - bool is_valid() const { return !index_list_.empty() || NULL != parallel_hint_ || !join_filter_hints_.empty(); } + bool is_valid() const { return !index_list_.empty() || NULL != parallel_hint_ + || NULL != use_das_hint_ || !join_filter_hints_.empty(); } int get_join_filter_hint(const ObRelIds &left_tables, bool part_join_filter, const ObJoinFilterHint *&hint) const; @@ -298,7 +302,7 @@ struct LogTableHint TO_STRING_KV(K_(table), K_(index_type), K_(index_list), K_(index_hints), - K_(parallel_hint), + K_(parallel_hint), K_(use_das_hint), K_(join_filter_hints), K_(left_tables)); const TableItem *table_; @@ -306,6 +310,7 @@ struct LogTableHint common::ObSEArray index_list_; common::ObSEArray index_hints_; const ObTableParallelHint *parallel_hint_; + const ObIndexHint *use_das_hint_; ObSEArray join_filter_hints_; ObSEArray left_tables_; // left table relids in join filter hint }; @@ -391,10 +396,14 @@ struct ObLogPlanHint bool config_disable, bool &can_use, const ObJoinFilterHint *&force_hint) const; + int check_use_das(uint64_t table_id, bool &force_das, bool &force_no_das) const; const LogJoinHint* get_join_hint(const ObRelIds &join_tables) const; const ObIArray &get_join_hints() const { return join_hints_; } SetAlgo get_valid_set_algo() const; DistAlgo get_valid_set_dist_algo(int64_t *random_none_idx = NULL) const; + int check_valid_set_left_branch(const ObSelectStmt *select_stmt, + bool &hint_valid, + bool &need_swap) const; const ObHint* get_normal_hint(ObItemType hint_type) const; bool has_enable_hint(ObItemType hint_type) const; bool has_disable_hint(ObItemType hint_type) const; diff --git a/src/sql/resolver/dml/ob_update_stmt.cpp b/src/sql/resolver/dml/ob_update_stmt.cpp index 1df137638..f4e179b64 100644 --- a/src/sql/resolver/dml/ob_update_stmt.cpp +++ b/src/sql/resolver/dml/ob_update_stmt.cpp @@ -304,5 +304,31 @@ int ObUpdateStmt::remove_table_item_dml_info(const TableItem* table) return ret; } +int ObUpdateStmt::remove_invalid_assignment() +{ + int ret = OB_SUCCESS; + for (int64_t i = 0; OB_SUCC(ret) && i < table_info_.count(); ++i) { + ObUpdateTableInfo* table_info = table_info_.at(i); + if (OB_ISNULL(table_info)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get unexpected null", K(ret)); + } else { + for (int64_t j = table_info->assignments_.count() - 1; OB_SUCC(ret) && j >= 0; --j) { + ObAssignment& assign = table_info->assignments_.at(j); + if (OB_ISNULL(assign.column_expr_)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get unexpected null", K(ret)); + } else if (!assign.column_expr_->is_const_expr()) { + // do nothing + } else if (OB_FAIL(table_info->assignments_.remove(j))) { + LOG_WARN("failed to remove assignment", K(ret)); + } + } + } + } + + return ret; +} + } //namespace sql } //namespace oceanbase diff --git a/src/sql/resolver/dml/ob_update_stmt.h b/src/sql/resolver/dml/ob_update_stmt.h index cbf464bd4..141419b8a 100644 --- a/src/sql/resolver/dml/ob_update_stmt.h +++ b/src/sql/resolver/dml/ob_update_stmt.h @@ -65,6 +65,7 @@ public: virtual int get_view_check_exprs(ObIArray& view_check_exprs) const override; virtual int64_t get_instead_of_trigger_column_count() const override; virtual int remove_table_item_dml_info(const TableItem* table) override; + int remove_invalid_assignment(); TO_STRING_KV(N_STMT_TYPE, stmt_type_, N_TABLE, table_items_, diff --git a/src/sql/resolver/expr/ob_raw_expr_info_extractor.cpp b/src/sql/resolver/expr/ob_raw_expr_info_extractor.cpp index d1336014b..0a6ebf547 100644 --- a/src/sql/resolver/expr/ob_raw_expr_info_extractor.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_info_extractor.cpp @@ -244,7 +244,6 @@ bool ObRawExprInfoExtractor::not_calculable_expr(const ObRawExpr &expr) || expr.has_flag(CNT_STATE_FUNC) || expr.has_flag(CNT_USER_VARIABLE) || expr.has_flag(CNT_ALIAS) - || expr.has_flag(CNT_ENUM_OR_SET) || expr.has_flag(CNT_VALUES) || expr.has_flag(CNT_SEQ_EXPR) || expr.has_flag(CNT_SYS_CONNECT_BY_PATH) diff --git a/src/sql/rewrite/ob_transform_left_join_to_anti.cpp b/src/sql/rewrite/ob_transform_left_join_to_anti.cpp index fd874cd7f..0d0317b6a 100644 --- a/src/sql/rewrite/ob_transform_left_join_to_anti.cpp +++ b/src/sql/rewrite/ob_transform_left_join_to_anti.cpp @@ -227,6 +227,8 @@ int ObTransformLeftJoinToAnti::trans_stmt_to_anti(ObDMLStmt *stmt, const JoinedT int64_t idx = OB_INVALID_INDEX; TableItem *left_table = NULL; TableItem *right_table = NULL; + TableItem *right_view_table = NULL; + uint64_t right_table_id = OB_INVALID_ID; if (OB_ISNULL(ctx_) || OB_ISNULL(ctx_->allocator_) || OB_ISNULL(ctx_->session_info_) || OB_ISNULL(ctx_->expr_factory_)) { ret = OB_ERR_UNEXPECTED; @@ -244,9 +246,13 @@ int ObTransformLeftJoinToAnti::trans_stmt_to_anti(ObDMLStmt *stmt, const JoinedT } else if (lib::is_oracle_mode() && OB_FAIL(clear_for_update(right_table))) { // avoid for update op in the right side of the anti/semi. LOG_WARN("failed to clear for update", K(ret)); + } else if (right_table->is_joined_table() && + OB_FAIL(ObTransformUtils::create_view_with_table(stmt, ctx_, right_table, right_view_table))) { + LOG_WARN("failed to create right view table", K(ret)); } else { + right_table_id = right_view_table == NULL ? right_table->table_id_ : right_view_table->table_id_; semi_info->join_type_ = LEFT_ANTI_JOIN; - semi_info->right_table_id_ = right_table->table_id_; + semi_info->right_table_id_ = right_table_id; semi_info->semi_id_ = stmt->get_query_ctx()->available_tb_id_--; idx = stmt->get_from_item_idx(joined_table->table_id_); if (OB_UNLIKELY(idx < 0 || idx >= stmt->get_from_item_size())) { @@ -293,7 +299,7 @@ int ObTransformLeftJoinToAnti::trans_stmt_to_anti(ObDMLStmt *stmt, const JoinedT OB_ISNULL(from_expr = col_item->expr_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null column", K(ret)); - } else if (right_table->table_id_ != col_item->table_id_) { + } else if (right_table_id != col_item->table_id_) { // do nothing } else if (OB_FAIL(ObRawExprUtils::build_null_expr(*ctx_->expr_factory_, to_expr))) { diff --git a/src/sql/rewrite/ob_transform_rule.h b/src/sql/rewrite/ob_transform_rule.h index 7fb7c5fd8..0e45abd91 100644 --- a/src/sql/rewrite/ob_transform_rule.h +++ b/src/sql/rewrite/ob_transform_rule.h @@ -186,26 +186,6 @@ struct ObParentDMLStmt K_(stmt)); }; -#define APPLY_RULE_IF_NEEDED(t, c) \ - do { \ - if (OB_SUCC(ret) && ObTransformerImpl::is_type_needed(needed_types & needed_transform_types_, t)) { \ - c trans(ctx_); \ - trans.set_transformer_type(t); \ - if (OB_FAIL(THIS_WORKER.check_status())) { \ - LOG_WARN("check status fail", K(ret)); \ - } else if (OB_FAIL(trans.transform(stmt, needed_transform_types_))) { \ - LOG_WARN("failed to transform a rewrite rule", "class", (#c), K(ret)); \ - } else if (OB_FAIL(collect_trans_stat(trans))) { \ - LOG_WARN("failed to collect transform stat", K(ret)); \ - } else { \ - trans_happened |= trans.get_trans_happened(); \ - LOG_TRACE("succeed to transform a rewrite rule", "class", (#c), K(trans.get_trans_happened()), K(ret)); \ - } \ - } else { \ - LOG_TRACE("skip tranform a rewrite rule", "class", (#c)); \ - } \ - } while (0); - // use to keep view name/stmt id/qb name stable after copy stmt and try transform struct ObTryTransHelper { diff --git a/src/sql/rewrite/ob_transform_semi_to_inner.cpp b/src/sql/rewrite/ob_transform_semi_to_inner.cpp index 4af4463a0..b8e9b089d 100644 --- a/src/sql/rewrite/ob_transform_semi_to_inner.cpp +++ b/src/sql/rewrite/ob_transform_semi_to_inner.cpp @@ -851,7 +851,7 @@ int ObTransformSemiToInner::construct_transform_hint(ObDMLStmt &stmt, void *tran if (OB_ISNULL(table_item = trans_right_table_items->at(i))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected null", K(ret), K(table_item)); - } else if (OB_FALSE_IT(table_hint.reset(*table_item))) { + } else if (OB_FALSE_IT(table_hint.set_table(*table_item))) { } else if (OB_FAIL(hint->get_tables().push_back(table_hint))) { LOG_WARN("failed to push back table hint", K(ret)); } else if (OB_FAIL(ctx_->add_src_hash_val(table_item->get_table_name()))) { diff --git a/src/sql/rewrite/ob_transform_view_merge.cpp b/src/sql/rewrite/ob_transform_view_merge.cpp index 54c86007c..1c1850e23 100644 --- a/src/sql/rewrite/ob_transform_view_merge.cpp +++ b/src/sql/rewrite/ob_transform_view_merge.cpp @@ -1084,6 +1084,9 @@ int ObTransformViewMerge::adjust_updatable_view(ObDMLStmt *parent_stmt, TableIte } else if (OB_UNLIKELY(!table_item->is_generated_table())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected table type", K(table_item->type_), K(ret)); + } else if (parent_stmt->is_update_stmt() && + OB_FAIL(static_cast(parent_stmt)->remove_invalid_assignment())) { + LOG_WARN("failed to remove invalid assignment", K(ret)); } else if (parent_stmt->is_delete_stmt() || parent_stmt->is_update_stmt()) { ObDelUpdStmt *del_upd_stmt = static_cast(parent_stmt); ObSEArray table_infos; diff --git a/src/sql/rewrite/ob_transformer_impl.h b/src/sql/rewrite/ob_transformer_impl.h index 09400287e..948543ba7 100644 --- a/src/sql/rewrite/ob_transformer_impl.h +++ b/src/sql/rewrite/ob_transformer_impl.h @@ -34,7 +34,7 @@ class ObSelectStmt; if (OB_FAIL(THIS_WORKER.check_status())) { \ LOG_WARN("check status fail", K(ret)); \ } else if (OB_FAIL(trans.transform(stmt, needed_transform_types_))) { \ - LOG_WARN("failed to transform a rewrite rule", "class", (#c), K(ret)); \ + LOG_WARN("failed to transform a rewrite rule", "class", (#c), K(ret), K(ctx_->outline_trans_hints_)); \ } else if (OB_FAIL(collect_trans_stat(trans))) { \ LOG_WARN("failed to collect transform stat", K(ret)); \ } else { \ diff --git a/src/sql/session/ob_basic_session_info.cpp b/src/sql/session/ob_basic_session_info.cpp index 6ce3c36d8..8d9395beb 100644 --- a/src/sql/session/ob_basic_session_info.cpp +++ b/src/sql/session/ob_basic_session_info.cpp @@ -70,7 +70,7 @@ ObBasicSessionInfo::ObBasicSessionInfo() sys_var_base_version_(OB_INVALID_VERSION), tx_desc_(NULL), tx_result_(), - read_snapshot_version_(-1), + unused_read_snapshot_version_(), xid_(), associated_xa_(false), sess_bt_buff_pos_(0), @@ -403,7 +403,7 @@ void ObBasicSessionInfo::reset(bool skip_sys_var) sys_var_base_version_ = CACHED_SYS_VAR_VERSION; } curr_trans_last_stmt_end_time_ = 0; - read_snapshot_version_ = OB_INVALID_VERSION; + unused_read_snapshot_version_.reset(); check_sys_variable_ = true; is_foreign_key_cascade_ = false; is_foreign_key_check_exist_ = false; @@ -3761,7 +3761,7 @@ OB_DEF_SERIALIZE(ObBasicSessionInfo) nested_count_, thread_data_.user_name_, next_tx_isolation_, - read_snapshot_version_, + unused_read_snapshot_version_, check_sys_variable_, unused_weak_read_snapshot_source, database_id_, @@ -3947,7 +3947,7 @@ OB_DEF_DESERIALIZE(ObBasicSessionInfo) nested_count_, thread_data_.user_name_, next_tx_isolation_, - read_snapshot_version_, + unused_read_snapshot_version_, check_sys_variable_, unused_weak_read_snapshot_source, database_id_, @@ -4231,7 +4231,7 @@ OB_DEF_SERIALIZE_SIZE(ObBasicSessionInfo) nested_count_, thread_data_.user_name_, next_tx_isolation_, - read_snapshot_version_, + unused_read_snapshot_version_, check_sys_variable_, unused_weak_read_snapshot_source, database_id_, diff --git a/src/sql/session/ob_basic_session_info.h b/src/sql/session/ob_basic_session_info.h index 14adc4d3c..bfab15e9d 100644 --- a/src/sql/session/ob_basic_session_info.h +++ b/src/sql/session/ob_basic_session_info.h @@ -1191,10 +1191,6 @@ public: bool is_server_status_in_transaction() const; - int64_t get_read_snapshot_version() { return read_snapshot_version_; } - void set_read_snapshot_version(int64_t read_snapshot_version) { read_snapshot_version_ = read_snapshot_version; } - bool has_valid_read_snapshot_version() const { return read_snapshot_version_ > 0; } - void set_has_exec_write_stmt(bool value) { trans_flags_.set_has_exec_write_stmt(value); } void set_has_set_trans_var(bool value) { trans_flags_.set_has_set_trans_var(value); } void set_has_any_dml_succ(bool value) { trans_flags_.set_has_any_dml_succ(value); } @@ -1881,8 +1877,7 @@ private: protected: transaction::ObTxDesc *tx_desc_; transaction::ObTxExecResult tx_result_; // TODO: move to QueryCtx/ExecCtx - // 指定快照读版本 - int64_t read_snapshot_version_; + palf::SCN unused_read_snapshot_version_;//serialize compatibility preserved transaction::ObXATransID xid_; bool associated_xa_; // session joined distr-xa-trans by xa-start public: diff --git a/src/storage/access/ob_rows_info.cpp b/src/storage/access/ob_rows_info.cpp index 60da62ad2..27136dafb 100644 --- a/src/storage/access/ob_rows_info.cpp +++ b/src/storage/access/ob_rows_info.cpp @@ -104,8 +104,6 @@ int ObRowsInfo::init( STORAGE_LOG(WARN, "ObRowsinfo init twice", K(ret)); } else if (OB_FAIL(exist_helper_.init(table, store_ctx, full_read_info, scan_mem_allocator_))) { STORAGE_LOG(WARN, "Failed to init exist helper", K(ret)); - } else if (OB_FAIL(rowkeys_.prepare_allocate(DEFAULT_ROW_KEY_ARR_SIZE))) { - STORAGE_LOG(WARN, "Failed to prepare_allocate rowkey", K(ret)); } else { datum_utils_ = &full_read_info.get_datum_utils(); table_id_ = table.get_table_id(); diff --git a/src/storage/access/ob_single_merge.cpp b/src/storage/access/ob_single_merge.cpp index 293342570..4529013de 100644 --- a/src/storage/access/ob_single_merge.cpp +++ b/src/storage/access/ob_single_merge.cpp @@ -323,7 +323,8 @@ int ObSingleMerge::inner_get_next_row(ObDatumRow &row) if (OB_SUCC(ret)) { access_ctx_->defensive_check_record_.query_flag_ = access_ctx_->query_flag_; if (NULL != access_ctx_->store_ctx_ - && NULL != access_ctx_->store_ctx_->mvcc_acc_ctx_.get_mem_ctx()) { + && NULL != access_ctx_->store_ctx_->mvcc_acc_ctx_.get_mem_ctx() + && NULL != access_ctx_->store_ctx_->mvcc_acc_ctx_.get_mem_ctx()->get_defensive_check_mgr()) { (void)access_ctx_->store_ctx_ ->mvcc_acc_ctx_ .get_mem_ctx() diff --git a/src/storage/ddl/ob_build_index_task.cpp b/src/storage/ddl/ob_build_index_task.cpp index 42e4e7551..f33d04103 100644 --- a/src/storage/ddl/ob_build_index_task.cpp +++ b/src/storage/ddl/ob_build_index_task.cpp @@ -40,7 +40,7 @@ using namespace oceanbase::omt; ObUniqueIndexChecker::ObUniqueIndexChecker() : is_inited_(false), tenant_id_(OB_INVALID_TENANT_ID), ls_id_(), tablet_id_(), - index_schema_(NULL), data_table_schema_(NULL), execution_id_(0), snapshot_version_(0), + index_schema_(NULL), data_table_schema_(NULL), execution_id_(0), snapshot_version_(0), task_id_(0), is_scan_index_(false) { } @@ -52,6 +52,7 @@ int ObUniqueIndexChecker::init( const bool is_scan_index, const ObTableSchema *data_table_schema, const ObTableSchema *index_schema, + const int64_t task_id, const uint64_t execution_id, const int64_t snapshot_version) { @@ -61,9 +62,10 @@ int ObUniqueIndexChecker::init( LOG_WARN("ObUniqueIndexChecker has already been inited", K(ret)); } else if (OB_UNLIKELY(!ls_id.is_valid() || !tablet_id.is_valid() || NULL == data_table_schema - || NULL == index_schema)) { + || NULL == index_schema + || task_id <= 0)) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid arguments", K(ret), K(ls_id), K(tablet_id), KPC(data_table_schema), KPC(index_schema)); + LOG_WARN("invalid arguments", K(ret), K(ls_id), K(tablet_id), KPC(data_table_schema), KPC(index_schema), K(task_id)); } else { is_inited_ = true; tenant_id_ = tenant_id; @@ -71,6 +73,7 @@ int ObUniqueIndexChecker::init( tablet_id_ = tablet_id; data_table_schema_ = data_table_schema; index_schema_ = index_schema; + task_id_ = task_id; execution_id_ = execution_id; snapshot_version_ = snapshot_version; is_scan_index_ = is_scan_index; @@ -477,7 +480,7 @@ int ObUniqueIndexChecker::report_column_checksum( item.execution_id_ = execution_id_; item.tenant_id_ = tenant_id_; item.table_id_ = report_table_id; - item.tablet_id_ = tablet_id_.id(); // TODO(cangdi): replace this with tablet_id + item.ddl_task_id_ = task_id_; item.column_id_ = column_ids.at(i).col_id_; item.task_id_ = -1; item.checksum_ = column_checksum.at(i); @@ -609,6 +612,7 @@ int ObUniqueCheckingDag::init( const bool is_scan_index, const uint64_t index_table_id, const int64_t schema_version, + const int64_t task_id, const uint64_t execution_id, const int64_t snapshot_version) { @@ -618,11 +622,11 @@ int ObUniqueCheckingDag::init( ret = OB_INIT_TWICE; STORAGE_LOG(WARN, "ObUniqueCheckingDag has already been inited", K(ret)); } else if (OB_UNLIKELY(OB_INVALID_TENANT_ID == tenant_id || !ls_id.is_valid() || !tablet_id.is_valid() - || OB_INVALID_ID == index_table_id || schema_version < 0 + || OB_INVALID_ID == index_table_id || schema_version < 0 || task_id <= 0 || execution_id < 0 || snapshot_version < 0)) { ret = OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "invalid arguments", K(ret), K(tenant_id), K(ls_id), K(tablet_id), - K(index_table_id), K(schema_version), K(execution_id), K(snapshot_version)); + K(index_table_id), K(schema_version), K(task_id), K(execution_id), K(snapshot_version)); } else { MTL_SWITCH(tenant_id) { if (OB_ISNULL(schema_service = MTL(ObTenantSchemaService *)->get_schema_service())) { @@ -653,6 +657,7 @@ int ObUniqueCheckingDag::init( schema_service_ = schema_service; execution_id_ = execution_id; snapshot_version_ = snapshot_version; + task_id_ = task_id; } } else { LOG_WARN("switch to tenant failed", K(ret), K(index_table_id), K(tenant_id)); @@ -894,8 +899,15 @@ int ObSimpleUniqueCheckingTask::init( if (OB_UNLIKELY(!tablet_id_.is_valid())) { ret = OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "invalid arguments", K(ret), K(tablet_id_)); - } else if (OB_FAIL(unique_checker_.init(tenant_id_, dag->get_ls_id(), tablet_id_, dag->get_is_scan_index(), data_table_schema, index_schema, - dag->get_execution_id(), dag->get_snapshot_version()))) { + } else if (OB_FAIL(unique_checker_.init(tenant_id_, + dag->get_ls_id(), + tablet_id_, + dag->get_is_scan_index(), + data_table_schema, + index_schema, + dag->get_task_id(), + dag->get_execution_id(), + dag->get_snapshot_version()))) { STORAGE_LOG(WARN, "fail to init unique index checker", K(ret)); } else { index_schema_ = index_schema; diff --git a/src/storage/ddl/ob_build_index_task.h b/src/storage/ddl/ob_build_index_task.h index 54e133af3..4707ac9e4 100644 --- a/src/storage/ddl/ob_build_index_task.h +++ b/src/storage/ddl/ob_build_index_task.h @@ -37,6 +37,7 @@ public: const bool is_scan_index, const share::schema::ObTableSchema *data_table_schema, const share::schema::ObTableSchema *index_schema, + const int64_t task_id, const uint64_t execution_id = OB_INVALID_ID, const int64_t snapshot_version = OB_INVALID_VERSION); int check_unique_index(share::ObIDag *dag); @@ -110,6 +111,7 @@ private: const share::schema::ObTableSchema *data_table_schema_; uint64_t execution_id_; int64_t snapshot_version_; + int64_t task_id_; ObTabletHandle tablet_handle_; bool is_scan_index_; }; @@ -156,12 +158,14 @@ public: const common::ObTabletID &tablet_id, const bool is_scan_index, const uint64_t index_table_id, const int64_t schema_version, + const int64_t task_id, const uint64_t execution_id = OB_INVALID_ID, const int64_t snapshot_version = OB_INVALID_VERSION); const share::schema::ObTableSchema *get_index_schema() const { return index_schema_; } const share::schema::ObTableSchema *get_data_table_schema() const { return data_table_schema_; } uint64_t get_execution_id() const { return execution_id_; } int64_t get_snapshot_version() const { return snapshot_version_; } + int64_t get_task_id() const { return task_id_; } bool get_is_scan_index() const { return is_scan_index_; } int alloc_unique_checking_prepare_task(ObIUniqueCheckingCompleteCallback *callback); int alloc_local_index_task_callback(ObLocalUniqueIndexCallback *&callback); @@ -192,6 +196,7 @@ private: ObIUniqueCheckingCompleteCallback *callback_; uint64_t execution_id_; int64_t snapshot_version_; + int64_t task_id_; lib::Worker::CompatMode compat_mode_; }; diff --git a/src/storage/ddl/ob_complement_data_task.cpp b/src/storage/ddl/ob_complement_data_task.cpp index 7e569cd22..7552737c9 100644 --- a/src/storage/ddl/ob_complement_data_task.cpp +++ b/src/storage/ddl/ob_complement_data_task.cpp @@ -113,6 +113,7 @@ int ObComplementDataParam::init(const ObDDLBuildSingleReplicaRequestArg &arg) dest_tablet_id_ = arg.dest_tablet_id_; schema_version_ = arg.schema_version_; task_id_ = arg.task_id_; + execution_id_ = arg.execution_id_; FLOG_INFO("succeed to init ObComplementDataParam", K(ret), K(is_inited_), K(tenant_id_), K(ls_id_), K(source_tablet_id_), K(dest_tablet_id_), K(schema_version_), K(task_id_), K(arg), K(concurrent_cnt_)); } @@ -439,6 +440,7 @@ int ObComplementDataDag::report_replica_build_status() arg.snapshot_version_ = param_.snapshot_version_; arg.schema_version_ = param_.schema_version_; arg.task_id_ = param_.task_id_; + arg.execution_id_ = param_.execution_id_; FLOG_INFO("send replica build status response to RS", K(ret), K(context_.complement_data_ret_), K(arg)); if (OB_ISNULL(GCTX.rs_rpc_proxy_) || OB_ISNULL(GCTX.rs_mgr_)) { ret = OB_ERR_SYS; @@ -1029,11 +1031,12 @@ int ObComplementWriteTask::append_row(ObLocalScan &local_scan) LOG_WARN("fail to get origin table columns checksum", K(ret)); } else if (OB_FAIL(ObDDLChecksumOperator::update_checksum(param_->data_table_schema_->get_tenant_id(), param_->data_table_schema_->get_table_id() /* data_table_id */, - param_->source_tablet_id_.id(), + param_->task_id_, report_col_checksums, report_col_ids, - param_->schema_version_, - task_id_, *GCTX.sql_proxy_))) { + 1/*execution_id*/, + param_->source_tablet_id_.id()/*task_id*/, + *GCTX.sql_proxy_))) { LOG_WARN("fail to report origin table checksum", K(ret)); } else {/* do nothing. */} } @@ -1137,7 +1140,8 @@ int ObComplementMergeTask::add_build_hidden_table_sstable() if (OB_FAIL(ret)) { } else if (OB_FAIL(context_->data_sstable_redo_writer_.write_prepare_log(hidden_table_key, param_->hidden_table_schema_->get_table_id(), - param_->schema_version_, + 1/*execution_id*/, + param_->task_id_, prepare_log_ts))) { LOG_WARN("fail write ddl prepare log", K(ret), K(hidden_table_key)); } else { @@ -1151,8 +1155,9 @@ int ObComplementMergeTask::add_build_hidden_table_sstable() } else if (OB_FAIL(ddl_kv_mgr->ddl_prepare(ddl_start_log_ts, prepare_log_ts, param_->hidden_table_schema_->get_table_id(), - param_->schema_version_))) { - LOG_WARN("commit ddl log failed", K(ret), K(ddl_start_log_ts), K(prepare_log_ts), K(hidden_table_key)); + 1/*execution_id*/, + param_->task_id_))) { + LOG_WARN("prepare ddl log failed", K(ret), K(ddl_start_log_ts), K(prepare_log_ts), K(hidden_table_key)); } else if (OB_FAIL(ddl_kv_mgr->wait_ddl_commit(ddl_start_log_ts, prepare_log_ts))) { if (OB_TASK_EXPIRED == ret) { ret = OB_SUCCESS; diff --git a/src/storage/ddl/ob_complement_data_task.h b/src/storage/ddl/ob_complement_data_task.h index 8326f00de..d9154086c 100644 --- a/src/storage/ddl/ob_complement_data_task.h +++ b/src/storage/ddl/ob_complement_data_task.h @@ -41,7 +41,7 @@ public: source_tablet_id_(ObTabletID::INVALID_TABLET_ID), dest_tablet_id_(ObTabletID::INVALID_TABLET_ID), data_table_schema_(nullptr), hidden_table_schema_(nullptr), allocator_("ComplementData"), row_store_type_(common::ENCODING_ROW_STORE), schema_version_(0), snapshot_version_(0), - concurrent_cnt_(0), task_id_(0), compat_mode_(lib::Worker::CompatMode::INVALID) + concurrent_cnt_(0), task_id_(0), execution_id_(0), compat_mode_(lib::Worker::CompatMode::INVALID) {} ~ObComplementDataParam() { destroy(); } int init(const ObDDLBuildSingleReplicaRequestArg &arg); @@ -51,7 +51,8 @@ public: { return common::OB_INVALID_TENANT_ID != tenant_id_ && ls_id_.is_valid() && source_tablet_id_.is_valid() && dest_tablet_id_.is_valid() && OB_NOT_NULL(data_table_schema_) && OB_NOT_NULL(hidden_table_schema_) - && 0 != concurrent_cnt_ && snapshot_version_ > 0 && compat_mode_ != lib::Worker::CompatMode::INVALID; + && 0 != concurrent_cnt_ && snapshot_version_ > 0 && compat_mode_ != lib::Worker::CompatMode::INVALID + && execution_id_ > 0; } int get_hidden_table_key(ObITable::TableKey &table_key) const; void destroy() @@ -75,11 +76,12 @@ public: snapshot_version_ = 0; concurrent_cnt_ = 0; task_id_ = 0; + execution_id_ = 0; compat_mode_ = lib::Worker::CompatMode::INVALID; } TO_STRING_KV(K_(is_inited), K_(tenant_id), K_(ls_id), K_(source_tablet_id), K_(dest_tablet_id), KPC_(data_table_schema), KPC_(hidden_table_schema), K_(schema_version), - K_(snapshot_version), K_(concurrent_cnt), K_(task_id), K_(compat_mode)); + K_(snapshot_version), K_(concurrent_cnt), K_(task_id), K_(execution_id), K_(compat_mode)); public: bool is_inited_; uint64_t tenant_id_; @@ -94,6 +96,7 @@ public: int64_t snapshot_version_; int64_t concurrent_cnt_; int64_t task_id_; + int64_t execution_id_; lib::Worker::CompatMode compat_mode_; ObSEArray ranges_; }; diff --git a/src/storage/ddl/ob_ddl_merge_task.cpp b/src/storage/ddl/ob_ddl_merge_task.cpp index b435452de..768d59a02 100644 --- a/src/storage/ddl/ob_ddl_merge_task.cpp +++ b/src/storage/ddl/ob_ddl_merge_task.cpp @@ -360,11 +360,12 @@ int ObDDLTableMergeTask::process() ret = OB_ERR_UNEXPECTED; LOG_WARN("ddl major sstable is null", K(ret), K(ddl_param)); } else if (merge_param_.table_id_ > 0 - && merge_param_.schema_version_ > 0 + && merge_param_.execution_id_ > 0 && OB_FAIL(ObTabletDDLUtil::report_ddl_checksum(merge_param_.ls_id_, merge_param_.tablet_id_, merge_param_.table_id_, - merge_param_.schema_version_, + merge_param_.execution_id_, + merge_param_.ddl_task_id_, sstable->get_meta().get_col_checksum()))) { LOG_WARN("report ddl column checksum failed", K(ret), K(merge_param_)); } else if (OB_FAIL(GCTX.ob_service_->submit_tablet_checksums_task(tenant_id, merge_param_.ls_id_, merge_param_.tablet_id_))) { @@ -712,7 +713,8 @@ int ObTabletDDLUtil::compact_ddl_sstable(const ObIArray &ddl_sstable int ObTabletDDLUtil::report_ddl_checksum(const share::ObLSID &ls_id, const ObTabletID &tablet_id, const uint64_t table_id, - const int64_t schema_version, + const int64_t execution_id, + const int64_t ddl_task_id, const ObIArray &column_checksums) { int ret = OB_SUCCESS; @@ -725,10 +727,10 @@ int ObTabletDDLUtil::report_ddl_checksum(const share::ObLSID &ls_id, ObSchemaGetterGuard schema_guard; const ObTableSchema *table_schema = nullptr; const uint64_t tenant_id = MTL_ID(); - if (OB_UNLIKELY(!ls_id.is_valid() || !tablet_id.is_valid() - || !is_valid_id(table_id) || 0 == table_id || schema_version <= 0)) { + if (OB_UNLIKELY(!ls_id.is_valid() || !tablet_id.is_valid() || OB_INVALID_ID == ddl_task_id + || !is_valid_id(table_id) || 0 == table_id || execution_id <= 0)) { ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(ls_id), K(tablet_id), K(table_id), K(schema_version)); + LOG_WARN("invalid argument", K(ret), K(ls_id), K(tablet_id), K(table_id), K(execution_id)); } else if (!is_valid_tenant_id(tenant_id) || OB_ISNULL(ls_service) || OB_ISNULL(sql_proxy) || OB_ISNULL(schema_service)) { ret = OB_ERR_SYS; LOG_WARN("ls service or sql proxy is null", K(ret), K(tenant_id), KP(ls_service), KP(sql_proxy), KP(schema_service)); @@ -759,12 +761,12 @@ int ObTabletDDLUtil::report_ddl_checksum(const share::ObLSID &ls_id, } for (int64_t i = 0; OB_SUCC(ret) && i < column_checksums.count(); ++i) { share::ObDDLChecksumItem item; - item.execution_id_ = schema_version; + item.execution_id_ = execution_id; item.tenant_id_ = tenant_id; item.table_id_ = table_id; - item.tablet_id_ = tablet_id.id(); + item.ddl_task_id_ = ddl_task_id; item.column_id_ = column_ids.at(i).col_id_; - item.task_id_ = 0; + item.task_id_ = tablet_id.id(); item.checksum_ = column_checksums.at(i); #ifdef ERRSIM if (OB_SUCC(ret)) { @@ -795,7 +797,7 @@ int ObTabletDDLUtil::report_ddl_checksum(const share::ObLSID &ls_id, } else if (OB_FAIL(ObDDLChecksumOperator::update_checksum(ddl_checksum_items, *sql_proxy))) { LOG_WARN("fail to update checksum", K(ret), K(ls_id), K(tablet_id), K(table_id), K(ddl_checksum_items)); } else { - LOG_INFO("report ddl checkum success", K(ls_id), K(tablet_id), K(table_id), K(schema_version)); + LOG_INFO("report ddl checkum success", K(ls_id), K(tablet_id), K(table_id), K(execution_id)); } } return ret; diff --git a/src/storage/ddl/ob_ddl_merge_task.h b/src/storage/ddl/ob_ddl_merge_task.h index f69115a1a..4a5e333e6 100644 --- a/src/storage/ddl/ob_ddl_merge_task.h +++ b/src/storage/ddl/ob_ddl_merge_task.h @@ -43,21 +43,23 @@ public: rec_log_ts_(0), is_commit_(false), table_id_(0), - schema_version_(0) + execution_id_(0), + ddl_task_id_(0) {} bool is_valid() const { return ls_id_.is_valid() && tablet_id_.is_valid(); } virtual ~ObDDLTableMergeDagParam() = default; - TO_STRING_KV(K_(ls_id), K_(tablet_id), K_(rec_log_ts), K_(is_commit), K_(table_id), K_(schema_version)); + TO_STRING_KV(K_(ls_id), K_(tablet_id), K_(rec_log_ts), K_(is_commit), K_(table_id), K_(execution_id), K_(ddl_task_id)); public: share::ObLSID ls_id_; ObTabletID tablet_id_; int64_t rec_log_ts_; bool is_commit_; uint64_t table_id_; // used for report ddl checksum - int64_t schema_version_; // used for report ddl checksum + int64_t execution_id_; // used for report ddl checksum + int64_t ddl_task_id_; // used for report ddl checksum }; class ObDDLTableMergeDag : public share::ObIDag @@ -162,7 +164,8 @@ public: static int report_ddl_checksum(const share::ObLSID &ls_id, const ObTabletID &tablet_id, const uint64_t table_id, - const int64_t schema_version, + const int64_t execution_id, + const int64_t ddl_task_id, const ObIArray &column_checksums); static int check_if_major_sstable_exist(const share::ObLSID &ls_id, const ObTabletID &tablet_id, diff --git a/src/storage/ddl/ob_ddl_redo_log_writer.cpp b/src/storage/ddl/ob_ddl_redo_log_writer.cpp index d3523a337..85296f246 100644 --- a/src/storage/ddl/ob_ddl_redo_log_writer.cpp +++ b/src/storage/ddl/ob_ddl_redo_log_writer.cpp @@ -33,19 +33,7 @@ using namespace oceanbase::logservice; using namespace oceanbase::share; using namespace oceanbase::blocksstable; -int ObDDLCtrlSpeedHandleItem::assign(const ObDDLCtrlSpeedHandleItem &speed_handle_item) -{ - int ret = OB_SUCCESS; - is_inited_ = speed_handle_item.is_inited_; - ls_id_ = speed_handle_item.ls_id_; - next_available_write_ts_ = speed_handle_item.next_available_write_ts_; - write_speed_ = speed_handle_item.write_speed_; - disk_used_stop_write_threshold_ = speed_handle_item.disk_used_stop_write_threshold_; - need_stop_write_ = speed_handle_item.need_stop_write_; - return ret; -} - -int ObDDLCtrlSpeedHandleItem::init(const share::ObLSID &ls_id) +int ObDDLCtrlSpeedItem::init(const share::ObLSID &ls_id) { int ret = OB_SUCCESS; if (OB_UNLIKELY(is_inited_)) { @@ -61,7 +49,7 @@ int ObDDLCtrlSpeedHandleItem::init(const share::ObLSID &ls_id) LOG_WARN("fail to init write speed and clog disk used threshold", K(ret)); } else { is_inited_ = true; - LOG_INFO("succeed to init ObDDLCtrlSpeedHandleItem", K(ret), K(is_inited_), K(ls_id_), + LOG_INFO("succeed to init ObDDLCtrlSpeedItem", K(ret), K(is_inited_), K(ls_id_), K(next_available_write_ts_), K(write_speed_), K(disk_used_stop_write_threshold_)); } } @@ -69,7 +57,7 @@ int ObDDLCtrlSpeedHandleItem::init(const share::ObLSID &ls_id) } // refrese ddl clog write speed and disk used threshold on tenant level. -int ObDDLCtrlSpeedHandleItem::refresh() +int ObDDLCtrlSpeedItem::refresh() { int ret = OB_SUCCESS; int64_t archive_speed; @@ -120,7 +108,7 @@ int ObDDLCtrlSpeedHandleItem::refresh() } // calculate the sleep time for the input bytes, and return next available write timestamp. -int ObDDLCtrlSpeedHandleItem::cal_limit(const int64_t bytes, int64_t &next_available_ts) +int ObDDLCtrlSpeedItem::cal_limit(const int64_t bytes, int64_t &next_available_ts) { int ret = OB_SUCCESS; next_available_ts = 0; @@ -145,7 +133,7 @@ int ObDDLCtrlSpeedHandleItem::cal_limit(const int64_t bytes, int64_t &next_avail return ret; } -int ObDDLCtrlSpeedHandleItem::do_sleep( +int ObDDLCtrlSpeedItem::do_sleep( const int64_t next_available_ts, int64_t &real_sleep_us) { @@ -159,8 +147,13 @@ int ObDDLCtrlSpeedHandleItem::do_sleep( LOG_WARN("invalid argument.", K(ret), K(next_available_ts)); } else if (OB_UNLIKELY(need_stop_write_)) /*clog disk used exceeds threshold*/ { while (OB_SUCC(ret) && need_stop_write_) { + // TODO YIREN (FIXME-20221017), exit when task is canceled, etc. ob_usleep(SLEEP_INTERVAL); - LOG_INFO("stop write ddl clog", K(ret), K(disk_used_stop_write_threshold_)); + if (REACH_TIME_INTERVAL(10 * 1000 * 1000)) { + ObTaskController::get().allow_next_syslog(); + FLOG_INFO("stop write ddl clog", K(ret), K(ls_id_), + K(write_speed_), K(need_stop_write_), K(ref_cnt_), K(disk_used_stop_write_threshold_)); + } } } if (OB_SUCC(ret)) { @@ -171,7 +164,7 @@ int ObDDLCtrlSpeedHandleItem::do_sleep( } // calculate the sleep time for the input bytes, sleep. -int ObDDLCtrlSpeedHandleItem::limit_and_sleep( +int ObDDLCtrlSpeedItem::limit_and_sleep( const int64_t bytes, int64_t &real_sleep_us) { @@ -202,16 +195,55 @@ int ObDDLCtrlSpeedHandleItem::limit_and_sleep( return ret; } +int ObDDLCtrlSpeedHandle::ObDDLCtrlSpeedItemHandle::set_ctrl_speed_item( + ObDDLCtrlSpeedItem *item) +{ + int ret = OB_SUCCESS; + if (OB_ISNULL(item)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected err, item is nullptr", K(ret)); + } else { + item->inc_ref(); + item_ = item; + } + return ret; +} + +int ObDDLCtrlSpeedHandle::ObDDLCtrlSpeedItemHandle::get_ctrl_speed_item( + ObDDLCtrlSpeedItem *&item) const +{ + int ret = OB_SUCCESS; + if (OB_ISNULL(item_)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected error, speed handle item is nullptr", K(ret)); + } else { + item = item_; + } + return ret; +} + +void ObDDLCtrlSpeedHandle::ObDDLCtrlSpeedItemHandle::reset() +{ + if (nullptr != item_) { + if (0 == item_->dec_ref()) { + item_->~ObDDLCtrlSpeedItem(); + } + item_ = nullptr; + } +} + ObDDLCtrlSpeedHandle::ObDDLCtrlSpeedHandle() - : is_inited_(false), speed_handle_map_(), refreshTimerTask_() + : is_inited_(false), speed_handle_map_(), allocator_("DDLClogCtrl"), bucket_lock_(), refreshTimerTask_() { } ObDDLCtrlSpeedHandle::~ObDDLCtrlSpeedHandle() { + bucket_lock_.destroy(); if (speed_handle_map_.created()) { speed_handle_map_.destroy(); } + allocator_.reset(); } ObDDLCtrlSpeedHandle &ObDDLCtrlSpeedHandle::get_instance() @@ -229,6 +261,8 @@ int ObDDLCtrlSpeedHandle::init() } else if (OB_UNLIKELY(speed_handle_map_.created())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected error, speed handle map is created", K(ret)); + } else if (OB_FAIL(bucket_lock_.init(MAP_BUCKET_NUM))) { + LOG_WARN("init bucket lock failed", K(ret)); } else if (OB_FAIL(speed_handle_map_.create(MAP_BUCKET_NUM, "DDLSpeedCtrl"))) { LOG_WARN("fail to create speed handle map", K(ret)); } else { @@ -249,7 +283,9 @@ int ObDDLCtrlSpeedHandle::limit_and_sleep( { int ret = OB_SUCCESS; SpeedHandleKey speed_handle_key; - ObDDLCtrlSpeedHandleItem speed_handle_item; + ObDDLCtrlSpeedItem *speed_handle_item = nullptr; + ObDDLCtrlSpeedItemHandle item_handle; + item_handle.reset(); if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); @@ -261,21 +297,31 @@ int ObDDLCtrlSpeedHandle::limit_and_sleep( } else if (OB_UNLIKELY(!speed_handle_map_.created())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("speed handle map is not created", K(ret)); - } else if (OB_FAIL(ObDDLCtrlSpeedHandle::get_instance().add_speed_handle_item(speed_handle_key))) { - LOG_WARN("fail to add speed handle item", K(ret), K(ls_id)); - } else if (OB_FAIL(speed_handle_map_.get_refactored(speed_handle_key, speed_handle_item))) { - LOG_WARN("fail to get refactored", K(ret), K(speed_handle_key)); - } else if (OB_FAIL(speed_handle_item.limit_and_sleep(bytes, - real_sleep_us))) { + } else if (OB_FAIL(add_ctrl_speed_item(speed_handle_key, item_handle))) { + LOG_WARN("add speed item failed", K(ret)); + } else if (OB_FAIL(item_handle.get_ctrl_speed_item(speed_handle_item))) { + LOG_WARN("get speed handle item failed", K(ret)); + } else if (OB_ISNULL(speed_handle_item)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected err, ctrl speed item is nullptr", K(ret), K(speed_handle_key)); + } else if (OB_FAIL(speed_handle_item->limit_and_sleep(bytes, + real_sleep_us))) { LOG_WARN("fail to limit and sleep", K(ret), K(bytes), K(real_sleep_us)); } return ret; } -int ObDDLCtrlSpeedHandle::add_speed_handle_item(const SpeedHandleKey &speed_handle_key) +// add entry in speed_handle_map if it does not exist. +// set entry in ctrl_speed_item_handle. +int ObDDLCtrlSpeedHandle::add_ctrl_speed_item( + const SpeedHandleKey &speed_handle_key, + ObDDLCtrlSpeedItemHandle &item_handle) { int ret = OB_SUCCESS; - ObDDLCtrlSpeedHandleItem speed_handle_item; + common::ObBucketHashWLockGuard guard(bucket_lock_, speed_handle_key.hash()); + char *buf = nullptr; + ObDDLCtrlSpeedItem *speed_handle_item = nullptr; + item_handle.reset(); if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); @@ -286,11 +332,77 @@ int ObDDLCtrlSpeedHandle::add_speed_handle_item(const SpeedHandleKey &speed_hand ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected, speed handle map is not created", K(ret)); } else if (nullptr != speed_handle_map_.get(speed_handle_key)) { - // do nothing, speed handle item already exist. - } else if (OB_FAIL(speed_handle_item.init(speed_handle_key.ls_id_))) { - LOG_WARN("fail to init new speed handle item", K(ret), K(speed_handle_key)); - } else if (OB_FAIL(speed_handle_map_.set_refactored(speed_handle_key, speed_handle_item))) { - LOG_WARN("fail to add speed handle item", K(ret), K(speed_handle_key)); + // do nothing, speed handle item has already exist. + } else if (OB_ISNULL(buf = static_cast(allocator_.alloc(sizeof(ObDDLCtrlSpeedItem))))) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("fail to allocate memory", K(ret)); + } else { + speed_handle_item = new (buf) ObDDLCtrlSpeedItem(); + if (OB_ISNULL(speed_handle_item)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected nullptr", K(ret)); + } else if (OB_FAIL(speed_handle_item->init(speed_handle_key.ls_id_))) { + LOG_WARN("fail to init new speed handle item", K(ret), K(speed_handle_key)); + } else if (OB_FAIL(speed_handle_map_.set_refactored(speed_handle_key, speed_handle_item))) { + LOG_WARN("fail to add speed handle item", K(ret), K(speed_handle_key)); + } else { + speed_handle_item->inc_ref(); + } + } + + // set entry for ctrl_speed_item_handle. + if (OB_SUCC(ret)) { + ObDDLCtrlSpeedItem *curr_speed_handle_item = nullptr; + if (OB_FAIL(speed_handle_map_.get_refactored(speed_handle_key, curr_speed_handle_item))) { + LOG_WARN("get refactored failed", K(ret), K(speed_handle_key)); + } else if (OB_ISNULL(curr_speed_handle_item)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected err, speed handle item is nullptr", K(ret), K(speed_handle_key)); + } else if (OB_FAIL(item_handle.set_ctrl_speed_item(curr_speed_handle_item))) { + LOG_WARN("set ctrl speed item failed", K(ret), K(speed_handle_key)); + } + } + if (OB_FAIL(ret)) { + if (nullptr != speed_handle_item) { + speed_handle_item->~ObDDLCtrlSpeedItem(); + speed_handle_item = nullptr; + } + if (nullptr != buf) { + allocator_.free(buf); + buf = nullptr; + } + } + return ret; +} + +// remove entry from speed_handle_map. +int ObDDLCtrlSpeedHandle::remove_ctrl_speed_item(const SpeedHandleKey &speed_handle_key) +{ + int ret = OB_SUCCESS; + common::ObBucketHashWLockGuard guard(bucket_lock_, speed_handle_key.hash()); + char *buf = nullptr; + ObDDLCtrlSpeedItem *speed_handle_item = nullptr; + if (OB_UNLIKELY(!is_inited_)) { + ret = OB_NOT_INIT; + LOG_WARN("not init", K(ret)); + } else if (OB_UNLIKELY(!speed_handle_key.is_valid())) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("ls id is invalid", K(ret), K(speed_handle_key)); + } else if (OB_UNLIKELY(!speed_handle_map_.created())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected, speed handle map is not created", K(ret)); + } else if (OB_FAIL(speed_handle_map_.get_refactored(speed_handle_key, speed_handle_item))) { + LOG_WARN("get refactored failed", K(ret), K(speed_handle_key)); + } else if (OB_FAIL(speed_handle_map_.erase_refactored(speed_handle_key))) { + LOG_WARN("fail to erase_refactored", K(ret), K(speed_handle_key)); + } else if (OB_ISNULL(speed_handle_item)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected error, speed handle item is nullptr", K(ret), K(speed_handle_key)); + } else { + if (0 == speed_handle_item->dec_ref()) { + speed_handle_item->~ObDDLCtrlSpeedItem(); + speed_handle_item = nullptr; + } } return ret; } @@ -302,7 +414,7 @@ int ObDDLCtrlSpeedHandle::refresh() { int ret = OB_SUCCESS; // 1. remove speed_handle_item whose ls/tenant does not exist; - for (hash::ObHashMap::const_iterator iter = speed_handle_map_.begin(); + for (hash::ObHashMap::const_iterator iter = speed_handle_map_.begin(); OB_SUCC(ret) && iter != speed_handle_map_.end(); ++iter) { bool erase = false; const SpeedHandleKey &speed_handle_key = iter->first; @@ -330,8 +442,8 @@ int ObDDLCtrlSpeedHandle::refresh() } } if (OB_FAIL(ret)) { - } else if (erase && OB_FAIL(speed_handle_map_.erase_refactored(speed_handle_key))) { - LOG_WARN("fail to erase_refactored", K(ret), K(speed_handle_key)); + } else if (erase && OB_FAIL(remove_ctrl_speed_item(speed_handle_key))) { + LOG_WARN("remove speed handle item failed", K(ret), K(speed_handle_key)); } } @@ -347,15 +459,24 @@ int ObDDLCtrlSpeedHandle::refresh() // UpdateSpeedHandleItemFn update ddl clog write speed and disk used config int ObDDLCtrlSpeedHandle::UpdateSpeedHandleItemFn::operator() ( - hash::HashMapPair &entry) + hash::HashMapPair &entry) { int ret = OB_SUCCESS; MTL_SWITCH(entry.first.tenant_id_) { - if (OB_FAIL(entry.second.refresh())) { + if (OB_ISNULL(entry.second)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected nulptr", K(ret), K(entry.first)); + } else if (OB_FAIL(entry.second->refresh())) { LOG_WARN("refresh speed and disk config failed", K(ret), K(entry)); } } else if (OB_TENANT_NOT_IN_SERVER == ret || OB_IN_STOP_STATE == ret) { // tenant deleted or on deleting - ret = OB_SUCCESS; + if (OB_ISNULL(entry.second)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("unexpected nulptr", K(ret), K(entry.first)); + } else { + entry.second->reset_need_stop_write(); + ret = OB_SUCCESS; + } } else { LOG_WARN("switch tenant id failed", K(ret), K(MTL_ID()), K(entry)); } @@ -891,8 +1012,10 @@ int ObDDLSSTableRedoWriter::wait_redo_log_finish(const ObDDLMacroBlockRedoInfo & int ObDDLSSTableRedoWriter::write_prepare_log(const ObITable::TableKey &table_key, const int64_t table_id, - const int64_t schema_version, + const int64_t execution_id, + const int64_t ddl_task_id, int64_t &prepare_log_ts) + { int ret = OB_SUCCESS; prepare_log_ts = 0; @@ -929,7 +1052,7 @@ int ObDDLSSTableRedoWriter::write_prepare_log(const ObITable::TableKey &table_ke ObSrvRpcProxy *srv_rpc_proxy = GCTX.srv_rpc_proxy_; obrpc::ObRpcRemoteWriteDDLPrepareLogArg arg; obrpc::Int64 log_ts; - if (OB_FAIL(arg.init(MTL_ID(), leader_ls_id_, table_key, get_start_log_ts(), table_id, schema_version))) { + if (OB_FAIL(arg.init(MTL_ID(), leader_ls_id_, table_key, get_start_log_ts(), table_id, execution_id, ddl_task_id))) { LOG_WARN("fail to init ObRpcRemoteWriteDDLPrepareLogArg", K(ret)); } else if (OB_ISNULL(srv_rpc_proxy)) { ret = OB_ERR_SYS; diff --git a/src/storage/ddl/ob_ddl_redo_log_writer.h b/src/storage/ddl/ob_ddl_redo_log_writer.h index 3014630ef..37a5aace8 100644 --- a/src/storage/ddl/ob_ddl_redo_log_writer.h +++ b/src/storage/ddl/ob_ddl_redo_log_writer.h @@ -43,18 +43,25 @@ class ObLSHandle; // a. set write speed to the log archive speed if archive is on; // b. set write speed to the out bandwidth throttle rate if archive is off. // c. control ddl clog space used at tenant level rather than observer/logstream level. -class ObDDLCtrlSpeedHandleItem final +class ObDDLCtrlSpeedItem final { public: - ObDDLCtrlSpeedHandleItem(): is_inited_(false), ls_id_(share::ObLSID::INVALID_LS_ID), - next_available_write_ts_(-1), write_speed_(750), disk_used_stop_write_threshold_(-1), need_stop_write_(false) {} - ~ObDDLCtrlSpeedHandleItem() {}; - int assign(const ObDDLCtrlSpeedHandleItem &speed_handle_item); + ObDDLCtrlSpeedItem(): is_inited_(false), ls_id_(share::ObLSID::INVALID_LS_ID), + next_available_write_ts_(-1), write_speed_(750), disk_used_stop_write_threshold_(-1), + need_stop_write_(false), ref_cnt_(0) {} + ~ObDDLCtrlSpeedItem() {}; + void reset_need_stop_write() { need_stop_write_ = false; } int init(const share::ObLSID &ls_id); int refresh(); int limit_and_sleep(const int64_t bytes, int64_t &real_sleep_us); - TO_STRING_KV(K_(is_inited), K_(is_inited), K_(next_available_write_ts), - K_(write_speed), K_(disk_used_stop_write_threshold), K_(disk_used_stop_write_threshold)); + + // for ref_cnt_ + void inc_ref() { ATOMIC_INC(&ref_cnt_); } + int64_t dec_ref() { return ATOMIC_SAF(&ref_cnt_, 1); } + int64_t get_ref() { return ATOMIC_LOAD(&ref_cnt_); } + + TO_STRING_KV(K_(is_inited), K_(ls_id), K_(next_available_write_ts), + K_(write_speed), K_(disk_used_stop_write_threshold), K_(need_stop_write), K_(ref_cnt)); private: int cal_limit(const int64_t bytes, int64_t &next_available_ts); int do_sleep(const int64_t next_available_ts, int64_t &real_sleep_us); @@ -67,6 +74,8 @@ private: int64_t write_speed_; int64_t disk_used_stop_write_threshold_; // stop write threshold on tenant level. bool need_stop_write_; + int64_t ref_cnt_; // reference count + DISALLOW_COPY_AND_ASSIGN(ObDDLCtrlSpeedItem); }; class ObDDLCtrlSpeedHandle final @@ -75,6 +84,7 @@ public: int init(); static ObDDLCtrlSpeedHandle &get_instance(); int limit_and_sleep(const uint64_t tenant_id, const share::ObLSID &ls_id, const int64_t bytes, int64_t &real_sleep_us); + private: struct SpeedHandleKey { public: @@ -91,12 +101,6 @@ private: uint64_t tenant_id_; share::ObLSID ls_id_; }; -private: - ObDDLCtrlSpeedHandle(); - ~ObDDLCtrlSpeedHandle(); - int refresh(); - int add_speed_handle_item(const SpeedHandleKey &speed_handle_key); - private: class RefreshSpeedHandleTask: public common::ObTimerTask { @@ -116,12 +120,36 @@ private: public: UpdateSpeedHandleItemFn() = default; ~UpdateSpeedHandleItemFn() = default; - int operator() (common::hash::HashMapPair &entry); + int operator() (common::hash::HashMapPair &entry); }; +private: + class ObDDLCtrlSpeedItemHandle final + { + public: + ObDDLCtrlSpeedItemHandle(): item_(nullptr) { } + ~ObDDLCtrlSpeedItemHandle() { reset(); } + int set_ctrl_speed_item( + ObDDLCtrlSpeedItem *item); + int get_ctrl_speed_item( + ObDDLCtrlSpeedItem*& item) const; + void reset(); + private: + ObDDLCtrlSpeedItem *item_; + DISALLOW_COPY_AND_ASSIGN(ObDDLCtrlSpeedItemHandle); + }; +private: + ObDDLCtrlSpeedHandle(); + ~ObDDLCtrlSpeedHandle(); + int refresh(); + int add_ctrl_speed_item(const SpeedHandleKey &speed_handle_key, ObDDLCtrlSpeedItemHandle &item_handle); + int remove_ctrl_speed_item(const SpeedHandleKey &speed_handle_key); + private: static const int64_t MAP_BUCKET_NUM = 1024; bool is_inited_; - common::hash::ObHashMap speed_handle_map_; + common::hash::ObHashMap speed_handle_map_; + common::ObArenaAllocator allocator_; + common::ObBucketLock bucket_lock_; RefreshSpeedHandleTask refreshTimerTask_; }; @@ -215,7 +243,8 @@ public: const blocksstable::MacroBlockId ¯o_block_id); int write_prepare_log(const ObITable::TableKey &table_key, const int64_t table_id, - const int64_t schema_version, + const int64_t execution_id, + const int64_t ddl_task_id, int64_t &prepare_log_ts); int write_commit_log(const ObITable::TableKey &table_key, const int64_t prepare_log_ts); diff --git a/src/storage/ddl/ob_direct_insert_sstable_ctx.cpp b/src/storage/ddl/ob_direct_insert_sstable_ctx.cpp index 05676f702..74991d80a 100644 --- a/src/storage/ddl/ob_direct_insert_sstable_ctx.cpp +++ b/src/storage/ddl/ob_direct_insert_sstable_ctx.cpp @@ -38,7 +38,7 @@ using namespace oceanbase::sql; /*************** ObSSTableInsertTabletParam *****************/ ObSSTableInsertTabletParam::ObSSTableInsertTabletParam() : context_id_(0), ls_id_(), tablet_id_(), table_id_(0), write_major_(false), - task_cnt_(0), schema_version_(0), snapshot_version_(0) + task_cnt_(0), schema_version_(0), snapshot_version_(0), execution_id_(0), ddl_task_id_(0) { } @@ -55,7 +55,9 @@ bool ObSSTableInsertTabletParam::is_valid() const && tablet_id_.is_valid() && table_id_ > 0 && task_cnt_ >= 0 - && schema_version_ > 0; + && schema_version_ > 0 + && execution_id_ > 0 + && ddl_task_id_ > 0; return bret; } @@ -676,7 +678,8 @@ int ObSSTableInsertTabletContext::create_sstable_with_clog( if (OB_FAIL(ret)) { } else if (OB_FAIL(data_sstable_redo_writer_.write_prepare_log(table_key, table_schema->get_table_id(), - build_param_.schema_version_, + build_param_.execution_id_, + build_param_.ddl_task_id_, prepare_log_ts))) { LOG_WARN("fail write ddl prepare log", K(ret), K(table_key)); } else { @@ -694,7 +697,8 @@ int ObSSTableInsertTabletContext::create_sstable_with_clog( } else if (OB_FAIL(ddl_kv_mgr->ddl_prepare(ddl_start_log_ts, prepare_log_ts, table_schema->get_table_id(), - build_param_.schema_version_))) { + build_param_.execution_id_, + build_param_.ddl_task_id_))) { LOG_WARN("failed to do ddl kv prepare", K(ret), K(ddl_start_log_ts), K(prepare_log_ts), K(build_param_)); } else if (OB_FAIL(ddl_kv_mgr->wait_ddl_commit(ddl_start_log_ts, prepare_log_ts))) { if (OB_TASK_EXPIRED == ret) { @@ -722,7 +726,7 @@ int ObSSTableInsertTabletContext::get_table_key(ObITable::TableKey &table_key) ObSSTableInsertTableParam::ObSSTableInsertTableParam() : exec_ctx_(nullptr), context_id_(0), dest_table_id_(OB_INVALID_ID), write_major_(false), schema_version_(0), - snapshot_version_(0), task_cnt_(0), ls_tablet_ids_() + snapshot_version_(0), task_cnt_(0), execution_id_(0), ddl_task_id_(0), ls_tablet_ids_() { } @@ -738,6 +742,8 @@ int ObSSTableInsertTableParam::assign(const ObSSTableInsertTableParam &other) schema_version_ = other.schema_version_; snapshot_version_ = other.snapshot_version_; task_cnt_ = other.task_cnt_; + execution_id_ = other.execution_id_; + ddl_task_id_ = other.ddl_task_id_; exec_ctx_ = other.exec_ctx_; } return ret; @@ -806,6 +812,8 @@ int ObSSTableInsertTableContext::create_all_tablet_contexts( param.table_id_ = param_.dest_table_id_; param.write_major_ = param_.write_major_; param.task_cnt_ = param_.task_cnt_; + param.execution_id_ = param_.execution_id_; + param.ddl_task_id_ = param_.ddl_task_id_; if (OB_FAIL(tablet_ctx->init(param))) { LOG_WARN("init tablet insert sstable context", K(ret)); } else if (OB_FAIL(tablet_ctx_map_.set_refactored(tablet_id, tablet_ctx))) { diff --git a/src/storage/ddl/ob_direct_insert_sstable_ctx.h b/src/storage/ddl/ob_direct_insert_sstable_ctx.h index e1450399c..ef3e16ae7 100644 --- a/src/storage/ddl/ob_direct_insert_sstable_ctx.h +++ b/src/storage/ddl/ob_direct_insert_sstable_ctx.h @@ -55,7 +55,7 @@ public: ~ObSSTableInsertTabletParam(); bool is_valid() const; TO_STRING_KV(K(context_id_), K(ls_id_), K(tablet_id_), K(table_id_), K(write_major_), - K(task_cnt_), K(schema_version_), K(snapshot_version_)); + K(task_cnt_), K(schema_version_), K(snapshot_version_), K_(execution_id), K_(ddl_task_id)); public: int64_t context_id_; share::ObLSID ls_id_; @@ -65,6 +65,8 @@ public: int64_t task_cnt_; int64_t schema_version_; int64_t snapshot_version_; + int64_t execution_id_; + int64_t ddl_task_id_; }; typedef std::pair LSTabletIDPair; @@ -144,9 +146,10 @@ public: ~ObSSTableInsertTableParam() = default; int assign(const ObSSTableInsertTableParam &other); bool is_valid() const { return exec_ctx_ != nullptr && OB_INVALID_ID != dest_table_id_ - && schema_version_ >= 0 && snapshot_version_ >= 0 && task_cnt_ >= 0 && ls_tablet_ids_.count() > 0; } + && schema_version_ >= 0 && snapshot_version_ >= 0 && task_cnt_ >= 0 + && execution_id_ > 0 && ddl_task_id_ > 0 && ls_tablet_ids_.count() > 0; } TO_STRING_KV(K_(context_id), K_(dest_table_id), K_(write_major), K_(schema_version), K_(snapshot_version), - K_(task_cnt), K_(ls_tablet_ids)); + K_(task_cnt), K_(execution_id), K_(ddl_task_id), K_(ls_tablet_ids)); public: sql::ObExecContext *exec_ctx_; int64_t context_id_; @@ -155,6 +158,8 @@ public: int64_t schema_version_; int64_t snapshot_version_; int64_t task_cnt_; + int64_t execution_id_; + int64_t ddl_task_id_; common::ObArray ls_tablet_ids_; }; diff --git a/src/storage/ddl/ob_tablet_ddl_kv_mgr.cpp b/src/storage/ddl/ob_tablet_ddl_kv_mgr.cpp index 529ac4690..a098952b9 100644 --- a/src/storage/ddl/ob_tablet_ddl_kv_mgr.cpp +++ b/src/storage/ddl/ob_tablet_ddl_kv_mgr.cpp @@ -28,7 +28,7 @@ using namespace oceanbase::storage; ObTabletDDLKvMgr::ObTabletDDLKvMgr() : is_inited_(false), is_commit_success_(false), ls_id_(), tablet_id_(), table_key_(), cluster_version_(0), start_log_ts_(0), max_freeze_log_ts_(0), - table_id_(0), schema_version_(0), head_(0), tail_(0), lock_(), ref_cnt_(0) + table_id_(0), execution_id_(0), head_(0), tail_(0), lock_(), ref_cnt_(0) { MEMSET(ddl_kvs_, 0, MAX_DDL_KV_CNT_IN_STORAGE * sizeof(ddl_kvs_[0])); } @@ -59,7 +59,7 @@ void ObTabletDDLKvMgr::destroy() start_log_ts_ = 0; max_freeze_log_ts_ = 0; table_id_ = 0; - schema_version_ = 0; + execution_id_ = 0; is_commit_success_ = false; is_inited_ = false; } @@ -130,7 +130,11 @@ int ObTabletDDLKvMgr::ddl_start(const ObITable::TableKey &table_key, const int64 return ret; } -int ObTabletDDLKvMgr::ddl_prepare(const int64_t start_log_ts, const int64_t prepare_log_ts, const uint64_t table_id, const int64_t schema_version) +int ObTabletDDLKvMgr::ddl_prepare(const int64_t start_log_ts, + const int64_t prepare_log_ts, + const uint64_t table_id, + const int64_t execution_id, + const int64_t ddl_task_id) { int ret = OB_SUCCESS; ObDDLKVHandle kv_handle; @@ -146,7 +150,8 @@ int ObTabletDDLKvMgr::ddl_prepare(const int64_t start_log_ts, const int64_t prep LOG_WARN("freeze ddl kv failed", K(ret), K(prepare_log_ts)); } else { table_id_ = table_id; - schema_version_ = schema_version; + execution_id_ = execution_id; + ddl_task_id_ = ddl_task_id; ObDDLTableMergeDagParam param; param.ls_id_ = ls_id_; @@ -154,7 +159,8 @@ int ObTabletDDLKvMgr::ddl_prepare(const int64_t start_log_ts, const int64_t prep param.rec_log_ts_ = prepare_log_ts; param.is_commit_ = true; param.table_id_ = table_id; - param.schema_version_ = schema_version; + param.execution_id_ = execution_id_; + param.ddl_task_id_ = ddl_task_id_; const int64_t start_ts = ObTimeUtility::fast_current_time(); while (OB_SUCC(ret) && is_started()) { if (OB_FAIL(compaction::ObScheduleDagFunc::schedule_ddl_table_merge_dag(param))) { @@ -197,7 +203,8 @@ int ObTabletDDLKvMgr::ddl_commit(const int64_t start_log_ts, const int64_t prepa param.rec_log_ts_ = prepare_log_ts; param.is_commit_ = true; param.table_id_ = table_id_; - param.schema_version_ = schema_version_; + param.execution_id_ = execution_id_; + param.ddl_task_id_ = ddl_task_id_; // retry submit dag in case of the previous dag failed if (OB_FAIL(compaction::ObScheduleDagFunc::schedule_ddl_table_merge_dag(param))) { if (OB_SIZE_OVERFLOW == ret || OB_EAGAIN == ret) { @@ -294,7 +301,7 @@ int ObTabletDDLKvMgr::cleanup() start_log_ts_ = 0; max_freeze_log_ts_ = 0; table_id_ = 0; - schema_version_ = 0; + execution_id_ = 0; is_commit_success_ = false; } return ret; diff --git a/src/storage/ddl/ob_tablet_ddl_kv_mgr.h b/src/storage/ddl/ob_tablet_ddl_kv_mgr.h index 5ba49b965..29721a992 100644 --- a/src/storage/ddl/ob_tablet_ddl_kv_mgr.h +++ b/src/storage/ddl/ob_tablet_ddl_kv_mgr.h @@ -37,7 +37,7 @@ public: ~ObTabletDDLKvMgr(); int init(const share::ObLSID &ls_id, const common::ObTabletID &tablet_id); // init before memtable mgr int ddl_start(const ObITable::TableKey &table_key, const int64_t start_log_ts, const int64_t cluster_version, const int64_t checkpoint_log_ts = 0); - int ddl_prepare(const int64_t start_log_ts, const int64_t prepare_log_ts, const uint64_t table_id = 0, const int64_t schema_version = 0); // schedule build a major sstable + int ddl_prepare(const int64_t start_log_ts, const int64_t commit_log_ts, const uint64_t table_id = 0, const int64_t execution_id = 0, const int64_t ddl_task_id = 0); // schedule build a major sstable int ddl_commit(const int64_t start_log_ts, const int64_t prepare_log_ts, const bool is_replay); // try wait build major sstable int wait_ddl_commit(const int64_t start_log_ts, const int64_t prepare_log_ts); int get_ddl_param(ObTabletDDLParam &ddl_param); @@ -59,8 +59,7 @@ public: OB_INLINE void reset() { destroy(); } TO_STRING_KV(K_(is_inited), K_(is_commit_success), K_(ls_id), K_(tablet_id), K_(table_key), K_(cluster_version), K_(start_log_ts), K_(max_freeze_log_ts), - K_(table_id), K_(schema_version), - K_(head), K_(tail), K_(ref_cnt)); + K_(table_id), K_(execution_id), K_(ddl_task_id), K_(head), K_(tail), K_(ref_cnt)); private: int64_t get_idx(const int64_t pos) const; @@ -82,7 +81,8 @@ private: int64_t start_log_ts_; int64_t max_freeze_log_ts_; uint64_t table_id_; // used for ddl checksum - int64_t schema_version_; // used for ddl checksum + int64_t execution_id_; // used for ddl checksum + int64_t ddl_task_id_; // used for ddl checksum ObDDLKV *ddl_kvs_[MAX_DDL_KV_CNT_IN_STORAGE]; int64_t head_; int64_t tail_; diff --git a/src/storage/lob/ob_lob_util.h b/src/storage/lob/ob_lob_util.h index a8295bb86..fc44aa62f 100644 --- a/src/storage/lob/ob_lob_util.h +++ b/src/storage/lob/ob_lob_util.h @@ -35,7 +35,7 @@ struct ObLobAccessParam { main_tablet_param_(nullptr), meta_tablet_param_(nullptr), piece_tablet_param_(nullptr), ls_id_(), tablet_id_(), coll_type_(common::ObCollationType::CS_TYPE_BINARY), lob_common_(nullptr), lob_data_(nullptr), byte_size_(0), handle_size_(0), timeout_(0), - fb_snapshot_(transaction::ObTransVersion::INVALID_TRANS_VERSION), + fb_snapshot_(), scan_backward_(false), asscess_ptable_(false), offset_(0), len_(0), seq_no_st_(-1), used_seq_cnt_(0), total_seq_cnt_(0), checksum_(0), update_len_(0) {} @@ -58,7 +58,7 @@ struct ObLobAccessParam { int64_t byte_size_; int64_t handle_size_; int64_t timeout_; - int64_t fb_snapshot_; + palf::SCN fb_snapshot_; bool scan_backward_; bool asscess_ptable_; uint64_t offset_; // is_char为true时 offset代表字符长度 diff --git a/src/storage/ls/ob_ls_tablet_service.cpp b/src/storage/ls/ob_ls_tablet_service.cpp index 7f75f06bf..ffa40737d 100644 --- a/src/storage/ls/ob_ls_tablet_service.cpp +++ b/src/storage/ls/ob_ls_tablet_service.cpp @@ -138,7 +138,7 @@ int ObLSTabletService::offline() ret = OB_NOT_INIT; LOG_WARN("not inited", K(ret), K_(is_inited)); } else { - CleanMemtableOperator clean_mem_op(this); + DestroyMemtableAndMgrOperator clean_mem_op(this); if (OB_FAIL(tablet_id_set_.foreach(clean_mem_op))) { LOG_WARN("fail to clean memtables", K(ret), K(clean_mem_op.cur_tablet_id_)); } @@ -884,7 +884,7 @@ int ObLSTabletService::rebuild_tablet_with_old( if (OB_FAIL(direct_get_tablet(tablet_id, old_tablet_handle))) { LOG_WARN("failed to get tablet", K(ret), K(key)); - } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle))) { + } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle, true/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else if (FALSE_IT(new_tablet = new_tablet_handle.get_obj())) { } else if (OB_FAIL(new_tablet->init(mig_tablet_param, true/*is_update*/, freezer))) { @@ -920,7 +920,7 @@ int ObLSTabletService::migrate_update_tablet( if (OB_FAIL(direct_get_tablet(tablet_id, old_tablet_handle))) { LOG_WARN("failed to get tablet", K(ret), K(key)); - } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle))) { + } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle, true/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else if (FALSE_IT(new_tablet = new_tablet_handle.get_obj())) { } else if (OB_FAIL(new_tablet->init(mig_tablet_param, true/*is_update*/, freezer))) { @@ -1006,7 +1006,7 @@ int ObLSTabletService::update_tablet_table_store( } else if (OB_UNLIKELY(!tablet_id.is_valid() || !param.is_valid())) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", K(ret), K(tablet_id), K(param)); - } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle))) { + } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle, true/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else { new_tablet = new_tablet_handle.get_obj(); @@ -1448,7 +1448,7 @@ int ObLSTabletService::inner_table_scan( //check schema_version with ref_table_id, because schema_version of scan_param is from ref table LOG_WARN("check schema version for bounded staleness read fail", K(ret), K(param)); //need to get store ctx of PG, cur_key_ saves the real partition - } else if (0 == param.fb_snapshot_) { + } else if (param.fb_snapshot_.is_min()) { ret = OB_SNAPSHOT_DISCARDED; } else if (OB_FAIL(ObTabletBindingHelper::check_snapshot_readable( tablet_handle, @@ -2818,7 +2818,7 @@ int ObLSTabletService::build_ha_tablet_new_table_store( LOG_WARN("failed to get tx data from old tablet", K(ret), K(tablet_id)); } else if (OB_FAIL(old_tablet->get_latest_autoinc_seq(autoinc_seq))) { LOG_WARN("failed to get autoinc seq from old tablet", K(ret)); - } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle))) { + } else if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle, true/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else if (FALSE_IT(new_tablet = new_tablet_handle.get_obj())) { } else if (OB_FAIL(new_tablet->init(param, *old_tablet, tx_data, ddl_data, autoinc_seq))) { @@ -5389,7 +5389,7 @@ int ObLSTabletService::GetAllTabletIDOperator::operator()(const common::ObTablet return ret; } -int ObLSTabletService::CleanMemtableOperator::operator()(const common::ObTabletID &tablet_id) +int ObLSTabletService::DestroyMemtableAndMgrOperator::operator()(const common::ObTabletID &tablet_id) { int ret = OB_SUCCESS; int tmp_ret = OB_SUCCESS; @@ -5411,8 +5411,8 @@ int ObLSTabletService::CleanMemtableOperator::operator()(const common::ObTabletI } } else if (OB_FAIL(handle.get_obj()->release_memtables())) { LOG_WARN("failed to release memtables", K(tenant_id), K(tablet_id)); - } else { - // do nothing + } else if (OB_FAIL(handle.get_obj()->destroy_memtable_mgr())) { + LOG_WARN("failed to destroy shared_params", K(ret), K(tenant_id), K(tablet_id)); } return ret; } diff --git a/src/storage/ls/ob_ls_tablet_service.h b/src/storage/ls/ob_ls_tablet_service.h index 02242e9b0..8e28e2182 100644 --- a/src/storage/ls/ob_ls_tablet_service.h +++ b/src/storage/ls/ob_ls_tablet_service.h @@ -396,12 +396,12 @@ private: private: common::ObIArray &tablet_ids_; }; - class CleanMemtableOperator final + class DestroyMemtableAndMgrOperator final { public: - CleanMemtableOperator(ObLSTabletService *tablet_svr) + DestroyMemtableAndMgrOperator(ObLSTabletService *tablet_svr) : tablet_svr_(tablet_svr) {} - ~CleanMemtableOperator() = default; + ~DestroyMemtableAndMgrOperator() = default; int operator()(const common::ObTabletID &tablet_id); common::ObTabletID cur_tablet_id_; ObLSTabletService *tablet_svr_; diff --git a/src/storage/memtable/mvcc/ob_tx_callback_list.cpp b/src/storage/memtable/mvcc/ob_tx_callback_list.cpp index a43d1bb69..4bf2aa64f 100644 --- a/src/storage/memtable/mvcc/ob_tx_callback_list.cpp +++ b/src/storage/memtable/mvcc/ob_tx_callback_list.cpp @@ -122,7 +122,7 @@ int ObTxCallbackList::callback_(ObITxCallbackFunctor &functor, if ((++traverse_count & 0xFFFFF) == 0) { TRANS_LOG(WARN, "memtable fifo callback too long", - K(traverse_count), KPC(iter), K(functor)); + K(traverse_count), K(functor)); } } } diff --git a/src/storage/memtable/ob_memtable_context.cpp b/src/storage/memtable/ob_memtable_context.cpp index aa05f7888..c1df68930 100644 --- a/src/storage/memtable/ob_memtable_context.cpp +++ b/src/storage/memtable/ob_memtable_context.cpp @@ -64,6 +64,9 @@ ObMemtableCtx::ObMemtableCtx() is_master_(true), read_elr_data_(false), lock_mem_ctx_(ctx_cb_allocator_), +#ifdef ENABLE_DEBUG_LOG + defensive_check_mgr_(NULL), +#endif is_inited_(false) { } @@ -91,6 +94,8 @@ int ObMemtableCtx::init(const uint64_t tenant_id) } else if (OB_FAIL(reset_log_generator_())) { TRANS_LOG(ERROR, "fail to reset log generator", K(ret)); #ifdef ENABLE_DEBUG_LOG + } else if (!GCONF.enable_defensive_check()) { + // do nothing } else if (NULL == (defensive_check_mgr_ = op_alloc(ObDefensiveCheckMgr))) { ret = OB_ALLOCATE_MEMORY_FAILED; TRANS_LOG(ERROR, "memory alloc failed", K(ret), KP(defensive_check_mgr_)); @@ -100,6 +105,9 @@ int ObMemtableCtx::init(const uint64_t tenant_id) defensive_check_mgr_ = NULL; #endif } else { + // do nothing + } + if (OB_SUCC(ret)) { is_inited_ = true; } } diff --git a/src/storage/memtable/ob_row_compactor.cpp b/src/storage/memtable/ob_row_compactor.cpp index b5d5c0061..772aef8c7 100644 --- a/src/storage/memtable/ob_row_compactor.cpp +++ b/src/storage/memtable/ob_row_compactor.cpp @@ -457,6 +457,7 @@ ObMvccTransNode *ObMemtableRowCompactor::construct_compact_node_(const int64_t s STORAGE_LOG(WARN, "Unexpected null row header", K(ret)); } else { rowkey_cnt = row_header->get_rowkey_count(); + compact_datum_row.count_ = rowkey_cnt; } } if (OB_SUCC(ret) && find_committed_tnode) { @@ -483,7 +484,7 @@ ObMvccTransNode *ObMemtableRowCompactor::construct_compact_node_(const int64_t s } else if (OB_FAIL(compact_datum_row.reserve(datum_row.get_column_count(), true))) { STORAGE_LOG(WARN, "Failed to reserve datum row", K(ret), K(datum_row)); } else { - compact_datum_row.count_ = datum_row.get_column_count(); + compact_datum_row.count_ = MAX(datum_row.get_column_count(), compact_datum_row.count_); if (ObDmlFlag::DF_NOT_EXIST == dml_flag) { dml_flag = mtd->dml_flag_; compact_datum_row.row_flag_.set_flag(dml_flag); diff --git a/src/storage/meta_mem/ob_meta_pointer_map.h b/src/storage/meta_mem/ob_meta_pointer_map.h index a07ce3c41..e083dc64a 100644 --- a/src/storage/meta_mem/ob_meta_pointer_map.h +++ b/src/storage/meta_mem/ob_meta_pointer_map.h @@ -371,7 +371,7 @@ int ObMetaPointerMap::try_get_in_memory_meta_obj( STORAGE_LOG(WARN, "fail to get meta pointer", K(ret), KP(t_ptr), K(key)); } else if (OB_UNLIKELY(t_ptr->get_addr().is_none())) { ret = OB_ITEM_NOT_SETTED; - STORAGE_LOG(WARN, "pointer addr is none, no object to be got", K(ret), K(key), KPC(t_ptr)); + STORAGE_LOG(DEBUG, "pointer addr is none, no object to be got", K(ret), K(key), KPC(t_ptr)); } else { is_in_memory = t_ptr->is_in_memory(); if (is_in_memory && OB_FAIL(t_ptr->get_in_memory_obj(guard))) { @@ -395,7 +395,7 @@ int ObMetaPointerMap::get_meta_obj( ret = common::OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "invalid argument", K(ret), K(key)); } else if (OB_FAIL(try_get_in_memory_meta_obj(key, ptr_hdl, guard, is_in_memory))) { - if (OB_ENTRY_NOT_EXIST == ret) { + if (OB_ENTRY_NOT_EXIST == ret || OB_ITEM_NOT_SETTED == ret) { STORAGE_LOG(DEBUG, "meta obj does not exist", K(ret), K(key)); } else { STORAGE_LOG(WARN, "fail to try get in memory meta obj", K(ret), K(key)); diff --git a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp index e7e1f309b..bf5619e45 100644 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp @@ -762,7 +762,8 @@ int ObTenantMetaMemMgr::acquire_tablet( const WashTabletPriority &priority, const ObTabletMapKey &key, ObLSHandle &ls_handle, - ObTabletHandle &tablet_handle) + ObTabletHandle &tablet_handle, + const bool only_acquire) { int ret = OB_SUCCESS; ObMetaObj meta_obj; @@ -787,7 +788,7 @@ int ObTenantMetaMemMgr::acquire_tablet( ObBucketHashWLockGuard lock_guard(bucket_lock_, key.hash()); if (OB_FAIL(has_tablet(key, is_exist))) { LOG_WARN("fail to check tablet existence", K(ret), K(key)); - } else if (is_exist) { + } else if (is_exist || only_acquire) { ObTabletPointerHandle ptr_handle(tablet_map_); if (OB_FAIL(tablet_map_.set_attr_for_obj(key, tablet_handle))) { LOG_WARN("fail to set attribute for tablet", K(ret), K(key), K(tablet_handle)); @@ -813,7 +814,8 @@ int ObTenantMetaMemMgr::acquire_tablet( const WashTabletPriority &priority, const ObTabletMapKey &key, common::ObIAllocator &allocator, - ObTabletHandle &tablet_handle) + ObTabletHandle &tablet_handle, + const bool only_acquire) { int ret = OB_SUCCESS; void *buf = nullptr; @@ -834,7 +836,7 @@ int ObTenantMetaMemMgr::acquire_tablet( ObBucketHashWLockGuard lock_guard(bucket_lock_, key.hash()); if (OB_FAIL(has_tablet(key, is_exist))) { LOG_WARN("fail to check tablet existence", K(ret), K(key)); - } else if (is_exist) { + } else if (is_exist || only_acquire) { ObTabletPointerHandle ptr_handle(tablet_map_); if (OB_FAIL(tablet_map_.set_attr_for_obj(key, tablet_handle))) { LOG_WARN("fail to set attribute for tablet", K(ret), K(key), K(tablet_handle)); @@ -927,7 +929,7 @@ int ObTenantMetaMemMgr::get_tablet( ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ret), K(key)); } else if (OB_FAIL(tablet_map_.get_meta_obj(key, allocator_, handle))) { - if (OB_ENTRY_NOT_EXIST != ret) { + if (OB_ENTRY_NOT_EXIST != ret && OB_ITEM_NOT_SETTED != ret) { LOG_WARN("fail to get tablet", K(ret), K(key)); } } else if (OB_ISNULL(handle.get_obj())) { @@ -1071,9 +1073,6 @@ int ObTenantMetaMemMgr::del_tablet(const ObTabletMapKey &key) LOG_WARN("fail to erase tablet pointer", K(ret), K(key)); } else if (OB_FAIL(erase_pinned_tablet(key))) { LOG_WARN("failed to erase from pinned tablet set", K(ret), K(key)); - } else { - // TODO(@bowen.gbw): temproarily for debug - FLOG_INFO("succeeded to del tablet", K(ret), K(key), K(lbt())); } return ret; } @@ -1433,7 +1432,7 @@ int64_t ObTenantMetaMemMgr::calc_wash_tablet_cnt() const { const int64_t used_tablet_cnt = tablet_pool_.get_used_obj_cnt(); const double variable_mem_fragment_ratio = std::round(((allocator_.total() * 1.0) / allocator_.used()) * 10000) / 10000; - const int64_t wash_cnt = variable_mem_fragment_ratio > 3.75 ? INT64_MAX : static_cast(used_tablet_cnt * 0.2); + const int64_t wash_cnt = min(variable_mem_fragment_ratio > 3.75 ? INT64_MAX : static_cast(used_tablet_cnt * 0.2), 30000); FLOG_INFO("calculate wash tablet count", K(wash_cnt), K(variable_mem_fragment_ratio), K(used_tablet_cnt)); return wash_cnt; } @@ -1611,7 +1610,7 @@ int ObTenantMetaMemMgr::erase_pinned_tablet(const ObTabletMapKey &key) LOG_WARN("invalid args", K(ret), K(key)); } else if (OB_FAIL(pinned_tablet_set_.erase_refactored(key))) { if (OB_HASH_NOT_EXIST == ret) { - LOG_WARN("tablet does not exist in t3m pinned set", K(ret), K(key)); + LOG_DEBUG("tablet does not exist in t3m pinned set", K(ret), K(key)); ret = OB_SUCCESS; } else { LOG_WARN("failed to erase from hash set", K(ret), K(key)); @@ -1621,7 +1620,6 @@ int ObTenantMetaMemMgr::erase_pinned_tablet(const ObTabletMapKey &key) return ret; } - ObTenantMetaMemMgr::MinMinorSSTableInfo::MinMinorSSTableInfo( const share::ObLSID &ls_id, const ObITable::TableKey &table_key, diff --git a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.h b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.h index 94ae350ec..3a4ea2975 100644 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.h +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.h @@ -145,12 +145,14 @@ public: const WashTabletPriority &priority, const ObTabletMapKey &key, ObLSHandle &ls_handle, - ObTabletHandle &tablet_handle); + ObTabletHandle &tablet_handle, + const bool only_acquire); int acquire_tablet( const WashTabletPriority &priority, const ObTabletMapKey &key, common::ObIAllocator &allocator, - ObTabletHandle &tablet_handle); + ObTabletHandle &tablet_handle, + const bool only_acquire); int get_tablet( const WashTabletPriority &priority, const ObTabletMapKey &key, diff --git a/src/storage/ob_resource_map.h b/src/storage/ob_resource_map.h index d73d70fac..e70e3d36c 100644 --- a/src/storage/ob_resource_map.h +++ b/src/storage/ob_resource_map.h @@ -207,16 +207,21 @@ int ObResourceMap::init(const int64_t bucket_num, const char *label, const int64_t total_limit, const int64_t hold_limit, const int64_t page_size) { int ret = common::OB_SUCCESS; + const int64_t bkt_num = common::hash::cal_next_prime(bucket_num); if (OB_UNLIKELY(is_inited_)) { ret = common::OB_INIT_TWICE; STORAGE_LOG(WARN, "ObResourceMap has already been inited", K(ret)); } else if (OB_UNLIKELY(bucket_num <= 0 || total_limit <= 0 || hold_limit <= 0 || page_size <= 0)) { ret = common::OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "invalid argument", K(ret), K(bucket_num), K(total_limit), K(hold_limit), K(page_size)); - } else if (OB_FAIL(bucket_lock_.init(bucket_num))) { - STORAGE_LOG(WARN, "fail to init bucket lock", K(ret), K(bucket_num)); - } else if (OB_FAIL(map_.create(bucket_num, label))) { + } else if (OB_FAIL(bucket_lock_.init(bkt_num))) { + STORAGE_LOG(WARN, "fail to init bucket lock", K(ret), K(bkt_num)); + } else if (OB_FAIL(map_.create(bkt_num, label))) { STORAGE_LOG(WARN, "fail to create map", K(ret)); + } else if (OB_UNLIKELY(bkt_num != map_.bucket_count())) { + ret = OB_ERR_UNEXPECTED; + STORAGE_LOG(WARN, "lock buckets isn't equal to map buckets, which could cause concurrency issues", K(ret), + K(bkt_num), K(map_.bucket_count())); } else if (OB_FAIL(allocator_.init(total_limit, hold_limit, page_size))) { STORAGE_LOG(WARN, "fail to init allocator", K(ret)); } else { diff --git a/src/storage/slog_ckpt/ob_tenant_storage_checkpoint_writer.cpp b/src/storage/slog_ckpt/ob_tenant_storage_checkpoint_writer.cpp index 5b9f3e072..8a838d197 100644 --- a/src/storage/slog_ckpt/ob_tenant_storage_checkpoint_writer.cpp +++ b/src/storage/slog_ckpt/ob_tenant_storage_checkpoint_writer.cpp @@ -213,7 +213,7 @@ int ObTenantStorageCheckpointWriter::write_tablet_checkpoint( } else if (addr.is_memory()) { FLOG_INFO("skip MEM type", K(ret), K(tablet_key), K(addr)); } else if (OB_FAIL(copy_one_tablet_item(tablet_item_writer_, addr, &item_idx))) { - LOG_ERROR("fail to copy_one_tablet_item", K(ret), K(tablet_key), K(addr)); + LOG_WARN("fail to copy_one_tablet_item", K(ret), K(tablet_key), K(addr)); } else { addr_info.tablet_key_ = tablet_key; addr_info.item_idx_ = item_idx; diff --git a/src/storage/tablet/ob_tablet.cpp b/src/storage/tablet/ob_tablet.cpp index 3092dc2c7..9ccd26140 100644 --- a/src/storage/tablet/ob_tablet.cpp +++ b/src/storage/tablet/ob_tablet.cpp @@ -310,6 +310,10 @@ int ObTablet::init( || OB_ISNULL(log_handler_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("tablet pointer handle is invalid", K(ret), K_(pointer_hdl), K_(memtable_mgr), K_(log_handler)); + } else if (is_update + && param.ha_status_.is_restore_status_full() // is_update && is_migrate: init memtable_mgr. restore reuse memtable_mgr + && OB_FAIL(init_memtable_mgr(ls_id, tablet_id, param.max_sync_storage_schema_version_, freezer))) { + LOG_WARN("failed to init memtable mgr", K(ret), K(ls_id), K(tablet_id), KP(freezer)); } else if (!is_update && OB_FAIL(init_shared_params(ls_id, tablet_id, param.max_sync_storage_schema_version_, freezer))) { LOG_WARN("failed to init shared params", K(ret), K(ls_id), K(tablet_id), KP(freezer)); } else if (OB_FAIL(tablet_meta_.init(*allocator_, param))) { @@ -603,10 +607,10 @@ int ObTablet::load_deserialize( if (OB_FAIL(ls_service->get_ls(tablet_meta_.ls_id_, ls_handle, ObLSGetMod::TABLET_MOD))) { LOG_WARN("failed to get ls", K(ret), "ls_id", tablet_meta_.ls_id_); } else if (t3m->is_used_obj_pool(&allocator)) { - if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, ls_handle, next_tablet_handle))) { + if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, ls_handle, next_tablet_handle, false/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } - } else if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, allocator, next_tablet_handle))) { + } else if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, allocator, next_tablet_handle, false/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } if (OB_FAIL(ret)) { @@ -1701,6 +1705,22 @@ int ObTablet::release_memtables() return ret; } +int ObTablet::destroy_memtable_mgr() +{ + int ret = OB_SUCCESS; + ObIMemtableMgr *memtable_mgr = nullptr; + + if (IS_NOT_INIT) { + ret = OB_NOT_INIT; + LOG_WARN("not inited", K(ret), K_(is_inited)); + } else if (OB_FAIL(get_memtable_mgr(memtable_mgr))) { + LOG_WARN("failed to get memtable mgr", K(ret)); + } else { + memtable_mgr->destroy(); + } + return ret; +} + int ObTablet::get_memtable_mgr(ObIMemtableMgr *&memtable_mgr) const { int ret = OB_SUCCESS; @@ -1778,6 +1798,32 @@ int ObTablet::init_shared_params( return ret; } +int ObTablet::init_memtable_mgr( + const share::ObLSID &ls_id, + const common::ObTabletID &tablet_id, + const int64_t max_saved_schema_version, // for init storage_schema_recorder on MemtableMgr + ObFreezer *freezer) +{ + int ret = OB_SUCCESS; + if (OB_UNLIKELY(!pointer_hdl_.is_valid())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("tablet pointer handle is invalid", K(ret), K_(pointer_hdl)); + } else { + ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); + ObIMemtableMgr *memtable_mgr = nullptr; + ObTabletDDLKvMgr *ddl_kv_mgr = nullptr; + + if (OB_FAIL(get_ddl_kv_mgr(ddl_kv_mgr))) { + LOG_WARN("failed to get ddl kv mgr", K(ret)); + } else if (OB_FAIL(get_memtable_mgr(memtable_mgr))) { + LOG_WARN("failed to get memtable mgr", K(ret)); + } else if (OB_FAIL(memtable_mgr->init(tablet_id, ls_id, max_saved_schema_version, log_handler_, freezer, t3m, ddl_kv_mgr))) { + LOG_WARN("failed to init memtable mgr", K(ret), K(tablet_id), K(ls_id), KP(freezer)); + } + } + return ret; +} + int ObTablet::build_read_info(common::ObIAllocator &allocator) { int ret = OB_SUCCESS; diff --git a/src/storage/tablet/ob_tablet.h b/src/storage/tablet/ob_tablet.h index 6d87845bd..69b2d6ae9 100644 --- a/src/storage/tablet/ob_tablet.h +++ b/src/storage/tablet/ob_tablet.h @@ -238,6 +238,7 @@ public: // force release all memtables // just for rebuild or migrate retry. int release_memtables(); + int destroy_memtable_mgr(); // multi-source data operation int check_tx_data(bool &is_valid) const; @@ -401,6 +402,11 @@ private: const common::ObTabletID &tablet_id, const int64_t max_saved_schema_version, ObFreezer *freezer); + int init_memtable_mgr( + const share::ObLSID &ls_id, + const common::ObTabletID &tablet_id, + const int64_t max_saved_schema_version, + ObFreezer *freezer); int build_read_info(common::ObIAllocator &allocator); int create_memtable(const int64_t schema_version, const bool for_replay=false); int try_update_start_scn(); diff --git a/src/storage/tablet/ob_tablet_create_delete_helper.cpp b/src/storage/tablet/ob_tablet_create_delete_helper.cpp index 3b3aaa14d..edc6d8c31 100644 --- a/src/storage/tablet/ob_tablet_create_delete_helper.cpp +++ b/src/storage/tablet/ob_tablet_create_delete_helper.cpp @@ -854,46 +854,48 @@ int ObTabletCreateDeleteHelper::roll_back_remove_tablet( const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle tablet_handle; + // Try figure out if tablet needs to dec memtable ref or not if (OB_FAIL(get_tablet(key, tablet_handle))) { - if (OB_TABLET_NOT_EXIST == ret) { - // tablet does not exist, do nothing + if (OB_TABLET_NOT_EXIST == ret || OB_ITEM_NOT_SETTED == ret) { + // tablet does not exist or tablet creation failed on half way, do nothing ret = OB_SUCCESS; } else { LOG_WARN("failed to get tablet", K(ret), K(ls_id), K(tablet_id)); } + } else if (trans_flags.for_replay_) { + // for replay, no need to dec ref for memtable } else { - if (trans_flags.for_replay_) { - // for replay, no need to dec ref for memtable - } else { - ObTablet *tablet = tablet_handle.get_obj(); - ObTabletMemtableMgr *memtable_mgr = static_cast(tablet->get_memtable_mgr()); - ObSEArray memtable_handle_array; - if (OB_FAIL(memtable_mgr->get_all_memtables(memtable_handle_array))) { - LOG_WARN("failed to get all memtables", K(ret), K(ls_id), K(tablet_id)); - } else if (0 == memtable_handle_array.count()) { - // tablet does not have memtable, do nothing - } else if (1 == memtable_handle_array.count()) { - ObMemtable *memtable = nullptr; - ObTabletTxMultiSourceDataUnit tx_data; - if (OB_FAIL(memtable_handle_array.at(0).get_data_memtable(memtable))) { - LOG_WARN("failed to get memtable", K(ret), K(ls_id), K(tablet_id)); - } else if (!memtable->has_multi_source_data_unit(MultiSourceDataUnitType::TABLET_TX_DATA)) { - LOG_INFO("memtable does not have msd, do nothing", K(ret), K(ls_id), K(tablet_id)); - } else if (OB_FAIL(tablet->get_tx_data(tx_data))) { - LOG_WARN("failed to get tx data", K(ret), K(ls_id), K(tablet_id)); - } else if (OB_FAIL(tablet->save_multi_source_data_unit(&tx_data, share::ObScnRange::MAX_TS, - trans_flags.for_replay_, MemtableRefOp::DEC_REF, true/*is_callback*/))) { - LOG_WARN("failed to save msd", K(ret), K(ls_id), K(tablet_id)); - } - } else { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("tablet should not have more than one memtable", K(ret), K(ls_id), K(tablet_id), - "memtable_cnt", memtable_handle_array.count()); + ObTablet *tablet = tablet_handle.get_obj(); + ObTabletMemtableMgr *memtable_mgr = static_cast(tablet->get_memtable_mgr()); + ObSEArray memtable_handle_array; + if (OB_FAIL(memtable_mgr->get_all_memtables(memtable_handle_array))) { + LOG_WARN("failed to get all memtables", K(ret), K(ls_id), K(tablet_id)); + } else if (0 == memtable_handle_array.count()) { + // tablet does not have memtable, do nothing + } else if (1 == memtable_handle_array.count()) { + ObMemtable *memtable = nullptr; + ObTabletTxMultiSourceDataUnit tx_data; + if (OB_FAIL(memtable_handle_array.at(0).get_data_memtable(memtable))) { + LOG_WARN("failed to get memtable", K(ret), K(ls_id), K(tablet_id)); + } else if (!memtable->has_multi_source_data_unit(MultiSourceDataUnitType::TABLET_TX_DATA)) { + LOG_INFO("memtable does not have msd, do nothing", K(ret), K(ls_id), K(tablet_id)); + } else if (OB_FAIL(tablet->get_tx_data(tx_data))) { + LOG_WARN("failed to get tx data", K(ret), K(ls_id), K(tablet_id)); + } else if (OB_FAIL(tablet->save_multi_source_data_unit(&tx_data, ObScnRange::MAX_TS, + trans_flags.for_replay_, MemtableRefOp::DEC_REF, true/*is_callback*/))) { + LOG_WARN("failed to save msd", K(ret), K(ls_id), K(tablet_id)); } + } else { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("tablet should not have more than one memtable", K(ret), K(ls_id), K(tablet_id), + "memtable_cnt", memtable_handle_array.count()); } + } - if (OB_FAIL(ret)) { - } else if (OB_FAIL(t3m->del_tablet(key))) { + // Whatever, delete tablet object from map and id set + // del_tablet and erase should swallow any not exist error + if (OB_SUCC(ret)) { + if (OB_FAIL(t3m->del_tablet(key))) { LOG_WARN("failed to delete tablet from t3m", K(ret), K(key)); } else if (OB_FAIL(tablet_id_set_.erase(tablet_id))) { if (OB_HASH_NOT_EXIST == ret) { @@ -903,18 +905,7 @@ int ObTabletCreateDeleteHelper::roll_back_remove_tablet( LOG_WARN("failed to erase tablet id from hash set", K(ret), K(tablet_id)); } } - - if (OB_FAIL(ret)) { - } else if (OB_FAIL(t3m->erase_pinned_tablet(key))) { - if (OB_HASH_NOT_EXIST == ret) { - // tablet id does not exist in tablet handle map - ret = OB_SUCCESS; - } else { - LOG_WARN("failed to erase tablet handle", K(ret), K(tablet_id)); - } - } } - return ret; } @@ -1476,7 +1467,8 @@ int ObTabletCreateDeleteHelper::check_and_get_tablet( int ObTabletCreateDeleteHelper::acquire_tablet( const ObTabletMapKey &key, - ObTabletHandle &handle) + ObTabletHandle &handle, + const bool only_acquire) { int ret = OB_SUCCESS; ObLSHandle ls_handle; @@ -1489,7 +1481,7 @@ int ObTabletCreateDeleteHelper::acquire_tablet( LOG_WARN("invalid arguments", K(ret), K(key)); } else if (OB_FAIL(ls_service->get_ls(key.ls_id_, ls_handle, ObLSGetMod::TABLET_MOD))) { LOG_WARN("failed to get ls", K(ret), "ls_id", key.ls_id_); - } else if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, ls_handle, tablet_handle))) { + } else if (OB_FAIL(t3m->acquire_tablet(WashTabletPriority::WTP_HIGH, key, ls_handle, tablet_handle, only_acquire))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else if (OB_ISNULL(tablet_handle.get_obj())) { ret = OB_ERR_UNEXPECTED; @@ -2310,7 +2302,7 @@ int ObTabletCreateDeleteHelper::do_create_tablet( LOG_WARN("failed to convert_tmp", K(ret), K(scn)); } else if (OB_FAIL(create_scn.convert_tmp(create_ts))) { LOG_WARN("failed to convert_tmp", K(ret), K(create_scn)); - } else if (OB_FAIL(acquire_tablet(key, tablet_handle))) { + } else if (OB_FAIL(acquire_tablet(key, tablet_handle, false/*only acquire*/))) { LOG_WARN("failed to acquire tablet", K(ret), K(key)); } else if (OB_FAIL(check_need_create_empty_major_sstable(table_schema, need_create_empty_major_sstable))) { LOG_WARN("failed to check need create sstable", K(ret)); diff --git a/src/storage/tablet/ob_tablet_create_delete_helper.h b/src/storage/tablet/ob_tablet_create_delete_helper.h index 59f5acee6..2c88e6201 100644 --- a/src/storage/tablet/ob_tablet_create_delete_helper.h +++ b/src/storage/tablet/ob_tablet_create_delete_helper.h @@ -124,7 +124,8 @@ public: const int64_t timeout_us); static int acquire_tablet( const ObTabletMapKey &key, - ObTabletHandle &handle); + ObTabletHandle &handle, + const bool only_acquire = false); static int check_need_create_empty_major_sstable( const share::schema::ObTableSchema &table_schema, bool &need_create_sstable); diff --git a/src/storage/tx/ob_ctx_tx_data.cpp b/src/storage/tx/ob_ctx_tx_data.cpp index 3b48d0695..b3cb25cc6 100644 --- a/src/storage/tx/ob_ctx_tx_data.cpp +++ b/src/storage/tx/ob_ctx_tx_data.cpp @@ -176,6 +176,9 @@ int ObCtxTxData::deep_copy_tx_data_out(ObTxData *&tmp_tx_data) if (OB_FAIL(ret)) { } else if (OB_FAIL(deep_copy_tx_data_(tx_table, tmp_tx_data))) { TRANS_LOG(WARN, "deep copy tx data failed", K(ret), KPC(tmp_tx_data), K(*this)); + } else if (OB_ISNULL(tmp_tx_data)) { + ret = OB_ERR_UNEXPECTED; + TRANS_LOG(WARN, "copied tmp tx data is null", K(ret), K(*this)); } } @@ -345,6 +348,38 @@ ObTransID ObCtxTxData::get_tx_id() const return (NULL != tx_data_ ? tx_data_->tx_id_ : tx_commit_data_.tx_id_); } +int ObCtxTxData::prep_add_undo_action(ObUndoAction &undo_action, + ObTxData *&tmp_ctx_tx_data, + ObTxData *&tmp_tx_data_table_tx_data) { + int ret = OB_SUCCESS; + RLockGuard guard(lock_); + if (OB_FAIL(check_tx_data_writable_())) { + TRANS_LOG(WARN, "tx data is not writeable", K(ret), K(*this)); + } else { + ObTxTable *tx_table = nullptr; + GET_TX_TABLE_(tx_table); + if (OB_FAIL(ret)) { + } else if (OB_FAIL(tx_table->deep_copy_tx_data(tx_data_, tmp_ctx_tx_data))) { + TRANS_LOG(WARN, "copy tx data fail", K(ret), KPC(this)); + } else if (OB_ISNULL(tmp_ctx_tx_data)) { + ret = OB_ERR_UNEXPECTED; + TRANS_LOG(ERROR, "unexpected copy null", KR(ret), KPC(this)); + } else if (OB_FAIL(tmp_ctx_tx_data->add_undo_action(tx_table, undo_action))) { + TRANS_LOG(WARN, "add undo action failed", K(ret), K(undo_action), K(*this)); + } else if (OB_FAIL(tx_table->deep_copy_tx_data(tmp_ctx_tx_data, tmp_tx_data_table_tx_data))) { + TRANS_LOG(WARN, "copy tx data fail", K(ret), KPC(this)); + } else if (OB_ISNULL(tmp_tx_data_table_tx_data)) { + ret = OB_ERR_UNEXPECTED; + TRANS_LOG(ERROR, "unexpected copy null", KR(ret), KPC(this)); + } + if (OB_FAIL(ret)) { + if (tmp_ctx_tx_data) { tx_table->free_tx_data(tmp_ctx_tx_data); } + if (tmp_tx_data_table_tx_data) { tx_table->free_tx_data(tmp_tx_data_table_tx_data); } + } + } + return ret; +} + int ObCtxTxData::add_undo_action(ObUndoAction &undo_action) { int ret = OB_SUCCESS; diff --git a/src/storage/tx/ob_ctx_tx_data.h b/src/storage/tx/ob_ctx_tx_data.h index 5b77ba1f8..18f283f81 100644 --- a/src/storage/tx/ob_ctx_tx_data.h +++ b/src/storage/tx/ob_ctx_tx_data.h @@ -57,6 +57,9 @@ public: ObTransID get_tx_id() const; + int prep_add_undo_action(ObUndoAction &undo_action, + storage::ObTxData *&tmp_ctx_tx_data, + storage::ObTxData *&tmp_tx_data_table_tx_data); int add_undo_action(ObUndoAction &undo_action); int get_tx_data(const storage::ObTxData *&tx_data) const; int get_tx_commit_data(const storage::ObTxCommitData *&tx_commit_data) const; diff --git a/src/storage/tx/ob_trans_define.cpp b/src/storage/tx/ob_trans_define.cpp index 96943fa8c..771fd42c6 100644 --- a/src/storage/tx/ob_trans_define.cpp +++ b/src/storage/tx/ob_trans_define.cpp @@ -1061,5 +1061,24 @@ bool ObMulSourceDataNotifyArg::is_redo_confirmed() const bool ObMulSourceDataNotifyArg::is_redo_synced() const { return redo_synced_; } +const char *trans_type_to_cstr(const TransType &trans_type) +{ + const char *str; + switch (trans_type) { + case TransType::UNKNOWN_TRANS: + str = "UNKNOWN"; + break; + case TransType::SP_TRANS: + str = "SP"; + break; + case TransType::DIST_TRANS: + str = "DIST"; + break; + default: + str = "TX_TYPE_UNKNOWN"; + break; + } + return str; +} } // transaction } // oceanbase diff --git a/src/storage/tx/ob_trans_define.h b/src/storage/tx/ob_trans_define.h index 235469098..11bce7a25 100644 --- a/src/storage/tx/ob_trans_define.h +++ b/src/storage/tx/ob_trans_define.h @@ -430,6 +430,8 @@ enum TransType : int32_t DIST_TRANS = 2 }; +const char *trans_type_to_cstr(const TransType &trans_type); + // class TransType // { // public: diff --git a/src/storage/tx/ob_trans_functor.h b/src/storage/tx/ob_trans_functor.h index 70f8f1c01..e25af4d57 100644 --- a/src/storage/tx/ob_trans_functor.h +++ b/src/storage/tx/ob_trans_functor.h @@ -300,8 +300,6 @@ public: if (!tx_id.is_valid() || OB_ISNULL(tx_ctx)) { ret = common::OB_INVALID_ARGUMENT; TRANS_LOG(WARN, "invalid argument", KR(ret), K(tx_id), "ctx", OB_P(tx_ctx)); - } else if (!tx_ctx->is_for_replay()) { - // do nothing } else { if (OB_FAIL(tx_ctx->replay_start_working_log(start_working_ts_))) { TRANS_LOG(WARN, "replay start working log error", KR(ret), K(tx_id)); diff --git a/src/storage/tx/ob_trans_part_ctx.cpp b/src/storage/tx/ob_trans_part_ctx.cpp index 936897dd7..9d4ddbb1b 100644 --- a/src/storage/tx/ob_trans_part_ctx.cpp +++ b/src/storage/tx/ob_trans_part_ctx.cpp @@ -1565,12 +1565,15 @@ int ObPartTransCtx::on_success(ObTxLogCb *log_cb) // do nothing } else { if (OB_FAIL(on_success_ops_(cur_cb))) { - TRANS_LOG(ERROR, "invoke callback failed", K(ret), K(*this), K(*cur_cb)); + TRANS_LOG(ERROR, "invoke on_success_ops failed", K(ret), K(*this), K(*cur_cb)); if (OB_SUCCESS == save_ret) { save_ret = ret; } // rewrite ret ret = OB_SUCCESS; + + usleep(1000*1000); + ob_abort(); } // ignore ret and set cur_cb callbacked cur_cb->set_callbacked(); @@ -5585,41 +5588,54 @@ int ObPartTransCtx::rollback_to_savepoint_(const int64_t from_scn, /* * Follower: - * 1. insert UndoAction into tx_data_table + * 1. add UndoAction into tx_ctx's tx_data + * 2. insert UndoAction into tx_data_table * Leader: - * 1. submit 'RollbackToLog' if need - * 2. insert UndoAction into tx_data_table after log sync success + * 1. submit 'RollbackToLog' + * 2. add UndoAction into tx_ctx's tx_data + * 3. insert UndoAction into tx_data_table after log sync success */ - if (is_follower_() || OB_UNLIKELY(exec_info_.max_submitted_seq_no_ > to_scn)) { + if (is_follower_()) { /* Follower */ ObUndoAction undo_action(from_scn, to_scn); - // ObTxTable *tx_table = nullptr; ObTxData *tmp_tx_data = nullptr; - // GET_TX_TABLE(tx_table); - if (OB_SUCC(ret)) { - if (OB_FAIL(ctx_tx_data_.add_undo_action(undo_action))) { - TRANS_LOG(WARN, "recrod undo info fail", K(ret), K(from_scn), K(to_scn), KPC(this)); - } else if (OB_FAIL(ctx_tx_data_.deep_copy_tx_data_out(tmp_tx_data))) { - TRANS_LOG(WARN, "deep copy tx data failed", KR(ret), K(*this)); - } else if (OB_ISNULL(tmp_tx_data)) { - ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "unexpected null ptr", KR(ret), K(*this)); - } else if (!is_follower_()) { /* Leader */ - if (OB_FAIL(submit_rollback_to_log_(from_scn, to_scn, tmp_tx_data))) { - TRANS_LOG(WARN, "submit undo redolog fail", K(ret), K(from_scn), K(to_scn), KPC(this)); - int tmp_ret = OB_SUCCESS; - if (OB_SUCCESS != (tmp_ret = ctx_tx_data_.free_tmp_tx_data(tmp_tx_data))) { - TRANS_LOG(WARN, "free tx data failed", KR(tmp_ret), K(*this)); - } - } - } else { /* Follower */ - tmp_tx_data->end_scn_ = exec_info_.max_applying_log_ts_; - if (OB_FAIL(ctx_tx_data_.insert_tmp_tx_data(tmp_tx_data))) { - TRANS_LOG(WARN, "insert to tx table failed", KR(ret), K(*this)); - } else { - tmp_tx_data = nullptr; - } + if (OB_FAIL(ctx_tx_data_.add_undo_action(undo_action))) { + TRANS_LOG(WARN, "recrod undo info fail", K(ret), K(from_scn), K(to_scn), KPC(this)); + } else if (OB_FAIL(ctx_tx_data_.deep_copy_tx_data_out(tmp_tx_data))) { + TRANS_LOG(WARN, "deep copy tx data failed", KR(ret), K(*this)); + } else { + tmp_tx_data->end_scn_ = exec_info_.max_applying_log_ts_; + if (OB_FAIL(ctx_tx_data_.insert_tmp_tx_data(tmp_tx_data))) { + TRANS_LOG(WARN, "insert to tx table failed", KR(ret), K(*this)); + } else { + tmp_tx_data = nullptr; } } + } else if (OB_UNLIKELY(exec_info_.max_submitted_seq_no_ > to_scn)) { /* Leader */ + ObUndoAction undo_action(from_scn, to_scn); + // + // In order to ensure UndoAction can be added to tx_ctx and tx_data_table + // successfully post submit log, prepare two temporary tx_data before + // submitting log + // + ObTxData *tmp_ctx_tx_data = nullptr, *tmp_tx_data_table_tx_data = nullptr; + if (OB_FAIL(ctx_tx_data_.prep_add_undo_action(undo_action, tmp_ctx_tx_data, tmp_tx_data_table_tx_data))) { + TRANS_LOG(WARN, "prepare add undo action fail", K(ret), KPC(this)); + } else if (OB_FAIL(submit_rollback_to_log_(from_scn, to_scn, tmp_tx_data_table_tx_data))) { + // submit log + TRANS_LOG(WARN, "submit undo redolog fail", K(ret), K(from_scn), K(to_scn), KPC(this)); + // release tmp resource + int tmp_ret = OB_SUCCESS; + if (OB_TMP_FAIL(ctx_tx_data_.free_tmp_tx_data(tmp_ctx_tx_data))) { + TRANS_LOG(WARN, "free tmp tx data failed", KR(tmp_ret), KPC(this)); + } + if (OB_TMP_FAIL(ctx_tx_data_.free_tmp_tx_data(tmp_tx_data_table_tx_data))) { + TRANS_LOG(WARN, "free tmp tx data failed", KR(tmp_ret), KPC(this)); + } + } else if (OB_FAIL(ctx_tx_data_.replace_tx_data(tmp_ctx_tx_data))) { + // update tx_ctx's tx_data + TRANS_LOG(ERROR, "oops! replace tx data fail", KR(ret), KPC(this)); + ob_abort(); + } } // step 2: remove TxNode(s) from memtable diff --git a/src/storage/tx/ob_two_phase_committer.h b/src/storage/tx/ob_two_phase_committer.h index f0a442f0d..963319f90 100644 --- a/src/storage/tx/ob_two_phase_committer.h +++ b/src/storage/tx/ob_two_phase_committer.h @@ -343,7 +343,7 @@ private: int decide_downstream_msg_type_(ObTwoPhaseCommitMsgType &msg_type); int retransmit_downstream_msg_(); int retransmit_downstream_msg_(const uint8_t participant); - int retransmit_upstream_msg_(); + int retransmit_upstream_msg_(const ObTxState state); // Because the submit_log may fail, we need retry to submit the log under // exception. diff --git a/src/storage/tx/ob_two_phase_committer_xa.cpp b/src/storage/tx/ob_two_phase_committer_xa.cpp index a8edd4cec..6087f4205 100644 --- a/src/storage/tx/ob_two_phase_committer_xa.cpp +++ b/src/storage/tx/ob_two_phase_committer_xa.cpp @@ -34,12 +34,11 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_redo_request() switch (state) { // TODO, new state may be required (coord state and part state) case ObTxState::INIT: { - if (!is_root()) { - collected_.reset(); - set_upstream_state(ObTxState::REDO_COMPLETE); - } if (OB_FAIL(handle_2pc_prepare_redo_request_impl_())) { TRANS_LOG(WARN, "handle 2pc prepare request failed", K(ret), K(*this)); + } else { + collected_.reset(); + set_upstream_state(ObTxState::REDO_COMPLETE); } break; } @@ -52,7 +51,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_redo_request() } } // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::REDO_COMPLETE))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; @@ -62,7 +61,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_redo_request() TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::REDO_COMPLETE))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; @@ -75,7 +74,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_redo_request() TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::ABORT))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; diff --git a/src/storage/tx/ob_two_phase_downstream_committer.cpp b/src/storage/tx/ob_two_phase_downstream_committer.cpp index f0bde5831..cfb33344d 100644 --- a/src/storage/tx/ob_two_phase_downstream_committer.cpp +++ b/src/storage/tx/ob_two_phase_downstream_committer.cpp @@ -178,19 +178,9 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_request() switch (state) { case ObTxState::INIT: case ObTxState::REDO_COMPLETE: { - const ObTxState old_state = get_upstream_state(); - if (!is_root()) { - collected_.reset(); - set_upstream_state(ObTxState::PREPARE); - } if (OB_FAIL(handle_2pc_prepare_request_impl_())) { TRANS_LOG(WARN, "handle 2pc prepare request failed", K(ret), K(*this)); } - // TODO: improve the code quality - if (OB_FAIL(ret)) { - collected_.reset(); - set_upstream_state(old_state); - } break; } case ObTxState::PREPARE: { @@ -201,27 +191,32 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_request() TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } } - // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::PREPARE))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; } - // TODO, adjust abort case ObTxState::ABORT: { // Txn may go abort itself, so we need reply the response based on the state // to advance the two phase commit protocol as soon as possible if (OB_FAIL(retransmit_downstream_msg_())) { TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } - // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::ABORT))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; } case ObTxState::PRE_COMMIT: - case ObTxState::COMMIT: + case ObTxState::COMMIT: { + if (OB_FAIL(retransmit_downstream_msg_())) { + TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); + } + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::PREPARE))) { + TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); + } + break; + } case ObTxState::CLEAR: { TRANS_LOG(WARN, "handle orphan request, ignore it", K(ret)); @@ -237,11 +232,10 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_request() return ret; } -int ObTxCycleTwoPhaseCommitter::retransmit_upstream_msg_() +int ObTxCycleTwoPhaseCommitter::retransmit_upstream_msg_(const ObTxState state) { int ret = OB_SUCCESS; int tmp_ret = OB_SUCCESS; - const ObTxState state = get_downstream_state(); ObTwoPhaseCommitMsgType msg_type = ObTwoPhaseCommitMsgType::OB_MSG_TX_UNKNOWN; bool need_respond = false; @@ -315,6 +309,8 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_request_impl_() TRANS_LOG(INFO, "committer is under logging", K(ret), K(*this)); } else if (OB_FAIL(do_prepare(no_need_submit_log))) { TRANS_LOG(WARN, "do prepare failed", K(ret), K(*this)); + } else if (FALSE_IT(set_upstream_state(ObTxState::PREPARE))) { + } else if (FALSE_IT(collected_.reset())) { } else if (!no_need_submit_log && OB_TMP_FAIL(submit_log(ObTwoPhaseCommitLogType::OB_LOG_TX_PREPARE))) { if (OB_BLOCK_FROZEN == tmp_ret) { @@ -345,27 +341,16 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_commit_request() } case ObTxState::PREPARE: case ObTxState::PRE_COMMIT: { - const ObTxState old_state = get_upstream_state(); - if (!is_root()) { - set_upstream_state(ObTxState::COMMIT); - collected_.reset(); - } if (OB_FAIL(handle_2pc_commit_request_impl_())) { TRANS_LOG(WARN, "handle 2pc commit request failed", K(ret), K(*this)); } - // TODO: improve the code quality - if (OB_FAIL(ret)) { - collected_.reset(); - set_upstream_state(old_state); - } break; } case ObTxState::COMMIT: { if (OB_FAIL(retransmit_downstream_msg_())) { TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } - // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::COMMIT))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; @@ -396,6 +381,8 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_commit_request_impl_() TRANS_LOG(INFO, "committer is under logging", K(ret), K(*this)); } else if (OB_FAIL(do_commit())) { TRANS_LOG(WARN, "do commit failed", K(ret), K(*this)); + } else if (FALSE_IT(set_upstream_state(ObTxState::COMMIT))) { + } else if (FALSE_IT(collected_.reset())) { } else if (OB_TMP_FAIL(submit_log(ObTwoPhaseCommitLogType::OB_LOG_TX_COMMIT))) { TRANS_LOG(WARN, "submit commit log failed", K(tmp_ret), K(*this)); } else if (!is_root() && !is_leaf()) { @@ -416,17 +403,9 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_abort_request() case ObTxState::INIT: case ObTxState::REDO_COMPLETE: case ObTxState::PREPARE: { - const ObTxState old_state = get_upstream_state(); - set_upstream_state(ObTxState::ABORT); - collected_.reset(); if (OB_FAIL(handle_2pc_abort_request_impl_())) { TRANS_LOG(WARN, "handle 2pc abort request failed", K(ret), K(*this)); } - // TODO: improve the code quality - if (OB_FAIL(ret)) { - collected_.reset(); - set_upstream_state(old_state); - } break; } case ObTxState::PRE_COMMIT: { @@ -451,7 +430,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_abort_request() TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); ret = OB_SUCCESS; } - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::ABORT))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; @@ -479,6 +458,8 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_abort_request_impl_() TRANS_LOG(INFO, "committer is under logging", K(ret), K(*this)); } else if (OB_FAIL(do_abort())) { TRANS_LOG(WARN, "do commit failed", K(ret), K(*this)); + } else if (FALSE_IT(set_upstream_state(ObTxState::ABORT))) { + } else if (FALSE_IT(collected_.reset())) { } else { if (OB_TMP_FAIL(submit_log(ObTwoPhaseCommitLogType::OB_LOG_TX_ABORT))) { TRANS_LOG(WARN, "submit abort log failed", K(tmp_ret), K(*this)); @@ -516,8 +497,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_pre_commit_request() if (OB_FAIL(retransmit_downstream_msg_())) { TRANS_LOG(WARN, "retransmit downstream msg failed", KR(ret)); } - // rewrite ret code - if (OB_FAIL(retransmit_upstream_msg_())) { + if (OB_FAIL(retransmit_upstream_msg_(ObTxState::PRE_COMMIT))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(ret)); } break; @@ -525,6 +505,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_pre_commit_request() case ObTxState::ABORT: { ret = OB_TRANS_PROTOCOL_ERROR; TRANS_LOG(ERROR, "handle 2pc pre commit request find protocol error", K(*this)); + break; } case ObTxState::CLEAR: { TRANS_LOG(WARN, "handle orphan request failed, ignore it", K(ret), K(*this)); @@ -565,25 +546,13 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_clear_request() } case ObTxState::COMMIT: case ObTxState::ABORT: { - const ObTxState old_state = get_upstream_state(); - if (!is_root()) { - set_upstream_state(ObTxState::CLEAR); - collected_.reset(); - } if (OB_FAIL(handle_2pc_clear_request_impl_())) { TRANS_LOG(WARN, "handle 2pc clear request failed", K(ret), K(*this)); } - // TODO: improve the code quality - if (OB_FAIL(ret)) { - collected_.reset(); - set_upstream_state(old_state); - } break; } case ObTxState::CLEAR: { - // if (OB_FAIL(retransmit_msg_(state))) { - // TRANS_LOG(WARN, "retransmit msg failed", K(ret), K(*this)); - // } + TRANS_LOG(WARN, "handle orphan request failed, ignore it", K(ret), K(*this)); break; } default: { @@ -605,6 +574,8 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_clear_request_impl_() TRANS_LOG(INFO, "committer is under logging", K(ret), K(*this)); } else if (OB_FAIL(do_clear())) { TRANS_LOG(WARN, "do commit failed", K(ret), K(*this)); + } else if (FALSE_IT(set_upstream_state(ObTxState::CLEAR))) { + } else if (FALSE_IT(collected_.reset())) { } else if (OB_TMP_FAIL(submit_log(ObTwoPhaseCommitLogType::OB_LOG_TX_CLEAR))) { TRANS_LOG(WARN, "submit clear log failed", K(tmp_ret), K(*this)); } else if (!is_root() && !is_leaf()) { diff --git a/src/storage/tx/ob_two_phase_upstream_committer.cpp b/src/storage/tx/ob_two_phase_upstream_committer.cpp index 494bfee00..29a93e9d1 100644 --- a/src/storage/tx/ob_two_phase_upstream_committer.cpp +++ b/src/storage/tx/ob_two_phase_upstream_committer.cpp @@ -172,7 +172,7 @@ int ObTxCycleTwoPhaseCommitter::handle_timeout() TRANS_LOG(WARN, "retransmit downstream msg failed", KR(tmp_ret)); } - if (!is_root() && OB_TMP_FAIL(retransmit_upstream_msg_())) { + if (!is_root() && OB_TMP_FAIL(retransmit_upstream_msg_(get_downstream_state()))) { TRANS_LOG(WARN, "retransmit upstream msg failed", KR(tmp_ret)); } @@ -269,16 +269,13 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_response(const uint8_t partic switch (get_upstream_state()) { case ObTxState::INIT: - case ObTxState::REDO_COMPLETE: - if (OB_FAIL(do_prepare(no_need_submit_log))) { - TRANS_LOG(WARN, "do prepare failed", K(ret), K(*this)); - } else { - set_upstream_state(ObTxState::PREPARE); - collected_.reset(); + case ObTxState::REDO_COMPLETE: { + if (REACH_TIME_INTERVAL(1 * 1000 * 1000)) { TRANS_LOG(INFO, "recv prepare resp when coord state is init or redo complete", KR(ret), K(participant), K(*this)); } - // go through + break; + } // Because we want to reduce the latency at all costs, we need to handle // prepare response before prepare log successfully synchronized. case ObTxState::PREPARE: { @@ -356,13 +353,11 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_commit_response(const uint8_t partici // and post commit req to all participants. after that root crashed, and // coord_state_ is set to PREPARE(the same as state_), and participants' // commit responses arrive. - if (OB_FAIL(do_commit())) { - TRANS_LOG(WARN, "do commit failed", K(ret), K(*this)); - } else { - set_upstream_state(ObTxState::COMMIT); - collected_.reset(); + if (REACH_TIME_INTERVAL(1 * 1000 * 1000)) { + TRANS_LOG(INFO, "recv commit resp when upstream state is prepare or pre_commit", + KR(ret), K(participant), K(*this)); } - // go through + break; } case ObTxState::COMMIT: { if (OB_FAIL(handle_2pc_ack_response_impl_(participant))) { @@ -546,10 +541,11 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_pre_commit_response(const uint8_t par // and post pre commit req to all participants. after that root crashed, and // coord_state_ is set to PREPARE(the same as state_), and participants' // pre_commit responses - if (OB_FAIL(try_enter_pre_commit_state())) { - TRANS_LOG(WARN, "try enter pre commit state failed", K(ret), K(*this)); + if (REACH_TIME_INTERVAL(1 * 1000 * 1000)) { + TRANS_LOG(INFO, "recv pre_commit resp when upstream state is prepare", + KR(ret), K(participant), K(*this)); } - // go through + break; } case ObTxState::PRE_COMMIT: { if (OB_FAIL(handle_2pc_pre_commit_response_impl_(participant))) { diff --git a/src/storage/tx/ob_tx_data_define.cpp b/src/storage/tx/ob_tx_data_define.cpp index 534d8f26f..ea3746be4 100644 --- a/src/storage/tx/ob_tx_data_define.cpp +++ b/src/storage/tx/ob_tx_data_define.cpp @@ -653,13 +653,15 @@ DEF_TO_STRING(ObUndoStatusNode) void ObTxDataMemtableWriteGuard::reset() { - for (int i = 0; i < handles_.count(); i++) { - if (handles_.at(i).is_valid()) { + for (int i = 0; i < MAX_TX_DATA_MEMTABLE_CNT; i++) { + if (handles_[i].is_valid()) { ObTxDataMemtable *tx_data_memtable = nullptr; - handles_.at(i).get_tx_data_memtable(tx_data_memtable); + handles_[i].get_tx_data_memtable(tx_data_memtable); tx_data_memtable->dec_write_ref(); } + handles_[i].reset(); } + size_ = 0; } } // namespace storage diff --git a/src/storage/tx/ob_tx_data_define.h b/src/storage/tx/ob_tx_data_define.h index 8caf1ce99..9637a3986 100644 --- a/src/storage/tx/ob_tx_data_define.h +++ b/src/storage/tx/ob_tx_data_define.h @@ -122,6 +122,7 @@ static const int TX_DATA_OFFSET_BETWEEN_DATA_AND_SORT_NODE = TX_DATA_SLICE_SIZE - TX_DATA_HASH_NODE_SIZE - TX_DATA_SORT_LIST_NODE_SIZE; // Reserve 5KB to store the fields in tx data except undo_status static const int OB_MAX_TX_SERIALIZE_SIZE = OB_MAX_USER_ROW_LENGTH - 5120; +static const int MAX_TX_DATA_MEMTABLE_CNT = 2; using TxDataHashNode = common::LinkHashNode; using TxDataHashValue = common::LinkHashValue; @@ -428,14 +429,19 @@ private: class ObTxDataMemtableWriteGuard { public: - ObTxDataMemtableWriteGuard() { handles_.reset(); } + ObTxDataMemtableWriteGuard() : size_(0) + { + MEMSET(handles_, 0, MAX_TX_DATA_MEMTABLE_CNT * sizeof(ObTableHandleV2)); + } ~ObTxDataMemtableWriteGuard() { reset(); } void reset(); + TO_STRING_KV(K(size_), K(handles_[0]), K(handles_[1])); + public: - // reserve one slot because there is only one tx data memtable at most of time - ObSEArray handles_; + int64_t size_; + ObTableHandleV2 handles_[MAX_TX_DATA_MEMTABLE_CNT]; }; diff --git a/src/storage/tx_storage/ob_access_service.cpp b/src/storage/tx_storage/ob_access_service.cpp index b2ea5f105..e509e0e83 100644 --- a/src/storage/tx_storage/ob_access_service.cpp +++ b/src/storage/tx_storage/ob_access_service.cpp @@ -212,12 +212,10 @@ int ObAccessService::table_scan( ObTableScanParam ¶m = static_cast(vparam); ObStoreAccessType access_type = param.scan_flag_.is_read_latest() ? ObStoreAccessType::READ_LATEST : ObStoreAccessType::READ; - int64_t user_specified_snapshot = ObAccessTypeCheck::is_read_access_type(access_type) ? - param.fb_snapshot_ : transaction::ObTransVersion::INVALID_TRANS_VERSION; palf::SCN user_specified_snapshot_scn; - if (user_specified_snapshot > 0) { + if (ObAccessTypeCheck::is_read_access_type(access_type) && param.fb_snapshot_.is_valid()) { //todo lixinze:后续会判断是否有效 - user_specified_snapshot_scn.convert_tmp(user_specified_snapshot); + user_specified_snapshot_scn = param.fb_snapshot_; } NG_TRACE(storage_table_scan_begin); if (IS_NOT_INIT) { @@ -289,13 +287,10 @@ int ObAccessService::table_rescan( ObLSTabletService *tablet_service = nullptr; ObStoreAccessType access_type = param.scan_flag_.is_read_latest() ? ObStoreAccessType::READ_LATEST : ObStoreAccessType::READ; - int64_t user_specified_snapshot = ObAccessTypeCheck::is_read_access_type(access_type) ? - param.fb_snapshot_ - : transaction::ObTransVersion::INVALID_TRANS_VERSION; palf::SCN user_specified_snapshot_scn; - if (user_specified_snapshot > 0) { + if (ObAccessTypeCheck::is_read_access_type(access_type) && param.fb_snapshot_.is_valid()) { //todo lixinze:后续会判断是否有效 - user_specified_snapshot_scn.convert_tmp(user_specified_snapshot); + user_specified_snapshot_scn = param.fb_snapshot_; } NG_TRACE(storage_table_scan_begin); if (OB_FAIL(check_read_allowed_(ls_id, @@ -1145,7 +1140,10 @@ int ObAccessService::audit_tablet_opt_dml_stat( const int64_t affected_rows) { int ret = OB_SUCCESS; - if (OB_ISNULL(dml_param.table_param_)) { + static __thread int64_t last_access_ts = 0; + if (ObClockGenerator::getClock() - last_access_ts < 1000000) { + // do nothing + } else if (OB_ISNULL(dml_param.table_param_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret), K(dml_param.table_param_)); } else if (dml_stat_type == ObOptDmlStatType::TABLET_OPT_INSERT_STAT || @@ -1167,6 +1165,7 @@ int ObAccessService::audit_tablet_opt_dml_stat( } else { LOG_TRACE("succeed to update dml stat local cache", K(dml_stat)); } + last_access_ts = ObClockGenerator::getClock(); } return ret; } diff --git a/src/storage/tx_table/ob_tx_data_memtable_mgr.cpp b/src/storage/tx_table/ob_tx_data_memtable_mgr.cpp index b3c592c54..d83072d2f 100644 --- a/src/storage/tx_table/ob_tx_data_memtable_mgr.cpp +++ b/src/storage/tx_table/ob_tx_data_memtable_mgr.cpp @@ -176,6 +176,9 @@ int ObTxDataMemtableMgr::create_memtable_(const palf::SCN clog_checkpoint_scn, i ret = OB_ERR_UNEXPECTED; STORAGE_LOG(ERROR, "table is nullptr", KR(ret), K(handle), KPC(this)); } else if (FALSE_IT(tx_data_memtable = dynamic_cast(table))) { + } else if (OB_ISNULL(tx_data_memtable)) { + ret = OB_ERR_UNEXPECTED; + STORAGE_LOG(ERROR, "dynamic cast failed", KR(ret), KPC(this)); } else if (OB_FAIL(tx_data_memtable->init(table_key, slice_allocator_, this))) { STORAGE_LOG(WARN, "memtable init fail.", KR(ret), KPC(tx_data_memtable)); } else if (OB_FAIL(add_memtable_(handle))) { @@ -227,7 +230,7 @@ int ObTxDataMemtableMgr::freeze_() int64_t schema_version = 1; // FIXME : @gengli remove this condition after upper_trans_version is not needed - if (get_memtable_count_() >= 2) { + if (get_memtable_count_() >= MAX_TX_DATA_MEMTABLE_CNT) { ret = OB_EAGAIN; STORAGE_LOG(INFO, "There is a freezed memetable existed. Try freeze after flushing it.", KR(ret), KPC(this)); } else if (get_memtable_count_() >= MAX_MEMSTORE_CNT) { @@ -354,8 +357,10 @@ int ObTxDataMemtableMgr::get_all_memtables_for_write(ObTxDataMemtableWriteGuard int ret = OB_SUCCESS; TCRLockGuard lock_guard(lock_); for (int i = memtable_head_; OB_SUCC(ret) && i < memtable_tail_; i++) { - auto real_idx = get_memtable_idx_(i); - write_guard.handles_.push_back(memtables_[real_idx]); + int64_t real_idx = get_memtable_idx_(i); + write_guard.handles_[i - memtable_head_].reset(); + write_guard.handles_[i - memtable_head_] = memtables_[real_idx]; + write_guard.size_++; ObTxDataMemtable *tx_data_memtable = nullptr; if (OB_FAIL(memtables_[real_idx].get_tx_data_memtable(tx_data_memtable))) { STORAGE_LOG(ERROR, "get tx data memtable from memtable handle failed", KR(ret), KPC(this)); diff --git a/src/storage/tx_table/ob_tx_data_table.cpp b/src/storage/tx_table/ob_tx_data_table.cpp index e1704bb0c..18510afec 100644 --- a/src/storage/tx_table/ob_tx_data_table.cpp +++ b/src/storage/tx_table/ob_tx_data_table.cpp @@ -109,14 +109,17 @@ int ObTxDataTable::init_tx_data_read_schema_() share::schema::ObColDesc total_row_cnt; total_row_cnt.col_id_ = TOTAL_ROW_CNT; total_row_cnt.col_type_.set_int(); + total_row_cnt.col_order_ = ObOrderType::ASC; share::schema::ObColDesc end_ts; end_ts.col_id_ = END_LOG_TS; end_ts.col_type_.set_int(); + end_ts.col_order_ = ObOrderType::ASC; share::schema::ObColDesc value; value.col_id_ = VALUE; value.col_type_.set_binary(); + value.col_order_ = ObOrderType::ASC; iter_param.table_id_ = 1; iter_param.tablet_id_ = LS_TX_DATA_TABLET; @@ -329,7 +332,7 @@ int ObTxDataTable::insert(ObTxData *&tx_data) STORAGE_LOG(WARN, "get all memtables for write fail.", KR(ret), KPC(get_memtable_mgr_())); } else if (FALSE_IT(tg.click())) { // do nothing - } else if (OB_FAIL(insert_(tx_data, write_guard.handles_))) { + } else if (OB_FAIL(insert_(tx_data, write_guard))) { STORAGE_LOG(WARN, "insert tx data failed.", KR(ret), KPC(tx_data), KP(this), K(tablet_id_)); } else { // STORAGE_LOG(DEBUG, "insert tx data succeed.", KPC(tx_data)); @@ -345,22 +348,23 @@ int ObTxDataTable::insert(ObTxData *&tx_data) // In order to support the commit log without undo actions, the tx data related to a single // transaction may be inserted multiple times. For more details, see // https://yuque.antfin.com/ob/transaction/cdn5ez -int ObTxDataTable::insert_(ObTxData *&tx_data, ObIArray &memtable_handles) +int ObTxDataTable::insert_(ObTxData *&tx_data, ObTxDataMemtableWriteGuard &write_guard) { int ret = OB_SUCCESS; common::ObTimeGuard tg("tx_data_table::insert_", 100 * 1000); ObTxDataMemtable *tx_data_memtable = nullptr; + ObTableHandleV2 (&memtable_handles)[MAX_TX_DATA_MEMTABLE_CNT] = write_guard.handles_; - for (int i = memtable_handles.count() - 1; OB_SUCC(ret) && OB_NOT_NULL(tx_data) && i >= 0; i--) { + for (int i = write_guard.size_ - 1; OB_SUCC(ret) && OB_NOT_NULL(tx_data) && i >= 0; i--) { tx_data_memtable = nullptr; - if (OB_FAIL(memtable_handles.at(i).get_tx_data_memtable(tx_data_memtable))) { + if (OB_FAIL(memtable_handles[i].get_tx_data_memtable(tx_data_memtable))) { ret = OB_ERR_UNEXPECTED; STORAGE_LOG(ERROR, "get tx data memtable from table handles fail.", KR(ret), KP(this), - K(tablet_id_), K(memtable_handles.at(i))); + K(tablet_id_), K(memtable_handles[i])); } else if (OB_ISNULL(tx_data_memtable)) { ret = OB_ERR_UNEXPECTED; STORAGE_LOG(ERROR, "tx data memtable is nullptr.", KR(ret), KP(this), K(tablet_id_), - K(memtable_handles.at(i))); + K(memtable_handles[i])); } else if (OB_UNLIKELY(ObTxDataMemtable::State::RELEASED == tx_data_memtable->get_state())) { ret = OB_ERR_UNEXPECTED; STORAGE_LOG(ERROR, diff --git a/src/storage/tx_table/ob_tx_data_table.h b/src/storage/tx_table/ob_tx_data_table.h index a69cc6bd1..4dca16239 100644 --- a/src/storage/tx_table/ob_tx_data_table.h +++ b/src/storage/tx_table/ob_tx_data_table.h @@ -217,9 +217,6 @@ public: // ObTxDataTable K_(is_started), K_(min_start_scn_in_ctx), K_(last_update_min_start_scn_ts), - K_(self_freeze_min_limit_cnt), - K_(self_freeze_max_limit_cnt), - K_(self_freeze_tenant_remain_limit_size), K_(tablet_id), KP_(ls), KP_(ls_tablet_svr), @@ -249,7 +246,7 @@ private: int get_tx_data_in_sstable_(const transaction::ObTransID tx_id, ObTxData *&tx_data); - int insert_(ObTxData *&tx_data, ObIArray &memtable_handles); + int insert_(ObTxData *&tx_data, ObTxDataMemtableWriteGuard &write_guard); int insert_into_memtable_(ObTxDataMemtable *tx_data_memtable, ObTxData *&tx_data); @@ -320,9 +317,6 @@ private: bool is_started_; palf::SCN min_start_scn_in_ctx_; int64_t last_update_min_start_scn_ts_; - int64_t self_freeze_min_limit_cnt_; - int64_t self_freeze_max_limit_cnt_; - int64_t self_freeze_tenant_remain_limit_size_; ObTabletID tablet_id_; ObMemAttr mem_attr_; // Allocator to allocate ObTxData and ObUndoStatus diff --git a/src/storage/tx_table/ob_tx_table.cpp b/src/storage/tx_table/ob_tx_table.cpp index 8ba2faa18..e8be9ebfd 100644 --- a/src/storage/tx_table/ob_tx_table.cpp +++ b/src/storage/tx_table/ob_tx_table.cpp @@ -740,10 +740,12 @@ int ObTxTable::restore_tx_ctx_table_(ObITable &trans_sstable) share::schema::ObColDesc meta; meta.col_id_ = common::OB_APP_MIN_COLUMN_ID + 1; meta.col_type_.set_binary(); + meta.col_order_ = ObOrderType::ASC; share::schema::ObColDesc value; value.col_id_ = common::OB_APP_MIN_COLUMN_ID + 2; value.col_type_.set_binary(); + value.col_order_ = ObOrderType::ASC; ObTableIterParam iter_param; iter_param.tablet_id_ = LS_TX_CTX_TABLET; diff --git a/src/storage/tx_table/ob_tx_table_interface.h b/src/storage/tx_table/ob_tx_table_interface.h index 0fe824254..670a83131 100644 --- a/src/storage/tx_table/ob_tx_table_interface.h +++ b/src/storage/tx_table/ob_tx_table_interface.h @@ -28,7 +28,7 @@ public: ObTxTableGuard() : tx_table_(nullptr), epoch_(-1) {} ~ObTxTableGuard() { reset(); } - ObTxTableGuard(const ObTxTableGuard &guard) { *this = guard; } + ObTxTableGuard(const ObTxTableGuard &guard) : ObTxTableGuard() { *this = guard; } ObTxTableGuard &operator=(const ObTxTableGuard &guard) { diff --git a/strip2ce b/strip2ce deleted file mode 100755 index 33a158f85..000000000 --- a/strip2ce +++ /dev/null @@ -1,1630 +0,0 @@ -#!/usr/bin/python -# coding=utf8 -''' -# name: strip2ce -# author: 千三 -# doc: https: https://yuque.antfin.com/docs/share/a24792b6-95f7-4a44-89cb-dd5f9bc59a58?# -''' -import os -import sys -import getopt -import threading -import datetime -import time -import subprocess -import signal -import uuid -import re -import shutil -import json -import socket -from copy import copy - -reload(sys) -sys.setdefaultencoding('utf8') - -# 全局停止标志 -GLBOAL_STOP_FLAG = False -# 全局日志锁,避免日志串行 -GLOBAL_PRINT_LOCK = threading.Lock() -# 统计开始时间 -GLOBAL_START_TIME = datetime.datetime.now() - -# 所有源码文件 -all_source_files = [] - -# 所有删除的文件 -source_del_files = [] -# cmake 要删除的文件 -cmake_del_files = [] -# 空文件 -empty_del_files = [] - -# 检查模式下使用 -all_need_cpp_file_list = [] -# 原来是空文件夹记录,用于对比裁剪之后是文件夹情况 -ori_empty_dir_list = [] - -# 进度信息 -GLBOAL_PROCESS_LOCK = threading.Lock() -GLOBAL_CUR_COUNT = 0 -GLOBAL_ALL_COUNT = 0 - -final_result = dict() - -class ERROR_CODE(): - ''' - 错误码 - ''' - # 通用成功和失败 - COMMON_SUCCESS = 0 - COMMON_ERROR = 1 - - BAD_FILE = 2 - - # 脚本内部错误 - SCRIPT_INTERNAL_ERROR = 21 - -class SOURCE_RANGE(): - ''' - 源码范围 - ''' - COMMON = "COMMON" - OPENSOURCE = "OPENSO" - BUSINESS = "BUSINE" - BORDER = "BORDER" - -class RUN_MODE(): - ''' - 运行模式 - ''' - STRIP_MODE = "裁剪模式" - CHECK_MODE = "检查模式" - SOURCE_DEBUG_MODE = "单个文件调试模式" - -class TEXT_STRIP_TYPE(): - ''' - 核心文本裁剪模式 - ''' - NOTE_MODE = "note类型裁剪" - CMAKE_MODE = "cmake类型裁剪" - CPP_MODE = "cpp类型裁剪" - -class GlobalConf(): - ''' - 编译配置类 - ''' - def __init__(self): - # 基础信息 - self.tool_bin = "strip2ce" - self.tool_name = "strip2ce OB开源代码裁剪工具" - # 版本号 - self.version = "1.1 Beta" - # 构建日志 - self.buildtime = "20221010" - - # 帮助链接 - self.help_link = "https://yuque.antfin.com/docs/share/a24792b6-95f7-4a44-89cb-dd5f9bc59a58?#" - self.auther = "千三" - - # 当前运行模式 - self.run_mode = RUN_MODE.STRIP_MODE - - # 调试类型 - self.debug_source = "" - self.debug_type = "" - self.nosave = False - - # 输入的traceid - self.traceid = "%s" % uuid.uuid1() - - # 后端请求地址 - self.api_url = "http://ob-make.oceanbase-dev.com:8000/obbuild/api/v1" - - # 工作目录文件 - self.git_top_dir = "" - - # 并发数 - self.jobs = 32 - # 并发控制 - self.semaphore = threading.Semaphore(self.jobs) - - # 是否开启调试 - self.enable_debug = False - - # 总共步骤数量 - self.total_step_count = 8 - # 当前步骤数量 - self.cuurent_step_count = 0 - - # 常见后缀 - self.cmake_type_suffix = ("CMakeLists.txt", ".cmake") - self.cpp_type_suffix = (".c", ".cc", ".ipp", ".hpp", ".cpp", ".cxx", ".h", ".h.in", ".cpp.in", ".hxx", ".lxx") - self.note_type_suffix = ("CMakeLists.txt", ".cmake", ".c", ".cc", ".ipp", ".hpp", ".cpp", ".cxx", ".h", ".h.in", ".cpp.in", ".hxx", ".lxx", ".sh", ".bash", ".deps", ".opensource", "hotfuncs.txt", ".py", ".y", ".l", ".map", "ld.lds") - # 忽略后缀 - self.ignore_suffix = (".git", ".dep_create", "build_", "deps/3rd", ".ccls-cache") - -GLOBAL_CONF = GlobalConf() - -def touch_dir(target_file): - ''' - 根据目录或者文件名字,创建目录 - ''' - true_target_dir = target_file - if not os.path.isdir(target_file): - true_target_dir = os.path.dirname(target_file) - - if os.path.exists(true_target_dir): - # 已经存在就不再创建 - return - os.makedirs(true_target_dir) - -def write_json_file(file_path, json_dict): - ''' - 写入json文件 - ''' - result = dict() - result['return_code'] = ERROR_CODE.COMMON_ERROR - result['return_message'] = "" - - try: - with open(file_path, 'w') as fd: - fd.writelines(json.dumps(json_dict)) - except BaseException as ex: - print_log(ex) - result['return_code'] = ERROR_CODE.BAD_FILE - result['return_message'] = "%s 写入json失败, err:%s" % (file_path, ex) - return result - - result['return_code'] = ERROR_CODE.COMMON_SUCCESS - result['return_message'] = "ok" - return result - -def shell_run_command(command_str, need_print_all=True, need_print_output=True, no_time=False): - ''' - 运行shell命令 - ''' - if need_print_all: - print_log("[运行命令]: %s" % command_str) - if not need_print_output: - print_log("[运行输出]: 日志过多已经忽略输出") - result = dict() - result["return_code"] = 1 - result["return_message"] = [] - is_frist = False - ps = subprocess.Popen(command_str, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - shell=True, - close_fds=True) - while True: - data = ps.stdout.readline() - if data == b'': - if ps.poll() is not None: - break - result["return_message"].append(data) - - if not need_print_all: - continue - - if need_print_output and len(data.strip()) > 1: - if not is_frist: - print_log("[运行输出]: %s" % data.replace("\n", "")) - is_frist = True - else: - data_str = " %s" % data.replace("\n", "") - if no_time: - print(data_str) - else: - print_log(" %s" % data.replace("\n", "")) - - result["return_code"] = ps.returncode - return result - -def ctrl_c_handler(signum, frame): - ''' - 处理ctrl+c信号 - ''' - global GLBOAL_STOP_FLAG - if GLBOAL_STOP_FLAG: - print("正在退出,请稍等...") - return - - print("\n\n手动终止停止,正在平滑退出,请稍等...") - GLBOAL_STOP_FLAG = True - - sys.stdout.flush() - exit(ERROR_CODE.COMMON_ERROR) - -def div_operator(num1, num2): - ''' - 除法运算,方便除0 - ''' - if num2 == 0: - return 0 - - return 1.0 * num1 / num2 - -def get_cost_time(): - ''' - 获取当前运行时间 - ''' - global GLOBAL_START_TIME - cost_time_sec = (datetime.datetime.now() - GLOBAL_START_TIME).seconds - return "%dm%.2ds" % (cost_time_sec / 60, cost_time_sec % 60) - -def get_cost_time_ms(): - ''' - 获取毫秒时间 - ''' - global GLOBAL_START_TIME - return (datetime.datetime.now() - GLOBAL_START_TIME).seconds * 1000 - -def print_log(log_str): - ''' - 打印日志函数 - ''' - global GLOBAL_PRINT_LOCK - global GLBOAL_STOP_FLAG - GLOBAL_PRINT_LOCK.acquire() - if not GLBOAL_STOP_FLAG: - print("[%s %s] %s" % (time.strftime("%m-%d %H:%M:%S", time.localtime()), get_cost_time(), log_str)) - sys.stdout.flush() - GLOBAL_PRINT_LOCK.release() - -def print_new_line(): - ''' - 打印新一行 - ''' - print_log("") - -def print_link_url(): - ''' - 打印帮助信息 - ''' - print_new_line() - print_log("问题咨询: %s" % GLOBAL_CONF.auther) - print_log("帮助文档: %s" % ((GLOBAL_CONF.help_link))) - -def print_help(): - ''' - 打印帮助信息 - ''' - print("Usage: %s [optional arg], default in STRIP_MODE" % (GLOBAL_CONF.tool_bin)) - print("Options:") - print("\t-h, --help print this message and exit") - print("\t-v, --version print the version number and exit") - print("\t--check run in CHECK_MODE") - print("\t-s, --source run in SOURCE_DEBUG_MODE") - print("\t-t, --type debug type, support cpp, cmake, note, no input will by suffix") - print("\t--nosave no save file for CHECK_MODE and SOURCE_DEBUG_MODE") - - print("Exeamle:") - print("\t ./%s" % GLOBAL_CONF.tool_bin) - print("\t ./%s --check" % GLOBAL_CONF.tool_bin) - print("\t ./%s -s src/observer/main.cpp" % GLOBAL_CONF.tool_bin) - print("\t ./%s -s src/observer/main.cpp -t note" % GLOBAL_CONF.tool_bin) - - print_new_line() - print("关键中文说明:") - print("\t1. %s是OB开源代码裁剪工具,通过该命令可以将内外一套代码裁剪成纯开源代码" % (GLOBAL_CONF.tool_bin)) - print("\t2. %s支持三种模式,默认是[%s],还支持[%s]和[%s]" % (GLOBAL_CONF.tool_bin, RUN_MODE.STRIP_MODE, RUN_MODE.CHECK_MODE, RUN_MODE.SOURCE_DEBUG_MODE)) - print("\t3. [%s]将检查裁剪之后,编译所需要的所有文件是否存在,只有都在才是一个合理的裁剪" % (RUN_MODE.CHECK_MODE)) - print("\t4. [%s]可以单独调试某一个裁剪文本的情况,默认会根据后缀进行判断,也可以通过-t强行指定类型" % (RUN_MODE.SOURCE_DEBUG_MODE)) - - print_link_url() - -def print_bar(): - ''' - 打印欢迎内容 - ''' - print( - """ - __ ** ___ - _____ / /_ _____ __ ____ |__ \ _____ ___ - / ___/ / __/ / ___/ / / / __ \ __/ / / ___/ / _ \\ - (__ ) / /_ / / / / / /_/ / / __/ / /__ / __/ - /____/ \__/ /_/ /_/ / ____/ /____/ \___/ \___/ - /_/ -""") - -def get_flag(cmd, str_prefix): - ''' - 获得编译参数 例如获取 -c后面一个参数 - ''' - if " %s " % str_prefix not in cmd: - return "" - command_list = cmd.split(" ") - for i in range(len(command_list)): - if command_list[i].strip() == str_prefix: - if i + 1 < len(command_list): - return command_list[i + 1].strip() - return "" - -def parse_arg(): - ''' - 解析命令行参数 - ''' - global GLOBAL_CONF - - try: - # sys.argv[1:] 过滤掉第一个参数(它是脚本名称,不是参数的一部分) - opts, args = getopt.getopt(sys.argv[1:], "hvs:t:", ["help", "version", "source=", "type=", "check", "nosave"]) - - if args: - print_log("不符合预期输入,请重试\n") - print_help() - exit(ERROR_CODE.COMMON_ERROR) - - for cmd, arg in opts: - if cmd in ("-h", "--help"): - print_help() - exit(ERROR_CODE.COMMON_SUCCESS) - elif cmd in ("-v", "--version"): - print_log("version %s (build%s)\n" % (GLOBAL_CONF.version, GLOBAL_CONF.buildtime)) - print_link_url() - exit(ERROR_CODE.COMMON_SUCCESS) - elif cmd in ("-s", "--source"): - GLOBAL_CONF.run_mode = RUN_MODE.SOURCE_DEBUG_MODE - GLOBAL_CONF.debug_source = arg.strip() - elif cmd in("-t", "--type"): - if arg == "cpp": - GLOBAL_CONF.debug_type = TEXT_STRIP_TYPE.CPP_MODE - elif arg == "cmake": - GLOBAL_CONF.debug_type = TEXT_STRIP_TYPE.CMAKE_MODE - elif arg == "note": - GLOBAL_CONF.debug_type = TEXT_STRIP_TYPE.NOTE_MODE - else: - print_log("未知调试类型输入[%s], 仅支持 cpp, cmake 和 note" % (arg)) - exit(ERROR_CODE.COMMON_ERROR) - elif cmd in ("--check"): - GLOBAL_CONF.run_mode = RUN_MODE.CHECK_MODE - elif cmd in ("--nosave"): - GLOBAL_CONF.nosave = True - - except getopt.GetoptError as ex: - print_log("getopt.GetoptError 解析参数失败,请合法输入, %s" % ex) - print_link_url() - exit(ERROR_CODE.COMMON_ERROR) - except ValueError as ex: - print_log("ValueError 解析参数失败,请合法输入, %s" % ex) - print_link_url() - exit(ERROR_CODE.COMMON_ERROR) - -def handle_one_cmake_file(cmake_src, cmake_opensource_src = None): - ''' - 处理cmake文件 - ''' - lines = None - with open(cmake_src, "r") as fd: - lines = fd.readlines() - - if not cmake_opensource_src: - cmake_opensource_src = cmake_src - - line_dict_list = [] - # 本次算法都是 一遍 扫描 不进行回溯 - for line in lines: - line_dict = dict() - line_dict['code'] = line - line_dict['levels'] = [] - line_dict['ranges'] = [] - line_dict_list.append(line_dict) - - now_levels = ["bk"] - now_ranges = [SOURCE_RANGE.COMMON] - - for line_dict in line_dict_list: - # 如果是if开始 - if "if(" in line_dict["code"].replace(" ", "") and "endif" not in line_dict["code"]: - - now_levels.append("if") - if "if(OB_BUILD_OPENSOURCE)" in line_dict["code"].replace(" ", ""): - # 特殊 OB_BUILD_OPENSOURCE 逻辑开始 - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif "if(NOTOB_BUILD_OPENSOURCE)" in line_dict["code"].replace(" ", "") or "if(notOB_BUILD_OPENSOURCE)" in line_dict["code"].replace(" ", ""): - # 特殊处理 OB_BUILD_OPENSOURCE 否定逻辑 - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - # 其他if逻辑 - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif "else()" in line_dict["code"]: - # if层次pop出 - now_levels.pop() - now_levels.append("else") - - # 根据if逻辑,切换逻辑 - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif "endif()" in line_dict["code"]: - now_levels.pop() - - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(latest_range) - line_dict['ranges'] = copy(now_ranges) - now_ranges.pop() - else: - # 处理unity的情况 - if "ob_set_subtarget(" in line_dict["code"]: - now_levels.append("unity") - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif now_levels[-1] == "unity": - if "OPENSOURCE:" in line_dict["code"]: - now_ranges.pop() - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif "BUSINESS:" in line_dict["code"]: - now_ranges.pop() - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - - elif "COMMON:" in line_dict["code"]: - now_ranges.pop() - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif ")" in line_dict["code"]: - now_levels.pop() - now_ranges.pop() - line_dict['ranges'] = copy(now_ranges) - else: - line_dict['ranges'] = copy(now_ranges) - else: - # 其他情况,范围进行拷贝 - line_dict['ranges'] = copy(now_ranges) - - line_dict['levels'] = copy(now_levels) - - if GLOBAL_CONF.run_mode == RUN_MODE.SOURCE_DEBUG_MODE: - for line_dict in line_dict_list: - show_content = "|{:30}|{:30}|{:100}" - print(show_content.format(" ".join(line_dict['levels']), " ".join(line_dict['ranges']), line_dict["code"].replace("\n", ""))) - - # 如果不保存 - if GLOBAL_CONF.nosave: - return - - opensource_need_files = [] - only_business_files = [] - - touch_dir(cmake_opensource_src) - - file_line_list_temp = [] - for line_dict in line_dict_list: - need_ok = True - for one_range in line_dict['ranges']: - if one_range == SOURCE_RANGE.BORDER: - need_ok = False - break - if one_range == SOURCE_RANGE.BUSINESS: - need_ok = False - break - if need_ok: - file_line_list_temp.append(line_dict["code"]) - - target_file = os.path.join(os.path.dirname(cmake_opensource_src), line_dict["code"].strip()) - if os.path.exists(target_file): - opensource_need_files.append(target_file) - else: - # 从cmake中统计商业版本中 不需要的 - if SOURCE_RANGE.BORDER not in line_dict['ranges']: - target_file = os.path.join(os.path.dirname(cmake_opensource_src), line_dict["code"].strip()) - if os.path.exists(target_file): - only_business_files.append(target_file) - - # 处理空的 ob_set_target() - file_line_list_last = [] - need_jump = False - for index in range(len(file_line_list_temp)): - if "ob_set_subtarget(" in file_line_list_temp[index] and index + 1 < len(file_line_list_temp) and ")" in file_line_list_temp[index + 1]: - need_jump = True - else: - if need_jump: - need_jump = False - else: - file_line_list_last.append(file_line_list_temp[index]) - - # 写入文件 - with open(cmake_opensource_src, "w") as fd: - for one in file_line_list_last: - fd.writelines(one) - - for one_business_file in only_business_files: - if one_business_file not in opensource_need_files: - cmake_del_files.append(one_business_file) - - # 跟随删除同名头文件 - #for suffix in (".cpp", ".c", ".cc"): - # if one_business_file.endswith(suffix): - # header_file = one_business_file.replace(suffix, ".h") - # if os.path.exists(header_file): - # cmake_del_files.append(header_file) - - -def handle_one_cpp_file(cpp_src, cpp_opensource_src = None): - ''' - 处理cpp文件 - ''' - global empty_del_files - - # 原来是否为空文件 - is_before_empty_file = True - # 最终是否为空文件 - is_after_empty_file = True - - lines = None - with open(cpp_src, "r") as fd: - lines = fd.readlines() - - for line in lines: - if line.strip(): - # 原来不是空文件 - is_before_empty_file = False - break - - if not cpp_opensource_src: - cpp_opensource_src = cpp_src - - line_dict_list = [] - # 本次算法都是 一遍 扫描 不进行回溯 - for line in lines: - line_dict = dict() - line_dict['code'] = line - line_dict['levels'] = [] - line_dict['ranges'] = [] - line_dict_list.append(line_dict) - - now_levels = ["bk"] - now_ranges = [SOURCE_RANGE.COMMON] - - for line_dict in line_dict_list: - # 如果是if开始 - if "#ifdef" in line_dict["code"].replace(" ", "") or "#ifndef" in line_dict["code"].replace(" ", "") or "#if" in line_dict["code"].replace(" ", ""): - now_levels.append("if") - if "#ifdefOB_BUILD_OPENSOURCE" in line_dict["code"].replace(" ", ""): - # 特殊处理 OB_BUILD_OPENSOURCE 逻辑开始 - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif "#ifndefOB_BUILD_OPENSOURCE" in line_dict["code"].replace(" ", ""): - # 特殊处理 OB_BUILD_OPENSOURCE 否定逻辑 - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - # 其他if逻辑 - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif "#else" in line_dict["code"].replace(" ", ""): - # if层次pop出 - now_levels.pop() - now_levels.append("else") - - # 根据if逻辑,切换逻辑 - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif "#endif" in line_dict["code"].replace(" ", ""): - now_levels.pop() - - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(latest_range) - line_dict['ranges'] = copy(now_ranges) - now_ranges.pop() - else: - # 其他情况,范围进行拷贝 - line_dict['ranges'] = copy(now_ranges) - - line_dict['levels'] = copy(now_levels) - - if GLOBAL_CONF.run_mode == RUN_MODE.SOURCE_DEBUG_MODE: - for line_dict in line_dict_list: - show_content = "|{:30}|{:30}|{:100}" - print(show_content.format(" ".join(line_dict['levels']), " ".join(line_dict['ranges']), line_dict["code"].replace("\n", ""))) - - # 如果不保存 - if GLOBAL_CONF.nosave: - return - - # 保存文件 - touch_dir(cpp_opensource_src) - with open(cpp_opensource_src, "w") as fd: - for line_dict in line_dict_list: - need_ok = True - for one_range in line_dict['ranges']: - if one_range == SOURCE_RANGE.BORDER: - need_ok = False - break - if one_range == SOURCE_RANGE.BUSINESS: - need_ok = False - break - if need_ok: - fd.writelines(line_dict["code"]) - - if is_after_empty_file and line_dict["code"].strip(): - is_after_empty_file = False - - if not is_before_empty_file: - if is_after_empty_file: - empty_del_files.append(cpp_opensource_src) - -def handle_one_note_file(file_src, file_opensource_src=None): - ''' - 处理note文件 - ''' - lines = None - with open(file_src, "r") as fd: - lines = fd.readlines() - - if not file_opensource_src: - file_opensource_src = file_src - - line_dict_list = [] - # 本次算法都是 一遍 扫描 不进行回溯 - for line in lines: - line_dict = dict() - line_dict['code'] = line - line_dict['levels'] = [] - line_dict['ranges'] = [] - line_dict_list.append(line_dict) - - now_levels = ["bk"] - now_ranges = [SOURCE_RANGE.COMMON] - - # 有可能是[#](bash/python),[//](cpp) - note_prefix = '' - - for line_dict in line_dict_list: - # 如果是if开始 - if "RANGE_IF" in line_dict["code"].replace(" ", ""): - now_levels.append("start") - if "RANGE_IF_OPENSOURCE" in line_dict["code"].replace(" ", ""): - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif "RANGE_IF_BUSINESS" in line_dict["code"].replace(" ", ""): - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - # 其他if逻辑 - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - # 寻找前缀 - if not note_prefix: - note_prefix = line_dict["code"].split("RANGE_IF")[0] - - elif "RANGE_ELSE" in line_dict["code"].replace(" ", ""): - # if层次pop出 - now_levels.pop() - now_levels.append("else") - - # 根据if逻辑,切换逻辑 - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - now_ranges.append(SOURCE_RANGE.BUSINESS) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - now_ranges.append(SOURCE_RANGE.OPENSOURCE) - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(SOURCE_RANGE.COMMON) - line_dict['ranges'] = copy(now_ranges) - - elif "RANGE_END" in line_dict["code"].replace(" ", ""): - now_levels.pop() - - latest_range = now_ranges.pop() - if latest_range == SOURCE_RANGE.OPENSOURCE: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - elif latest_range == SOURCE_RANGE.BUSINESS: - line_dict['ranges'] = [SOURCE_RANGE.BORDER] - else: - now_ranges.append(latest_range) - line_dict['ranges'] = copy(now_ranges) - now_ranges.pop() - else: - # 其他情况,范围进行拷贝 - line_dict['ranges'] = copy(now_ranges) - - line_dict['levels'] = copy(now_levels) - - if GLOBAL_CONF.run_mode == RUN_MODE.SOURCE_DEBUG_MODE: - for line_dict in line_dict_list: - show_content = "|{:30}|{:30}|{:100}" - print(show_content.format(" ".join(line_dict['levels']), " ".join(line_dict['ranges']), line_dict["code"].replace("\n", ""))) - - # 如果不保存 - if GLOBAL_CONF.nosave: - return - - # 保存文件 - touch_dir(file_opensource_src) - with open(file_opensource_src, "w") as fd: - for line_dict in line_dict_list: - need_ok = True - # 特殊标记是否是opensource,去掉前缀 - is_opensource = False - for one_range in line_dict['ranges']: - if one_range == SOURCE_RANGE.OPENSOURCE: - is_opensource = True - - if one_range == SOURCE_RANGE.BORDER: - need_ok = False - break - if one_range == SOURCE_RANGE.BUSINESS: - need_ok = False - break - - if need_ok: - if is_opensource and note_prefix: - if line_dict["code"].startswith(note_prefix): - fd.writelines(line_dict["code"][len(note_prefix):]) - else: - fd.writelines(line_dict["code"]) - -def load_sub_dir_file(dir_path): - ''' - 递归加载文件 - ''' - global all_source_files - sub_files = [] - - if not os.path.exists(dir_path): - return [] - - if os.path.isdir(dir_path): - # 忽略一些文件 - for one_ignore in GLOBAL_CONF.ignore_suffix: - if one_ignore in dir_path: - return [] - # 传入文件夹 - lst = os.listdir(dir_path) - for one_file in lst: - if(os.path.isdir(os.path.join(dir_path, one_file))): - sub_files.append({"type":'dir', "name": one_file, "base":dir_path, "sub": load_sub_dir_file(os.path.join(dir_path, one_file))}) - else: - file_type_dict = {"type":'file', "name": one_file, "base":dir_path, "sub": []} - sub_files.append(file_type_dict) - # .git 不要 - if ".git" not in one_file: - all_source_files.append(os.path.join(dir_path, one_file)) - else: - # 传入文件 - return [] - - return sub_files - - -def load_all_dir_file(dir_path): - ''' - 递归加载文件 - ''' - global source_del_files - sub_files = [] - - if not os.path.exists(dir_path): - return [] - - if os.path.isdir(dir_path): - # 传入文件夹 - lst = os.listdir(dir_path) - for one_file in lst: - if(os.path.isdir(os.path.join(dir_path, one_file))): - sub_files.append({"type":'dir', "name": one_file, "base":dir_path, "sub": load_all_dir_file(os.path.join(dir_path, one_file))}) - else: - file_type_dict = {"type":'file', "name": one_file, "base":dir_path, "sub": []} - sub_files.append(file_type_dict) - source_del_files.append(os.path.join(dir_path, one_file)) - else: - # 传入文件 - return [] - - return sub_files - -def is_suffix(file_name, suffix_list): - ''' - 判断文件后缀 - ''' - for one_suffix in suffix_list: - if file_name.endswith(one_suffix): - return True - # 未匹配成功 - return False - -def print_stage(str_stage): - ''' - 打印阶段 - ''' - all_len = 100 - str_len = len(str_stage.decode("utf-8")) - padding = (all_len - str_len) / 2 - mat = "{:%d}{:%d}{:%d}" % (padding, str_len, padding) - print_new_line() - print_log(mat.format(">" * padding, str_stage, "<" * padding)) - -def global_exit(result): - ''' - 全局退出函数 - ''' - global final_result - - final_result['return_code'] = result['return_code'] - final_result['return_message'] = result['return_message'] - # 统计时间 - final_result["cost_time"] = get_cost_time() - final_result["cost_time_ms"] = get_cost_time_ms() - - print_log("traceid: %s" % (GLOBAL_CONF.traceid)) - - # 请求数据 - post_final_result() - - print_link_url() - - print_new_line() - - print_log("return code: %d, cost time: %s" %((result['return_code'], get_cost_time()))) - exit(result['return_code']) - -def show_relative_path(path): - ''' - 显示相对路径 - ''' - return path.replace(GLOBAL_CONF.git_top_dir, "") - -def init_workspace_stage(): - ''' - 初始化工作目录 - ''' - global GLOBAL_CONF - global ori_empty_dir_list - global final_result - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 初始化构建环境" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - need_check_file = True - - if GLOBAL_CONF.run_mode == RUN_MODE.SOURCE_DEBUG_MODE: - # 调试模式不检查 - need_check_file = False - - # 获取根目录 - result = shell_run_command("git rev-parse --show-toplevel 2>/dev/null") - if result['return_code'] != 0: - print_log("[ERROR] 初始化工作目录失败,您当前不在git目录,请在OB的git目录运行") - global_exit(stage_result) - - GLOBAL_CONF.git_top_dir = result['return_message'][0].strip() - - if need_check_file: - # 当前工程不运行有git diff和未提交文件,否则退出 - print_log("开始检查当前目录是否存在uncommit文件") - result = shell_run_command("cd %s && git diff HEAD --name-only" % (GLOBAL_CONF.git_top_dir)) - if result['return_code'] != ERROR_CODE.COMMON_SUCCESS: - print_log("[WARNING] 运行git diff HEAD --name-only命令失败,请检查git目录是否完整") - stage_result["return_message"] = "failed to [run git diff HEAD --name-only]" - global_exit(stage_result) - - if type(result["return_message"]) == list: - for one_diff_file in result["return_message"]: - one_diff_file = one_diff_file.strip() - print_log("开始二次校验文件[%s]是否修改" %one_diff_file) - if os.path.exists(os.path.join(GLOBAL_CONF.git_top_dir, one_diff_file)): - stage_result['return_message'] = "exist uncommit files" - print_log("[ERROR] 您的工程下面有未提交文件,当前[%s]下,防止源码丢失不允许进行开源裁剪,请commit后重试" % GLOBAL_CONF.run_mode) - global_exit(stage_result) - - print_log("判断当前工程是否存在.4_ce") - if not os.path.isfile(os.path.join(GLOBAL_CONF.git_top_dir, ".4_ce")): - stage_result['return_message'] = "not exist .4_ce" - print_log("[ERROR] 当前工程不存在[.4_ce]文件,判定为不属于4.0开源代码项目,无法进行裁剪" % GLOBAL_CONF.run_mode) - global_exit(stage_result) - - # 获取commit信息 - print_log("获取commit提交信息:") - result = shell_run_command("git rev-parse HEAD") - if result['return_code'] != 0: - print_log("[ERROR] 获取commit基础信息失败") - stage_result["return_message"] = "failed to get commit info" - global_exit(stage_result) - final_result["commitid"] = result['return_message'][0].strip() - - result = shell_run_command("git show -s %s --pretty=format:'<%%an> (%%ci) %%d %%s'" % final_result["commitid"]) - if result['return_code'] != 0: - print_log("[ERROR] 获取commit基础信息失败") - stage_result["return_message"] = "failed to get commit info" - global_exit(stage_result) - final_result["commit_info"] = result['return_message'][0].strip() - - print_log("开始递归当前文件夹所有文件") - load_sub_dir_file(GLOBAL_CONF.git_top_dir) - print_log("所有文件个数: %d" % len(all_source_files)) - - # 记录原来是空文件 - for one in all_source_files: - if os.path.isdir(one): - if not os.listdir(one): - ori_empty_dir_list.append(one) - -def del_close_sources_file_stage(): - ''' - 删除CLOSE_SOURCES文件 - ''' - global source_del_files - global all_source_files - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 根据CLOSE_SOURCES删除非开源代码" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - CLOSE_SOURCES_file_path = os.path.join(GLOBAL_CONF.git_top_dir, "CLOSE_SOURCES") - - if not os.path.isfile(CLOSE_SOURCES_file_path): - print_log("%s不存在,请提供该文件" % CLOSE_SOURCES_file_path) - global_exit(stage_result) - - lines = [] - with open(CLOSE_SOURCES_file_path, "r") as fd: - lines = fd.readlines() - - close_sources_file_list = [] - for line in lines: - line = line.strip() - if line: - # 不处理注释 - if "#" not in line: - close_sources_file_list.append(line) - else: - line_array = line.split("#") - if line_array and line_array[0]: - close_sources_file_list.append(line_array[0]) - - for one_business in close_sources_file_list: - absolute_path = os.path.join(GLOBAL_CONF.git_top_dir, one_business) - if "**" in absolute_path: - if os.path.isdir(absolute_path.replace("**", "")): - source_del_files.append(absolute_path.replace("**", "")) - - p = absolute_path.replace(".", "\.").replace("**", ".*") - for one_all_file in all_source_files: - result = re.match(p, one_all_file) - if result: - source_del_files.append(one_all_file) - - elif "*" in absolute_path: - if os.path.isdir(absolute_path.replace("*", "")): - source_del_files.append(absolute_path.replace("*", "")) - - p = absolute_path.replace(".", "\.").replace("*", ".*") - for one_all_file in all_source_files: - - result = re.match(p, one_all_file) - if result: - # * 需要层级匹配 - if len(one_all_file.split("/")) == len(absolute_path.split("/")): - source_del_files.append(one_all_file) - else: - if os.path.exists(absolute_path): - if os.path.isfile(absolute_path): - source_del_files.append(absolute_path) - else: - load_all_dir_file(absolute_path) - - # 先删除文件夹 - print_log("开始删除文件夹") - del_dir_count = 0 - for one in source_del_files: - if os.path.exists(one): - if os.path.isdir(one): - del_dir_count += 1 - print_log("开始删除文件夹: %d. %s" % (del_dir_count, one)) - shutil.rmtree(one) - - # 再删除文件 - del_file_count = 0 - print_log("开始删除文件") - for one in source_del_files: - if os.path.exists(one): - del_file_count += 1 - print_log("开始删除文件: %d. %s" % (del_file_count ,one)) - os.remove(one) - -def replace_opensource_file_stage(): - ''' - 替换.opensource后缀文件 - 例如存在 readme.txt readme.txt.opensource 文件 - 会执行 - mv readme.txt.opensource readme.txt - ''' - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 替换.opensource后缀文件" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - print_log("开始替换开源文件") - repalce_count = 0 - for one in all_source_files: - if is_suffix(one, (".opensource",)) and os.path.exists(one): - file_opensource_suffix = one - file_last = one.replace(".opensource", "") - repalce_count += 1 - print_log("替换文件 %d. %s -> %s" % (repalce_count, file_opensource_suffix, file_last)) - shell_run_command("rm -rf %s && mv %s %s" % (file_last, file_opensource_suffix, file_last)) - -def del_cmake_files_stage(): - ''' - 删除cmake中BUSINESS类型文件 - ''' - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 删除cmake中BUSINESS类型文件阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - del_count = 0 - for one in cmake_del_files: - if os.path.exists(one): - del_count += 1 - print_log("开始删除文件: %d. %s" % (del_count ,one)) - os.remove(one) - -def del_empty_files_stage(): - ''' - 删除空文件,例如头文件中的大宏 - ''' - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 删除删除空文件和文件夹阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - del_count = 0 - print_log("开始删除空文件(裁剪之前非空)") - for one in empty_del_files: - if os.path.exists(one): - del_count += 1 - print_log("删除空文件: %d. %s" % (del_count, one)) - os.remove(one) - - print_log("开始删除空文件夹(裁剪之前非空)") - for one in all_source_files: - if os.path.isdir(one): - if not os.listdir(one) and one not in ori_empty_dir_list: - del_count += 1 - print_log("删除空文件夹: %d. %s" % (del_count, one)) - os.rmdir(one) - -def handle_note_files_stage(): - ''' - 执行note类型裁剪 - ''' - global all_source_files - - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] Note类型裁剪阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - all_need_files = [] - - for one_file in all_source_files: - # 处理文件的注释 - if not os.path.isfile(one_file): - continue - - if not is_suffix(one_file, GLOBAL_CONF.note_type_suffix): - continue - - all_need_files.append(one_file) - - for cur_index, one_file in enumerate(all_need_files): - print_log("%d/%d %.2f%% Note类型裁剪 %s" % (cur_index, len(all_need_files), 100 * div_operator(cur_index, len(all_need_files)), one_file)) - handle_one_note_file(one_file) - -def handle_cmake_files_stage(): - ''' - 处理cmake文件 - ''' - global all_source_files - global GLOBAL_CONF - - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] cmake类型裁剪阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - all_need_files = [] - - for one_file in all_source_files: - # 处理文件的注释 - if not os.path.isfile(one_file): - continue - if is_suffix(one_file, GLOBAL_CONF.cmake_type_suffix): - all_need_files.append(one_file) - - for cur_index, one_file in enumerate(all_need_files): - print_log("%d/%d cmake类型裁剪 %.2f%% %s" % (cur_index, len(all_need_files), 100 * div_operator(cur_index, len(all_need_files)), one_file)) - handle_one_cmake_file(one_file) - -def handle_cpp_files_stage(): - ''' - 处理cpp文件 - ''' - global all_source_files - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] cpp类型裁剪阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - all_need_files = [] - - for one_file in all_source_files: - # 处理文件的注释 - if not os.path.isfile(one_file): - continue - - if is_suffix(one_file, GLOBAL_CONF.cpp_type_suffix): - all_need_files.append(one_file) - - for cur_index, one_file in enumerate(all_need_files): - print_log("%d/%d cpp类型裁剪 %.2f%% %s" % (cur_index, len(all_need_files), 100 * div_operator(cur_index, len(all_need_files)), one_file)) - handle_one_cpp_file(one_file) - -def run_strip_mode(): - ''' - 裁剪模式 - ''' - global GLOBAL_CONF - - mode_result = dict() - mode_result["return_code"] = ERROR_CODE.COMMON_ERROR - mode_result["return_message"] = "" - - GLOBAL_CONF.total_step_count = 8 - - # 初始化工程 - init_workspace_stage() - - # 根据CLOSE_SOURCES删除文件 - del_close_sources_file_stage() - - # 替换.opensource后缀文件 - replace_opensource_file_stage() - - # 删除注释 - handle_note_files_stage() - - # 核心文本裁剪:处理cmake文件 - handle_cmake_files_stage() - - # 核心文本裁剪:处理cpp源文件 - handle_cpp_files_stage() - - # 删除cmake中不需要的cpp文件 - del_cmake_files_stage() - - # 删除cpp宏定义处理后的空文件 - del_empty_files_stage() - - print_new_line() - print_log("裁剪成功!这将是一份用于开源的代码了!") - print_new_line() - - mode_result["return_code"] = ERROR_CODE.COMMON_SUCCESS - mode_result["return_message"] = "strip success" - global_exit(mode_result) - -def trigger_one_build(one_compile): - ''' - 触发一个编译任务 - ''' - global GLOBAL_CONF - global GLBOAL_STOP_FLAG - global GLOBAL_CUR_COUNT - global GLOBAL_ALL_COUNT - # 通过semaphore限制并发数 - GLOBAL_CONF.semaphore.acquire() - if not GLBOAL_STOP_FLAG: - cpp_file = get_flag(one_compile, "-c") - workspace = one_compile.split("&&")[0].replace("cd", "").strip() - md_file = get_flag(one_compile, "-MF") - - pre_one_compile = one_compile.strip().replace(" -c ", " -E ").replace(" -MD ", " -MMD ") - - result = shell_run_command(pre_one_compile, need_print_all=False) - - GLBOAL_PROCESS_LOCK.acquire() - - GLOBAL_CUR_COUNT += 1 - print_log("%d/%d %.2f%% 收集所需文件 %s" % (GLOBAL_CUR_COUNT, GLOBAL_ALL_COUNT, 100 * div_operator(GLOBAL_CUR_COUNT, GLOBAL_ALL_COUNT), get_flag(one_compile, "-c"))) - md_file_path = os.path.join(workspace, md_file) - file_lines = None - with open(md_file_path, "r") as fd: - file_lines = fd.readlines() - - for one in file_lines: - one = one.strip() - if ": " in one: - one = one.split(":")[1] - - cpp_file = one.replace("\\", "").strip() - - # 一行可能包含多个文件,空格分隔 - cpp_file_oneline_list = [] - if " " in cpp_file: - cpp_file_oneline_list.extend(cpp_file.split(" ")) - else: - cpp_file_oneline_list.append(cpp_file) - - for one_cpp_file in cpp_file_oneline_list: - if not one_cpp_file.strip(): - continue - # 过滤目录 - if "/deps/3rd/" in one_cpp_file: - continue - if "/build_debug" in one_cpp_file: - continue - - if one_cpp_file not in all_need_cpp_file_list: - all_need_cpp_file_list.append(one_cpp_file) - GLBOAL_PROCESS_LOCK.release() - - GLOBAL_CONF.semaphore.release() - -def collect_need_files_stage(): - ''' - 收集所有编译文件阶段 - ''' - global all_need_cpp_file_list - global GLOBAL_ALL_COUNT - - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 收集所有编译文件阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - result = shell_run_command("cd %s && rm -rf build_debug && sh build.sh debug --ce --init" % (GLOBAL_CONF.git_top_dir)) - if result["return_code"] != ERROR_CODE.COMMON_SUCCESS: - print_log(result['return_message']) - print_log("[ERROR] 运行编译依赖初始化失败") - global_exit(stage_result) - - result = shell_run_command("cd %s/build_debug && make observer --just-print --ignore-errors" % (GLOBAL_CONF.git_top_dir), need_print_output=False) - if result["return_code"] != ERROR_CODE.COMMON_SUCCESS: - print_log(result['return_message']) - print_log("[ERROR] 生成编译命令失败") - global_exit(stage_result) - - all_compile_command_list = result['return_message'] - real_compile_command_list = [] - for one_compile in all_compile_command_list: - # 仅测试编译阶段 - if " -c " not in one_compile: - continue - if ".S" in one_compile: - continue - - real_compile_command_list.append(one_compile) - - print_log("开始预处理") - GLOBAL_ALL_COUNT = len(real_compile_command_list) - thread_list = list() - for one_compile in real_compile_command_list: - t = threading.Thread(target=trigger_one_build,args=(one_compile, )) - thread_list.append(t) - t.start() - - # 等待并发结束 - for t in thread_list: - t.join() - -def check_need_files_stage(): - ''' - 最后检查文件情况 - ''' - global all_need_cpp_file_list - global final_result - - stage_result = dict() - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - stage_result["return_message"] = "" - - GLOBAL_CONF.cuurent_step_count += 1 - print_stage(" [stage %d/%d] 收集所有编译文件阶段" % (GLOBAL_CONF.cuurent_step_count, GLOBAL_CONF.total_step_count)) - print_log("函数:%s 行号:%d" % (sys._getframe().f_code.co_name, sys._getframe().f_lineno)) - time.sleep(1) - - print_log("开始检查编译所需的文件丢失情况") - miss_count = 0 - for one in all_need_cpp_file_list: - if not os.path.exists(one): - miss_count += 1 - print_log("编译所需文件已丢失 %d. %s " % (miss_count, one)) - - # 恢复代码变更 - if GLOBAL_CONF.nosave: - print_new_line() - print_log("开始恢复代码") - shell_run_command("cd %s && git checkout ." % (GLOBAL_CONF.git_top_dir)) - - final_result["all_need_file_count"] = len(all_need_cpp_file_list) - final_result["miss_file_count"] = miss_count - - print_new_line() - if miss_count > 0: - print_log("[ERROR]总共编译所需%d个文件,丢失文件%d个,丢失率%.2f%%,请检查相关规则文件" % (len(all_need_cpp_file_list), miss_count, 100 * div_operator(miss_count, len(all_need_cpp_file_list)))) - stage_result["return_message"] = "check %d files miss" % miss_count - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - print_new_line() - print_log("若在farm上失败,如何本地复现: 在根目录运行 ./%s --check" % GLOBAL_CONF.tool_bin) - print_new_line() - global_exit(stage_result) - else: - print_log("总共总共编译所需%d个文件均存在" % (len(all_need_cpp_file_list))) - - # 测试跑一把 生成cmake文件 - print_log("开始最后测试生成makefile能否成功") - result = shell_run_command("cd %s && sh build.sh clean && sh build.sh --init" % (GLOBAL_CONF.git_top_dir)) - if result["return_code"] != ERROR_CODE.COMMON_SUCCESS: - print_log("[ERROR] 检查失败,生成Makefile不成功,将根据日志检查文件情况") - stage_result["return_message"] = "generate Makefile failed" - stage_result["return_code"] = ERROR_CODE.COMMON_ERROR - print_new_line() - print_log("若在farm上失败,如何本地复现: 在根目录运行 ./%s --check" % GLOBAL_CONF.tool_bin) - print_new_line() - global_exit(stage_result) - -def run_check_mode(): - ''' - 检查模式 - ''' - global GLOBAL_CONF - global all_source_files - - mode_result = dict() - mode_result["return_code"] = ERROR_CODE.COMMON_ERROR - mode_result["return_message"] = "" - - GLOBAL_CONF.total_step_count = 10 - - # 初始化 - init_workspace_stage() - - # 收集所有文件 - collect_need_files_stage() - - # 根据CLOSE_SOURCES删除文件 - del_close_sources_file_stage() - - # 替换.opensource后缀文件 - replace_opensource_file_stage() - - # 删除注释 - handle_note_files_stage() - - # 核心文本裁剪:处理cmake文件 - handle_cmake_files_stage() - - # 核心文本裁剪:处理cpp源文件 - handle_cpp_files_stage() - - # 删除cmake中不需要的cpp文件 - del_cmake_files_stage() - - # 删除cpp宏定义处理后的空文件 - del_empty_files_stage() - - # 最后检查文件情况 - check_need_files_stage() - - print_log("检查成功! 编译所有文件都未丢失") - - print_new_line() - - mode_result["return_code"] = ERROR_CODE.COMMON_SUCCESS - global_exit(mode_result) - -def source_debug_mode(): - ''' - 源码调试模式 - ''' - global GLOBAL_CONF - global all_source_files - - mode_result = dict() - mode_result["return_code"] = ERROR_CODE.COMMON_ERROR - mode_result["return_message"] = "" - - GLOBAL_CONF.total_step_count = 3 - - init_workspace_stage() - - debug_count = 0 - - if "./" in GLOBAL_CONF.debug_source: - GLOBAL_CONF.debug_source = GLOBAL_CONF.debug_source.replace("./", GLOBAL_CONF.git_top_dir + "/") - - for one in all_source_files: - if one.endswith(GLOBAL_CONF.debug_source): - debug_count += 1 - current_type = GLOBAL_CONF.debug_type - if not current_type: - if is_suffix(one, GLOBAL_CONF.cmake_type_suffix): - current_type = TEXT_STRIP_TYPE.CMAKE_MODE - elif is_suffix(one, GLOBAL_CONF.cpp_type_suffix): - current_type = TEXT_STRIP_TYPE.CPP_MODE - elif is_suffix(one, GLOBAL_CONF.note_type_suffix): - current_type = TEXT_STRIP_TYPE.NOTE_MODE - else: - print_log("未知类型,按照note类型,%s" % one) - current_type = TEXT_STRIP_TYPE.NOTE_MODE - - print_new_line() - print_log("%s %d. %s" % (current_type, debug_count, one)) - if current_type == TEXT_STRIP_TYPE.CMAKE_MODE: - handle_one_cmake_file(one) - elif current_type == TEXT_STRIP_TYPE.CPP_MODE: - handle_one_cpp_file(one) - elif current_type == TEXT_STRIP_TYPE.NOTE_MODE: - handle_one_note_file(one) - - mode_result['return_message'] = "debug source: %s" % (GLOBAL_CONF.debug_source) - if debug_count == 0: - print_log("[ERROR] 输入的条件[%s],没有找到匹配到任何源文件,请重试" % (GLOBAL_CONF.debug_source)) - else: - mode_result["return_code"] = ERROR_CODE.COMMON_SUCCESS - - global_exit(mode_result) - -def post_final_result(): - ''' - 保存结果数据,用于hook数据 - ''' - global final_result - global GLOBAL_CONF - - # 替换username为git用户 - if not final_result['username']: - final_result['username'] = final_result['commit_info'].split('>')[0].replace("<", "") - - # 填充username为空的情况 - if not final_result['hostname']: - final_result['hostname'] = socket.gethostname() - - result_json_file_path = "%s/strip2ce_result.json" % GLOBAL_CONF.git_top_dir - - save_result = write_json_file(result_json_file_path, final_result) - if save_result['return_code'] != ERROR_CODE.COMMON_SUCCESS: - print_log("[WARNING] failed to genreate result.json") - return - - # 发送请求到后端 - result = shell_run_command("curl -X 'POST' '%s/strip2ce/send/%s/' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'file=@%s;type=application/json' " - % (GLOBAL_CONF.api_url, GLOBAL_CONF.traceid, result_json_file_path), need_print_all=False) - - if result["return_code"] != ERROR_CODE.COMMON_SUCCESS: - print_log("[WARNING] failed to post data to backend") - - # 删除json文件 - shell_run_command("rm -rf %s" % result_json_file_path, need_print_all=False) - -def main(): - ''' - main函数入口 - ''' - global GLOBAL_CONF - global final_result - - # 初始化返回结果 - final_result['return_code'] = ERROR_CODE.COMMON_ERROR - final_result['return_message'] = "" - final_result['traceid'] = GLOBAL_CONF.traceid - final_result['username'] = os.getenv("USER") - final_result["hostname"] = os.getenv("HOSTNAME") - final_result["commitid"] = "" - final_result["commit_info"] = "" - # check mode field - # 所有需要的文件 - final_result['all_need_file_count'] = 0 - # 丢失文件 - final_result['miss_file_count'] = 0 - - print_bar() - - parse_arg() - - # 平滑退出 - signal.signal(signal.SIGINT, ctrl_c_handler) - - print_log("欢迎使用[%s] 版本V%s build%s @%s" % (GLOBAL_CONF.tool_name, \ - GLOBAL_CONF.version, \ - GLOBAL_CONF.buildtime, \ - GLOBAL_CONF.auther)) - - print_log("当前运行模式: [%s]" % GLOBAL_CONF.run_mode) - - final_result['run_mode'] = GLOBAL_CONF.run_mode - - if GLOBAL_CONF.run_mode == RUN_MODE.STRIP_MODE: - run_strip_mode() - elif GLOBAL_CONF.run_mode == RUN_MODE.CHECK_MODE: - run_check_mode() - elif GLOBAL_CONF.run_mode == RUN_MODE.SOURCE_DEBUG_MODE: - source_debug_mode() - else: - pass - -if __name__ == '__main__': - ''' - __main__入口 - ''' - main() diff --git a/tools/deploy/mysql_test/test_suite/px/r/mysql/alloc_material_for_producer_consumer_schedule_mode.result b/tools/deploy/mysql_test/test_suite/px/r/mysql/alloc_material_for_producer_consumer_schedule_mode.result index a3739b92c..095a809d5 100644 --- a/tools/deploy/mysql_test/test_suite/px/r/mysql/alloc_material_for_producer_consumer_schedule_mode.result +++ b/tools/deploy/mysql_test/test_suite/px/r/mysql/alloc_material_for_producer_consumer_schedule_mode.result @@ -63,113 +63,102 @@ Outputs & filters: explain select /*+ use_px parallel(2) use_merge(a b) */ b.c2, sum(a.c3) from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1 group by 1; Query Plan -====================================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------------- -|0 |PX COORDINATOR | |1 |49 | -|1 | EXCHANGE OUT DISTR |:EX10003|1 |49 | -|2 | HASH GROUP BY | |1 |49 | -|3 | EXCHANGE IN DISTR | |2 |49 | -|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|2 |48 | -|5 | MATERIAL | |2 |48 | -|6 | HASH GROUP BY | |2 |48 | -|7 | MERGE JOIN | |1 |47 | -|8 | EXCHANGE IN MERGE SORT DISTR | |1 |25 | -|9 | EXCHANGE OUT DISTR (BROADCAST) |:EX10001|1 |24 | -|10| MATERIAL | |1 |24 | -|11| SUBPLAN SCAN |a |1 |24 | -|12| MERGE GROUP BY | |1 |24 | -|13| EXCHANGE IN MERGE SORT DISTR| |2 |24 | -|14| EXCHANGE OUT DISTR (HASH) |:EX10000|2 |24 | -|15| MERGE GROUP BY | |2 |23 | -|16| SORT | |1 |23 | -|17| PX BLOCK ITERATOR | |1 |23 | -|18| TABLE SCAN |t1 |1 |23 | -|19| SORT | |1 |23 | -|20| PX BLOCK ITERATOR | |1 |23 | -|21| TABLE SCAN |b |1 |23 | -====================================================================== +================================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +------------------------------------------------------------------ +|0 |PX COORDINATOR | |1 |49 | +|1 | EXCHANGE OUT DISTR |:EX10003|1 |49 | +|2 | HASH GROUP BY | |1 |48 | +|3 | EXCHANGE IN DISTR | |2 |48 | +|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|2 |48 | +|5 | HASH GROUP BY | |2 |47 | +|6 | SUBPLAN SCAN |VIEW1 |1 |47 | +|7 | MERGE GROUP BY | |1 |47 | +|8 | SORT | |1 |47 | +|9 | MERGE JOIN | |1 |47 | +|10| SORT | |1 |24 | +|11| EXCHANGE IN DISTR | |1 |24 | +|12| EXCHANGE OUT DISTR (HASH)|:EX10000|1 |24 | +|13| PX BLOCK ITERATOR | |1 |23 | +|14| TABLE SCAN |b |1 |23 | +|15| SORT | |1 |24 | +|16| EXCHANGE IN DISTR | |1 |24 | +|17| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |24 | +|18| PX BLOCK ITERATOR | |1 |23 | +|19| TABLE SCAN |t1 |1 |23 | +================================================================== Outputs & filters: ------------------------------------- - 0 - output([INTERNAL_FUNCTION(b.c2, T_FUN_SUM(T_FUN_SUM(a.c3)))]), filter(nil), rowset=256 - 1 - output([INTERNAL_FUNCTION(b.c2, T_FUN_SUM(T_FUN_SUM(a.c3)))]), filter(nil), rowset=256, dop=2 - 2 - output([b.c2], [T_FUN_SUM(T_FUN_SUM(a.c3))]), filter(nil), rowset=256, - group([b.c2]), agg_func([T_FUN_SUM(T_FUN_SUM(a.c3))]) - 3 - output([b.c2], [T_FUN_SUM(a.c3)]), filter(nil), rowset=256 - 4 - (#keys=1, [b.c2]), output([b.c2], [T_FUN_SUM(a.c3)]), filter(nil), rowset=256, dop=2 - 5 - output([b.c2], [T_FUN_SUM(a.c3)]), filter(nil), rowset=256 - 6 - output([b.c2], [T_FUN_SUM(a.c3)]), filter(nil), rowset=256, - group([b.c2]), agg_func([T_FUN_SUM(a.c3)]) - 7 - output([b.c2], [a.c3]), filter(nil), rowset=256, - equal_conds([a.c1 = b.c1]), other_conds(nil) - 8 - output([a.c1], [a.c3]), filter(nil), rowset=256, sort_keys([a.c1, ASC]) - 9 - output([a.c1], [a.c3]), filter(nil), rowset=256, dop=2 - 10 - output([a.c1], [a.c3]), filter(nil), rowset=256 - 11 - output([a.c1], [a.c3]), filter(nil), rowset=256, - access([a.c1], [a.c3]) - 12 - output([t1.c1], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256, - group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]) - 13 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, sort_keys([t1.c1, ASC], [t1.c2, ASC]) - 14 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2 - 15 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, - group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)]) - 16 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, sort_keys([t1.c1, ASC], [t1.c2, ASC]) - 17 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 18 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 0 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256 + 1 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256, dop=2 + 2 - output([VIEW1.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))]), filter(nil), rowset=256, + group([VIEW1.b.c2]), agg_func([T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))]) + 3 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256 + 4 - (#keys=1, [VIEW1.b.c2]), output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256, dop=2 + 5 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256, + group([VIEW1.b.c2]), agg_func([T_FUN_SUM(VIEW1.a.c3)]) + 6 - output([VIEW1.b.c2], [VIEW1.a.c3]), filter(nil), rowset=256, + access([VIEW1.b.c2], [VIEW1.a.c3]) + 7 - output([b.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, + group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)]) + 8 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC]) + 9 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256, + equal_conds([t1.c1 = b.c1]), other_conds(nil) + 10 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, sort_keys([b.c1, ASC]) + 11 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256 + 12 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, dop=2 + 13 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256 + 14 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256, + access([b.__pk_increment], [b.c1], [b.c2]), partitions(p0) + 15 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC]) + 16 - output([t1.c2], [t1.c1]), filter(nil), rowset=256 + 17 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2 + 18 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 19 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 19 - output([b.c2], [b.c1]), filter(nil), rowset=256, sort_keys([b.c1, ASC]) - 20 - output([b.c1], [b.c2]), filter(nil), rowset=256 - 21 - output([b.c1], [b.c2]), filter(nil), rowset=256, - access([b.c1], [b.c2]), partitions(p0) explain select /*+ use_px parallel(2) use_merge(a b) */ * from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1; Query Plan -================================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |PX COORDINATOR | |1 |50 | -|1 | EXCHANGE OUT DISTR |:EX10002|1 |49 | -|2 | MERGE JOIN | |1 |48 | -|3 | EXCHANGE IN MERGE SORT DISTR | |1 |25 | -|4 | EXCHANGE OUT DISTR (BROADCAST) |:EX10001|1 |25 | -|5 | MATERIAL | |1 |25 | -|6 | SUBPLAN SCAN |a |1 |25 | -|7 | MERGE GROUP BY | |1 |25 | -|8 | EXCHANGE IN MERGE SORT DISTR| |2 |25 | -|9 | EXCHANGE OUT DISTR (HASH) |:EX10000|2 |24 | -|10| MERGE GROUP BY | |2 |23 | -|11| SORT | |1 |23 | -|12| PX BLOCK ITERATOR | |1 |23 | -|13| TABLE SCAN |t1 |1 |23 | -|14| SORT | |1 |23 | -|15| PX BLOCK ITERATOR | |1 |23 | -|16| TABLE SCAN |b |1 |23 | -================================================================= +============================================================= +|ID|OPERATOR |NAME |EST. ROWS|COST| +------------------------------------------------------------- +|0 |PX COORDINATOR | |1 |49 | +|1 | EXCHANGE OUT DISTR |:EX10002|1 |48 | +|2 | MERGE GROUP BY | |1 |47 | +|3 | SORT | |1 |47 | +|4 | MERGE JOIN | |1 |47 | +|5 | SORT | |1 |24 | +|6 | EXCHANGE IN DISTR | |1 |24 | +|7 | EXCHANGE OUT DISTR (HASH)|:EX10000|1 |24 | +|8 | PX BLOCK ITERATOR | |1 |23 | +|9 | TABLE SCAN |b |1 |23 | +|10| SORT | |1 |24 | +|11| EXCHANGE IN DISTR | |1 |24 | +|12| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |24 | +|13| PX BLOCK ITERATOR | |1 |23 | +|14| TABLE SCAN |t1 |1 |23 | +============================================================= Outputs & filters: ------------------------------------- - 0 - output([INTERNAL_FUNCTION(a.c1, a.c2, a.c3, b.c1, b.c2, b.c3)]), filter(nil), rowset=256 - 1 - output([INTERNAL_FUNCTION(a.c1, a.c2, a.c3, b.c1, b.c2, b.c3)]), filter(nil), rowset=256, dop=2 - 2 - output([a.c1], [b.c1], [a.c2], [a.c3], [b.c2], [b.c3]), filter(nil), rowset=256, - equal_conds([a.c1 = b.c1]), other_conds(nil) - 3 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, sort_keys([a.c1, ASC]) - 4 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, dop=2 - 5 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256 - 6 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, - access([a.c1], [a.c2], [a.c3]) - 7 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256, - group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]) - 8 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, sort_keys([t1.c1, ASC], [t1.c2, ASC]) - 9 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2 - 10 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, - group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)]) - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, sort_keys([t1.c1, ASC], [t1.c2, ASC]) - 12 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 13 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256 + 1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256, dop=2 + 2 - output([t1.c2], [T_FUN_COUNT(*)], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, + group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)]) + 3 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC]) + 4 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, + equal_conds([t1.c1 = b.c1]), other_conds(nil) + 5 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.c1, ASC]) + 6 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256 + 7 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, dop=2 + 8 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256 + 9 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, + access([b.__pk_increment], [b.c1], [b.c2], [b.c3]), partitions(p0) + 10 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC]) + 11 - output([t1.c2], [t1.c1]), filter(nil), rowset=256 + 12 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2 + 13 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 14 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 14 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.c1, ASC]) - 15 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256 - 16 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, - access([b.c1], [b.c2], [b.c3]), partitions(p0) diff --git a/tools/deploy/mysql_test/test_suite/transformer/r/mysql/transformer_outer_join_simplification.result b/tools/deploy/mysql_test/test_suite/transformer/r/mysql/transformer_outer_join_simplification.result index 0ed32be72..b3f36c444 100644 --- a/tools/deploy/mysql_test/test_suite/transformer/r/mysql/transformer_outer_join_simplification.result +++ b/tools/deploy/mysql_test/test_suite/transformer/r/mysql/transformer_outer_join_simplification.result @@ -173,18 +173,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 not between 1 and 2)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -196,13 +196,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 < 1 OR v.c2 > 2], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 not between 1 and 2)); EXPLAIN select stddev(c2) from t1; @@ -281,18 +281,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 not between 1 and 2)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -303,13 +303,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 < 1 OR v.c2 > 2], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 not between 1 and 2)); EXPLAIN select stddev(c2) from t1; @@ -515,18 +515,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 <=> null)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |0 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |0 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -538,13 +538,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 <=> NULL], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 <=> null)); EXPLAIN select stddev(c2) from t1; @@ -625,18 +625,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 <=> null)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |0 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |0 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -647,13 +647,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 <=> NULL], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (v.c2 <=> null)); EXPLAIN select stddev(c2) from t1; @@ -851,18 +851,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and ((v.c2 + 2 > 1) + 2 < 0)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -874,13 +874,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 + 2 > 1 + 2 < 0], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and ((v.c2 + 2 > 1) + 2 < 0)); EXPLAIN select stddev(c2) from t1; @@ -959,18 +959,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and ((v.c2 + 2 > 1) + 2 < 0)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -981,13 +981,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([v.c2 + 2 > 1 + 2 < 0], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and ((v.c2 + 2 > 1) + 2 < 0)); EXPLAIN select stddev(c2) from t1; @@ -1307,7 +1307,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------- |0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | +|1 | SUBPLAN FILTER | |1 |138 | |2 | TABLE SCAN |t1 |1 |46 | |3 | MERGE OUTER JOIN| |1 |92 | |4 | TABLE SCAN |t2 |6 |46 | @@ -1537,18 +1537,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (not((1 + 2 > v.c2) and false))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -1560,13 +1560,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([(T_OP_IS, v.c2, NULL, 0)], [1 + 2 <= v.c2 OR (T_OP_NOT, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (not((1 + 2 > v.c2) and false))); EXPLAIN select stddev(c2) from t1; @@ -1647,18 +1647,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (not((1 + 2 > v.c2) and false))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -1669,13 +1669,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([(T_OP_IS, v.c2, NULL, 0)], [1 + 2 <= v.c2 OR (T_OP_NOT, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (not((1 + 2 > v.c2) and false))); EXPLAIN select stddev(c2) from t1; @@ -1995,7 +1995,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------- |0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | +|1 | SUBPLAN FILTER | |1 |138 | |2 | TABLE SCAN |t1 |1 |46 | |3 | MERGE OUTER JOIN| |1 |92 | |4 | TABLE SCAN |t2 |6 |46 | @@ -2217,18 +2217,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > v.c2)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -2240,13 +2240,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([1 + 2 > v.c2], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > v.c2)); EXPLAIN select stddev(c2) from t1; @@ -2325,18 +2325,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > v.c2)); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -2347,13 +2347,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([1 + 2 > v.c2], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > v.c2)); EXPLAIN select stddev(c2) from t1; @@ -2559,18 +2559,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -2582,13 +2582,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([1 + 2 > (T_OP_IS_NOT, v.c2, NULL, 0)], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null))); EXPLAIN select stddev(c2) from t1; @@ -2669,18 +2669,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -2691,13 +2691,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([v.c1]), filter([1 + 2 > (T_OP_IS_NOT, v.c2, NULL, 0)], [(T_OP_IS, v.c2, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c1], [v.c2]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */v.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null))); EXPLAIN select stddev(c2) from t1; @@ -2895,18 +2895,18 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t2.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null) and (v.c1 is not null))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |UPDATE | |6 |207 | +|1 | SUBPLAN FILTER | |6 |138 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -2918,13 +2918,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t2.c1]), filter([1 + 2 > (T_OP_IS_NOT, v.c2, NULL, 0)], [(T_OP_IS, v.c2, NULL, 0)], [(T_OP_IS_NOT, v.c1, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c2], [v.c1]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t2.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null) and (v.c1 is not null))); EXPLAIN select stddev(c2) from t1; @@ -3003,18 +3003,18 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t2.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null) and (v.c1 is not null))); Query Plan -================================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | MERGE RIGHT OUTER JOIN| |1 |92 | -|4 | SORT | |6 |46 | -|5 | SUBPLAN SCAN |v |6 |46 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================= +=========================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------- +|0 |DELETE | |1 |149 | +|1 | SUBPLAN FILTER | |1 |138 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | MERGE OUTER JOIN| |1 |92 | +|4 | TABLE SCAN |t2 |6 |46 | +|5 | SORT | |6 |46 | +|6 | SUBPLAN SCAN |v |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | +=========================================== Outputs & filters: ------------------------------------- @@ -3025,13 +3025,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t2.c1]), filter([1 + 2 > (T_OP_IS_NOT, v.c2, NULL, 0)], [(T_OP_IS, v.c2, NULL, 0)], [(T_OP_IS_NOT, v.c1, NULL, 0)]), rowset=256, equal_conds([t2.c1 = v.c2]), other_conds(nil) - 4 - output([v.c2], [v.c1]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) - 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, - access([v.c2], [v.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output([v.c2], [v.c1]), filter(nil), rowset=256, sort_keys([v.c2, ASC]) + 6 - output([v.c2], [v.c1]), filter(nil), rowset=256, + access([v.c2], [v.c1]) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t2.c1 from t2 left join (select /*+ NO_REWRITE */* from t1) as v on t2.c1 = v.c2 where (v.c2 is null) and (1 + 2 > (v.c2 is not null) and (v.c1 is not null))); EXPLAIN select stddev(c2) from t1; @@ -3488,7 +3488,7 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |208 | +|0 |UPDATE | |6 |207 | |1 | SUBPLAN FILTER | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | @@ -3598,9 +3598,9 @@ Query Plan |1 | SUBPLAN FILTER | |1 |138 | |2 | TABLE SCAN |t1 |1 |46 | |3 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | -|4 | TABLE SCAN |t1 |6 |46 | +|4 | TABLE SCAN |t2 |6 |46 | |5 | MATERIAL | |6 |46 | -|6 | TABLE SCAN |t2 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | ===================================================== Outputs & filters: @@ -3612,11 +3612,11 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t2.c1]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 4 - output(nil), filter(nil), rowset=256, - access(nil), partitions(p0) - 5 - output([t2.c1]), filter(nil), rowset=256 - 6 - output([t2.c1]), filter(nil), rowset=256, + 4 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 5 - output(nil), filter(nil), rowset=256 + 6 - output(nil), filter(nil), rowset=256, + access(nil), partitions(p0) delete from t1 where c2 = (select t2.c1 from t1 left join t2 using(c1) where (t2.c1 is not null) and (t2.c1 is null)); EXPLAIN select stddev(c2) from t1; @@ -3810,7 +3810,7 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |208 | +|0 |UPDATE | |6 |207 | |1 | SUBPLAN FILTER | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | @@ -4992,11 +4992,10 @@ Query Plan |1 | NESTED-LOOP OUTER JOIN | |12 |90 | |2 | TABLE SCAN |t1 |6 |46 | |3 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|4 | MATERIAL | |6 |46 | -|5 | SUBPLAN SCAN |VIEW1|6 |46 | -|6 | MERGE GROUP BY | |6 |46 | -|7 | SORT | |6 |46 | -|8 | TABLE SCAN |t3 |6 |46 | +|4 | MATERIAL | |6 |47 | +|5 | SUBPLAN SCAN |VIEW1|6 |47 | +|6 | HASH GROUP BY | |6 |47 | +|7 | TABLE SCAN |t3 |6 |46 | ================================================== Outputs & filters: @@ -5014,8 +5013,7 @@ Outputs & filters: access([VIEW1.c1]) 6 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 7 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) select * from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select c1 from t3 group by c2); @@ -5034,13 +5032,12 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |SUBPLAN FILTER | |6 |137 | +|0 |SUBPLAN FILTER | |6 |138 | |1 | NESTED-LOOP OUTER JOIN | |12 |90 | |2 | TABLE SCAN |t1 |6 |46 | |3 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|4 | MERGE GROUP BY | |6 |46 | -|5 | SORT | |6 |46 | -|6 | TABLE SCAN |t3 |6 |46 | +|4 | HASH GROUP BY | |6 |47 | +|5 | TABLE SCAN |t3 |6 |46 | ================================================= Outputs & filters: @@ -5055,8 +5052,7 @@ Outputs & filters: access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) 4 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 5 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) select /*+ NO_REWRITE */* from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select /*+ NO_REWRITE */c1 from t3 group by c2); @@ -5081,11 +5077,10 @@ Query Plan |3 | NESTED-LOOP OUTER JOIN | |12 |90 | |4 | TABLE SCAN |t1 |6 |46 | |5 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|6 | MATERIAL | |6 |46 | -|7 | SUBPLAN SCAN |VIEW1 |6 |46 | -|8 | MERGE GROUP BY | |6 |46 | -|9 | SORT | |6 |46 | -|10| TABLE SCAN |t3 |6 |46 | +|6 | MATERIAL | |6 |47 | +|7 | SUBPLAN SCAN |VIEW1 |6 |47 | +|8 | HASH GROUP BY | |6 |47 | +|9 | TABLE SCAN |t3 |6 |46 | ============================================================== Outputs & filters: @@ -5108,8 +5103,7 @@ Outputs & filters: access([VIEW1.c1]) 8 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 9 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 10 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 9 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) insert into t4_temp (select * from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select c1 from t3 group by c2)); @@ -5120,15 +5114,14 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |6 |181 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |137 | -|2 | SUBPLAN FILTER | |6 |137 | +|0 |INSERT | |6 |182 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |138 | +|2 | SUBPLAN FILTER | |6 |138 | |3 | NESTED-LOOP OUTER JOIN | |12 |90 | |4 | TABLE SCAN |t1 |6 |46 | |5 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|6 | MERGE GROUP BY | |6 |46 | -|7 | SORT | |6 |46 | -|8 | TABLE SCAN |t3 |6 |46 | +|6 | HASH GROUP BY | |6 |47 | +|7 | TABLE SCAN |t3 |6 |46 | ============================================================== Outputs & filters: @@ -5148,8 +5141,7 @@ Outputs & filters: access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) 6 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 7 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) insert into t4_temp (select /*+ NO_REWRITE */* from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select /*+ NO_REWRITE */c1 from t3 group by c2)); @@ -5161,17 +5153,16 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ |0 |UPDATE | |6 |208 | -|1 | SUBPLAN FILTER | |6 |138 | +|1 | SUBPLAN FILTER | |6 |139 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | NESTED-LOOP JOIN CARTESIAN | |0 |93 | -|4 | NESTED-LOOP ANTI JOIN CARTESIAN| |0 |93 | +|3 | NESTED-LOOP JOIN CARTESIAN | |0 |94 | +|4 | NESTED-LOOP ANTI JOIN CARTESIAN| |0 |94 | |5 | TABLE GET |t2 |1 |46 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | LIMIT | |1 |46 | -|8 | MERGE GROUP BY | |1 |46 | -|9 | SORT | |6 |46 | -|10| TABLE SCAN |t3 |6 |46 | -|11| TABLE SCAN |t1 |5 |46 | +|6 | SUBPLAN SCAN |VIEW1|1 |47 | +|7 | LIMIT | |1 |48 | +|8 | HASH GROUP BY | |1 |48 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| TABLE SCAN |t1 |5 |46 | ============================================================ Outputs & filters: @@ -5193,10 +5184,9 @@ Outputs & filters: 7 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) 8 - output(nil), filter([cast(1, INT(11, 0)) + 1 <= t3.c1]), rowset=256, group([t3.c2]), agg_func(nil) - 9 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 10 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 9 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) - 11 - output([t1.c1]), filter(nil), rowset=256, + 10 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select c1 from t3 group by c2) and t2.c1=1); @@ -5228,16 +5218,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |6 |250 | -|1 | SUBPLAN FILTER | |6 |181 | +|0 |UPDATE | |6 |251 | +|1 | SUBPLAN FILTER | |6 |182 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | SUBPLAN FILTER | |1 |136 | +|3 | SUBPLAN FILTER | |1 |137 | |4 | NESTED-LOOP OUTER JOIN | |2 |90 | |5 | TABLE SCAN |t1 |6 |46 | |6 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|7 | MERGE GROUP BY | |6 |46 | -|8 | SORT | |6 |46 | -|9 | TABLE SCAN |t3 |6 |46 | +|7 | HASH GROUP BY | |6 |47 | +|8 | TABLE SCAN |t3 |6 |46 | =================================================== Outputs & filters: @@ -5258,8 +5247,7 @@ Outputs & filters: access([GROUP_ID], [t2.c1]), partitions(p0) 7 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 8 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 9 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select /*+ NO_REWRITE */c1 from t3 group by c2) and t2.c1=1); @@ -5291,18 +5279,17 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |DELETE | |1 |150 | -|1 | SUBPLAN FILTER | |1 |138 | +|0 |DELETE | |1 |151 | +|1 | SUBPLAN FILTER | |1 |139 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | NESTED-LOOP JOIN CARTESIAN | |0 |93 | -|4 | NESTED-LOOP ANTI JOIN CARTESIAN| |0 |93 | +|3 | NESTED-LOOP JOIN CARTESIAN | |0 |94 | +|4 | NESTED-LOOP ANTI JOIN CARTESIAN| |0 |94 | |5 | TABLE GET |t2 |1 |46 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | LIMIT | |1 |46 | -|8 | MERGE GROUP BY | |1 |46 | -|9 | SORT | |6 |46 | -|10| TABLE SCAN |t3 |6 |46 | -|11| TABLE SCAN |t1 |5 |46 | +|6 | SUBPLAN SCAN |VIEW1|1 |47 | +|7 | LIMIT | |1 |48 | +|8 | HASH GROUP BY | |1 |48 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| TABLE SCAN |t1 |5 |46 | ============================================================ Outputs & filters: @@ -5323,10 +5310,9 @@ Outputs & filters: 7 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) 8 - output(nil), filter([cast(1, INT(11, 0)) + 1 <= t3.c1]), rowset=256, group([t3.c2]), agg_func(nil) - 9 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 10 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 9 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) - 11 - output([t1.c1]), filter(nil), rowset=256, + 10 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select c1 from t3 group by c2) and t2.c1=1); @@ -5358,16 +5344,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |193 | -|1 | SUBPLAN FILTER | |1 |181 | +|0 |DELETE | |1 |194 | +|1 | SUBPLAN FILTER | |1 |182 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | SUBPLAN FILTER | |1 |136 | +|3 | SUBPLAN FILTER | |1 |137 | |4 | NESTED-LOOP OUTER JOIN | |2 |90 | |5 | TABLE SCAN |t1 |6 |46 | |6 | DISTRIBUTED TABLE SCAN|t2 |2 |7 | -|7 | MERGE GROUP BY | |6 |46 | -|8 | SORT | |6 |46 | -|9 | TABLE SCAN |t3 |6 |46 | +|7 | HASH GROUP BY | |6 |47 | +|8 | TABLE SCAN |t3 |6 |46 | =================================================== Outputs & filters: @@ -5387,8 +5372,7 @@ Outputs & filters: access([GROUP_ID], [t2.c1]), partitions(p0) 7 - output([t3.c1]), filter(nil), rowset=256, group([t3.c2]), agg_func(nil) - 8 - output([t3.c2], [t3.c1]), filter(nil), rowset=256, sort_keys([t3.c2, ASC]) - 9 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, access([t3.c1], [t3.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 > t2.c1 where t2.c1 + 1 > all(select /*+ NO_REWRITE */c1 from t3 group by c2) and t2.c1=1); @@ -6463,16 +6447,16 @@ Query Plan ====================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ -|0 |UPDATE | |6 |213 | -|1 | SUBPLAN FILTER | |6 |144 | +|0 |UPDATE | |6 |256 | +|1 | SUBPLAN FILTER | |6 |186 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |99 | -|4 | NESTED-LOOP JOIN CARTESIAN| |1 |99 | -|5 | NESTED-LOOP JOIN | |1 |53 | -|6 | TABLE SCAN |v |1 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -|8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|3 | LIMIT | |1 |141 | +|4 | NESTED-LOOP JOIN CARTESIAN| |1 |141 | +|5 | TABLE SCAN |t1 |1 |46 | +|6 | MATERIAL | |6 |96 | +|7 | NESTED-LOOP JOIN | |6 |96 | +|8 | TABLE SCAN |v |6 |46 | +|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | ====================================================== Outputs & filters: @@ -6486,15 +6470,15 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_([v.c1]) - 6 - output([v.c1]), filter(nil), rowset=256, - access([v.c1]), partitions(p0) - 7 - output(nil), filter(nil), rowset=256, - access([GROUP_ID]), partitions(p0) - 8 - output([t1.c1]), filter(nil), rowset=256 - 9 - output([t1.c1]), filter(nil), rowset=256, + 5 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 6 - output(nil), filter(nil), rowset=256 + 7 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_([v.c1]) + 8 - output([v.c1]), filter(nil), rowset=256, + access([v.c1]), partitions(p0) + 9 - output(nil), filter(nil), rowset=256, + access([GROUP_ID]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1, t1 as v join t2 on v.c1 = t2.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -6595,16 +6579,16 @@ Query Plan ====================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ -|0 |DELETE | |1 |156 | -|1 | SUBPLAN FILTER | |1 |144 | +|0 |DELETE | |1 |198 | +|1 | SUBPLAN FILTER | |1 |186 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |99 | -|4 | NESTED-LOOP JOIN CARTESIAN| |1 |99 | -|5 | NESTED-LOOP JOIN | |1 |53 | -|6 | TABLE SCAN |v |1 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -|8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|3 | LIMIT | |1 |141 | +|4 | NESTED-LOOP JOIN CARTESIAN| |1 |141 | +|5 | TABLE SCAN |t1 |1 |46 | +|6 | MATERIAL | |6 |96 | +|7 | NESTED-LOOP JOIN | |6 |96 | +|8 | TABLE SCAN |v |6 |46 | +|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | ====================================================== Outputs & filters: @@ -6617,15 +6601,15 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_([v.c1]) - 6 - output([v.c1]), filter(nil), rowset=256, - access([v.c1]), partitions(p0) - 7 - output(nil), filter(nil), rowset=256, - access([GROUP_ID]), partitions(p0) - 8 - output([t1.c1]), filter(nil), rowset=256 - 9 - output([t1.c1]), filter(nil), rowset=256, + 5 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 6 - output(nil), filter(nil), rowset=256 + 7 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_([v.c1]) + 8 - output([v.c1]), filter(nil), rowset=256, + access([v.c1]), partitions(p0) + 9 - output(nil), filter(nil), rowset=256, + access([GROUP_ID]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1, t1 as v join t2 on v.c1 = t2.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -7055,8 +7039,8 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |NESTED-LOOP JOIN CARTESIAN | |216 |191 | -|1 | NESTED-LOOP JOIN CARTESIAN| |36 |136 | +|0 |NESTED-LOOP JOIN CARTESIAN | |216 |192 | +|1 | NESTED-LOOP JOIN CARTESIAN| |36 |137 | |2 | NESTED-LOOP OUTER JOIN | |6 |89 | |3 | TABLE SCAN |t2 |6 |46 | |4 | DISTRIBUTED TABLE GET |t1 |1 |7 | @@ -7311,8 +7295,8 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |NESTED-LOOP JOIN CARTESIAN | |216 |191 | -|1 | NESTED-LOOP JOIN CARTESIAN| |36 |136 | +|0 |NESTED-LOOP JOIN CARTESIAN | |216 |192 | +|1 | NESTED-LOOP JOIN CARTESIAN| |36 |137 | |2 | NESTED-LOOP OUTER JOIN | |6 |89 | |3 | TABLE SCAN |t2 |6 |46 | |4 | DISTRIBUTED TABLE GET |t1 |1 |7 | @@ -7567,10 +7551,10 @@ Query Plan ================================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- -|0 |INSERT | |216 |1565| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|216 |191 | -|2 | NESTED-LOOP JOIN CARTESIAN | |216 |191 | -|3 | NESTED-LOOP JOIN CARTESIAN| |36 |136 | +|0 |INSERT | |216 |1566| +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|216 |192 | +|2 | NESTED-LOOP JOIN CARTESIAN | |216 |192 | +|3 | NESTED-LOOP JOIN CARTESIAN| |36 |137 | |4 | NESTED-LOOP OUTER JOIN | |6 |89 | |5 | TABLE SCAN |t2 |6 |46 | |6 | DISTRIBUTED TABLE GET |t1 |1 |7 | @@ -7612,10 +7596,10 @@ Query Plan ================================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- -|0 |INSERT | |216 |1565| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|216 |191 | -|2 | NESTED-LOOP JOIN CARTESIAN | |216 |191 | -|3 | NESTED-LOOP JOIN CARTESIAN| |36 |136 | +|0 |INSERT | |216 |1566| +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|216 |192 | +|2 | NESTED-LOOP JOIN CARTESIAN | |216 |192 | +|3 | NESTED-LOOP JOIN CARTESIAN| |36 |137 | |4 | NESTED-LOOP OUTER JOIN | |6 |89 | |5 | TABLE SCAN |t2 |6 |46 | |6 | DISTRIBUTED TABLE GET |t1 |1 |7 | @@ -9583,15 +9567,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |6 |220 | -|1 | SUBPLAN FILTER | |6 |151 | +|0 |UPDATE | |6 |257 | +|1 | SUBPLAN FILTER | |6 |187 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH RIGHT OUTER JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH OUTER JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -9605,14 +9589,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output([t2.c3]), filter(nil), rowset=256, + 7 - output([t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c3]), partitions(p0) + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1 left join t3 on t1.c2 = t3.c2 where t3.c1 is not null and t2.c3 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -9702,15 +9686,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |163 | -|1 | SUBPLAN FILTER | |1 |151 | +|0 |DELETE | |1 |199 | +|1 | SUBPLAN FILTER | |1 |187 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH RIGHT OUTER JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH OUTER JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -9723,14 +9707,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output([t2.c3]), filter(nil), rowset=256, + 7 - output([t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c3]), partitions(p0) + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1 left join t3 on t1.c2 = t3.c2 where t3.c1 is not null and t2.c3 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -9738,8 +9722,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |1 | -|1 | TABLE SCAN |t1 |6 |1 | +|0 |SCALAR GROUP BY| |1 |46 | +|1 | TABLE SCAN |t1 |6 |46 | ======================================== Outputs & filters: @@ -9750,11 +9734,11 @@ Outputs & filters: access([t1.c2]), partitions(p0) select stddev(c2) from t1; -+-----------------+ -| stddev(c2) | -+-----------------+ -| 2.0591260281974 | -+-----------------+ ++--------------------+ +| stddev(c2) | ++--------------------+ +| 2.1147629234082532 | ++--------------------+ rollback; EXPLAIN select * from t1, t2, t3 where t3.c1 is not null and t1.c2 = t3.c2 and t2.c3 is not null; @@ -9977,14 +9961,14 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|5 | SUBPLAN SCAN |VIEW1|1 |92 | -|6 | LIMIT | |1 |92 | -|7 | HASH JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |1 |46 | -|11| SUBPLAN SCAN |VIEW2|1 |46 | -|12| TABLE SCAN |t2 |1 |46 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t2 |1 |46 | +|7 | MATERIAL | |1 |92 | +|8 | SUBPLAN SCAN |VIEW1|1 |92 | +|9 | LIMIT | |1 |92 | +|10| HASH JOIN | |1 |92 | +|11| TABLE SCAN |t1 |6 |46 | +|12| TABLE SCAN |t3 |1 |46 | ======================================================= Outputs & filters: @@ -9998,21 +9982,21 @@ Outputs & filters: 3 - output([VIEW2.t2.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t2.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 8 - output([t1.c2]), filter(nil), rowset=256, - access([t1.c2]), partitions(p0) - 9 - output([t3.c2]), filter(nil), rowset=256, - access([t3.c2]), partitions(p0) - 10 - output([VIEW2.t2.c1]), filter(nil), rowset=256 - 11 - output([VIEW2.t2.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t2.c1]), filter(nil), rowset=256, access([VIEW2.t2.c1]) - 12 - output([t2.c1]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, + 6 - output([t2.c1]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, access([t2.c1], [t2.c3]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + equal_conds([t1.c2 = t3.c2]), other_conds(nil) + 11 - output([t1.c2]), filter(nil), rowset=256, + access([t1.c2]), partitions(p0) + 12 - output([t3.c2]), filter(nil), rowset=256, + access([t3.c2]), partitions(p0) update t1 set c2 = (select t2.c1 from t1, t2, t3 where t3.c1 is not null and t1.c2 = t3.c2 and t2.c3 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -10110,14 +10094,14 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|5 | SUBPLAN SCAN |VIEW1|1 |92 | -|6 | LIMIT | |1 |92 | -|7 | HASH JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |1 |46 | -|11| SUBPLAN SCAN |VIEW2|1 |46 | -|12| TABLE SCAN |t2 |1 |46 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t2 |1 |46 | +|7 | MATERIAL | |1 |92 | +|8 | SUBPLAN SCAN |VIEW1|1 |92 | +|9 | LIMIT | |1 |92 | +|10| HASH JOIN | |1 |92 | +|11| TABLE SCAN |t1 |6 |46 | +|12| TABLE SCAN |t3 |1 |46 | ======================================================= Outputs & filters: @@ -10130,21 +10114,21 @@ Outputs & filters: 3 - output([VIEW2.t2.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t2.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 8 - output([t1.c2]), filter(nil), rowset=256, - access([t1.c2]), partitions(p0) - 9 - output([t3.c2]), filter(nil), rowset=256, - access([t3.c2]), partitions(p0) - 10 - output([VIEW2.t2.c1]), filter(nil), rowset=256 - 11 - output([VIEW2.t2.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t2.c1]), filter(nil), rowset=256, access([VIEW2.t2.c1]) - 12 - output([t2.c1]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, + 6 - output([t2.c1]), filter([(T_OP_IS_NOT, t2.c3, NULL, 0)]), rowset=256, access([t2.c1], [t2.c3]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + equal_conds([t1.c2 = t3.c2]), other_conds(nil) + 11 - output([t1.c2]), filter(nil), rowset=256, + access([t1.c2]), partitions(p0) + 12 - output([t3.c2]), filter(nil), rowset=256, + access([t3.c2]), partitions(p0) delete from t1 where c2 = (select t2.c1 from t1, t2, t3 where t3.c1 is not null and t1.c2 = t3.c2 and t2.c3 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -10380,7 +10364,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- |0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER| |6 |137 | +|1 | SUBPLAN FILTER| |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |92 | |4 | HASH JOIN | |1 |92 | @@ -10433,15 +10417,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |6 |220 | -|1 | SUBPLAN FILTER | |6 |151 | +|0 |UPDATE | |6 |257 | +|1 | SUBPLAN FILTER | |6 |187 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH RIGHT OUTER JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH OUTER JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -10455,14 +10439,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output(nil), filter(nil), rowset=256, + 7 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1 left join t3 on t1.c2 = t3.c2 where t3.c1 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -10546,15 +10530,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |163 | -|1 | SUBPLAN FILTER | |1 |151 | +|0 |DELETE | |1 |199 | +|1 | SUBPLAN FILTER | |1 |187 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH RIGHT OUTER JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH OUTER JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -10567,14 +10551,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output(nil), filter(nil), rowset=256, + 7 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1 left join t3 on t1.c2 = t3.c2 where t3.c1 is not null limit 1); EXPLAIN select stddev(c2) from t1; @@ -10582,8 +10566,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |1 | -|1 | TABLE SCAN |t1 |6 |1 | +|0 |SCALAR GROUP BY| |1 |46 | +|1 | TABLE SCAN |t1 |6 |46 | ======================================== Outputs & filters: @@ -10594,11 +10578,11 @@ Outputs & filters: access([t1.c2]), partitions(p0) select stddev(c2) from t1; -+-----------------+ -| stddev(c2) | -+-----------------+ -| 2.0591260281974 | -+-----------------+ ++--------------------+ +| stddev(c2) | ++--------------------+ +| 2.1147629234082532 | ++--------------------+ rollback; EXPLAIN select * from t1 left join t2 on t1.c1 = t2.c1, t3 where t3.c1 is not null and t1.c2 = t3.c2; @@ -10749,7 +10733,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- |0 |UPDATE | |6 |207 | -|1 | SUBPLAN FILTER| |6 |137 | +|1 | SUBPLAN FILTER| |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |92 | |4 | HASH JOIN | |1 |92 | @@ -10802,15 +10786,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |6 |220 | -|1 | SUBPLAN FILTER | |6 |151 | +|0 |UPDATE | |6 |257 | +|1 | SUBPLAN FILTER | |6 |187 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -10824,14 +10808,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c2]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output(nil), filter(nil), rowset=256, + 7 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 8 - output([t3.c2]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1, t3 where t3.c1 is not null and t1.c2 = t3.c2 limit 1); EXPLAIN select stddev(c2) from t1; @@ -10915,15 +10899,15 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |163 | -|1 | SUBPLAN FILTER | |1 |151 | +|0 |DELETE | |1 |199 | +|1 | SUBPLAN FILTER | |1 |187 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |106 | -|4 | HASH JOIN | |1 |106 | -|5 | TABLE SCAN |t3 |6 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |59 | -|7 | TABLE SCAN |t1 |1 |46 | -|8 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|3 | LIMIT | |1 |142 | +|4 | HASH JOIN | |1 |142 | +|5 | NESTED-LOOP OUTER JOIN| |6 |96 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t2 |1 |7 | +|8 | TABLE SCAN |t3 |1 |46 | =================================================== Outputs & filters: @@ -10936,14 +10920,14 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = t3.c2]), other_conds(nil) - 5 - output([t3.c2]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 8 - output(nil), filter(nil), rowset=256, + 7 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 8 - output([t3.c2]), filter([(T_OP_IS_NOT, t3.c1, NULL, 0)]), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1 = t2.c1, t3 where t3.c1 is not null and t1.c2 = t3.c2 limit 1); EXPLAIN select stddev(c2) from t1; @@ -10951,8 +10935,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |1 | -|1 | TABLE SCAN |t1 |6 |1 | +|0 |SCALAR GROUP BY| |1 |46 | +|1 | TABLE SCAN |t1 |6 |46 | ======================================== Outputs & filters: @@ -10963,11 +10947,11 @@ Outputs & filters: access([t1.c2]), partitions(p0) select stddev(c2) from t1; -+-----------------+ -| stddev(c2) | -+-----------------+ -| 2.0591260281974 | -+-----------------+ ++--------------------+ +| stddev(c2) | ++--------------------+ +| 2.1147629234082532 | ++--------------------+ rollback; EXPLAIN select * from t1 join t2 on t1.c1 = t2.c1; @@ -21396,10 +21380,10 @@ Query Plan ------------------------------------------------- |0 |NESTED-LOOP JOIN | |6 |183 | |1 | HASH JOIN | |6 |136 | -|2 | TABLE SCAN |tt |6 |46 | -|3 | NESTED-LOOP JOIN | |6 |89 | -|4 | TABLE SCAN |t1 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|2 | NESTED-LOOP JOIN | |6 |89 | +|3 | TABLE SCAN |t1 |6 |46 | +|4 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|5 | TABLE SCAN |tt |6 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | ================================================= @@ -21410,14 +21394,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 1 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 2 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 5 - output(nil), filter(nil), rowset=256, + 4 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 5 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 6 - output([t2.c1]), filter(nil), rowset=256 7 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21434,10 +21418,10 @@ Query Plan ------------------------------------------------- |0 |NESTED-LOOP JOIN | |6 |183 | |1 | HASH JOIN | |6 |136 | -|2 | TABLE SCAN |tt |6 |46 | -|3 | NESTED-LOOP JOIN | |6 |89 | -|4 | TABLE SCAN |t1 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|2 | NESTED-LOOP JOIN | |6 |89 | +|3 | TABLE SCAN |t1 |6 |46 | +|4 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|5 | TABLE SCAN |tt |6 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | ================================================= @@ -21448,14 +21432,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 1 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 2 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 5 - output(nil), filter(nil), rowset=256, + 4 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 5 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 6 - output([t2.c1]), filter(nil), rowset=256 7 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21474,10 +21458,10 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |183 | |2 | NESTED-LOOP JOIN | |6 |183 | |3 | HASH JOIN | |6 |136 | -|4 | TABLE SCAN |tt |6 |46 | -|5 | NESTED-LOOP JOIN | |6 |89 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|4 | NESTED-LOOP JOIN | |6 |89 | +|5 | TABLE SCAN |t1 |6 |46 | +|6 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|7 | TABLE SCAN |tt |6 |46 | |8 | MATERIAL | |6 |46 | |9 | TABLE SCAN |t2 |6 |46 | ============================================================== @@ -21493,14 +21477,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 3 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 4 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 7 - output(nil), filter(nil), rowset=256, + 6 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 7 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 8 - output([t2.c1]), filter(nil), rowset=256 9 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21517,10 +21501,10 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |183 | |2 | NESTED-LOOP JOIN | |6 |183 | |3 | HASH JOIN | |6 |136 | -|4 | TABLE SCAN |tt |6 |46 | -|5 | NESTED-LOOP JOIN | |6 |89 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|4 | NESTED-LOOP JOIN | |6 |89 | +|5 | TABLE SCAN |t1 |6 |46 | +|6 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|7 | TABLE SCAN |tt |6 |46 | |8 | MATERIAL | |6 |46 | |9 | TABLE SCAN |t2 |6 |46 | ============================================================== @@ -21536,14 +21520,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 3 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 4 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 7 - output(nil), filter(nil), rowset=256, + 6 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 7 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 8 - output([t2.c1]), filter(nil), rowset=256 9 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21556,16 +21540,16 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |6 |266 | -|1 | SUBPLAN FILTER | |6 |197 | +|0 |UPDATE | |6 |302 | +|1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |151 | -|4 | NESTED-LOOP JOIN | |1 |151 | -|5 | HASH JOIN | |1 |106 | -|6 | TABLE SCAN |tt |6 |46 | -|7 | NESTED-LOOP JOIN | |1 |59 | -|8 | TABLE SCAN |t1 |1 |46 | -|9 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|3 | LIMIT | |1 |188 | +|4 | NESTED-LOOP JOIN | |1 |188 | +|5 | HASH JOIN | |1 |142 | +|6 | NESTED-LOOP JOIN | |6 |96 | +|7 | TABLE SCAN |t1 |6 |46 | +|8 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|9 | TABLE SCAN |tt |1 |46 | |10| MATERIAL | |6 |46 | |11| TABLE SCAN |t2 |6 |46 | ==================================================== @@ -21583,14 +21567,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 5 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 6 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256, + 8 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 9 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21624,16 +21608,16 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |6 |266 | -|1 | SUBPLAN FILTER | |6 |197 | +|0 |UPDATE | |6 |302 | +|1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |151 | -|4 | NESTED-LOOP JOIN | |1 |151 | -|5 | HASH JOIN | |1 |106 | -|6 | TABLE SCAN |tt |6 |46 | -|7 | NESTED-LOOP JOIN | |1 |59 | -|8 | TABLE SCAN |t1 |1 |46 | -|9 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|3 | LIMIT | |1 |188 | +|4 | NESTED-LOOP JOIN | |1 |188 | +|5 | HASH JOIN | |1 |142 | +|6 | NESTED-LOOP JOIN | |6 |96 | +|7 | TABLE SCAN |t1 |6 |46 | +|8 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|9 | TABLE SCAN |tt |1 |46 | |10| MATERIAL | |6 |46 | |11| TABLE SCAN |t2 |6 |46 | ==================================================== @@ -21651,14 +21635,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 5 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 6 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256, + 8 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 9 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21692,16 +21676,16 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |208 | -|1 | SUBPLAN FILTER | |1 |197 | +|0 |DELETE | |1 |245 | +|1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |151 | -|4 | NESTED-LOOP JOIN | |1 |151 | -|5 | HASH JOIN | |1 |106 | -|6 | TABLE SCAN |tt |6 |46 | -|7 | NESTED-LOOP JOIN | |1 |59 | -|8 | TABLE SCAN |t1 |1 |46 | -|9 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|3 | LIMIT | |1 |188 | +|4 | NESTED-LOOP JOIN | |1 |188 | +|5 | HASH JOIN | |1 |142 | +|6 | NESTED-LOOP JOIN | |6 |96 | +|7 | TABLE SCAN |t1 |6 |46 | +|8 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|9 | TABLE SCAN |tt |1 |46 | |10| MATERIAL | |6 |46 | |11| TABLE SCAN |t2 |6 |46 | ==================================================== @@ -21718,14 +21702,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 5 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 6 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256, + 8 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 9 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21759,16 +21743,16 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |208 | -|1 | SUBPLAN FILTER | |1 |197 | +|0 |DELETE | |1 |245 | +|1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |151 | -|4 | NESTED-LOOP JOIN | |1 |151 | -|5 | HASH JOIN | |1 |106 | -|6 | TABLE SCAN |tt |6 |46 | -|7 | NESTED-LOOP JOIN | |1 |59 | -|8 | TABLE SCAN |t1 |1 |46 | -|9 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|3 | LIMIT | |1 |188 | +|4 | NESTED-LOOP JOIN | |1 |188 | +|5 | HASH JOIN | |1 |142 | +|6 | NESTED-LOOP JOIN | |6 |96 | +|7 | TABLE SCAN |t1 |6 |46 | +|8 | DISTRIBUTED TABLE GET|t3 |1 |7 | +|9 | TABLE SCAN |tt |1 |46 | |10| MATERIAL | |6 |46 | |11| TABLE SCAN |t2 |6 |46 | ==================================================== @@ -21785,14 +21769,14 @@ Outputs & filters: conds([t1.c1 + t2.c1 = tt.c1]), nl_params_(nil) 5 - output([t1.c1], [tt.c1]), filter(nil), rowset=256, equal_conds([t1.c2 = tt.c2]), other_conds(nil) - 6 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, - access([tt.c1], [tt.c2]), partitions(p0) - 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t1.c1]) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256, + 8 - output(nil), filter(nil), rowset=256, access([GROUP_ID]), partitions(p0) + 9 - output([tt.c1], [tt.c2]), filter(nil), rowset=256, + access([tt.c1], [tt.c2]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -21975,7 +21959,7 @@ Query Plan ================================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |36 |414 | +|0 |INSERT | |36 |415 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|36 |180 | |2 | NESTED-LOOP JOIN CARTESIAN| |36 |180 | |3 | NESTED-LOOP OUTER JOIN | |6 |89 | @@ -22018,7 +22002,7 @@ Query Plan ================================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |36 |414 | +|0 |INSERT | |36 |415 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|36 |180 | |2 | NESTED-LOOP JOIN CARTESIAN| |36 |180 | |3 | NESTED-LOOP OUTER JOIN | |6 |89 | @@ -22571,8 +22555,8 @@ Query Plan |0 |UPDATE | |6 |319 | |1 | SUBPLAN FILTER | |6 |250 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |204 | -|4 | NESTED-LOOP OUTER JOIN | |1 |204 | +|3 | LIMIT | |1 |205 | +|4 | NESTED-LOOP OUTER JOIN | |1 |205 | |5 | NESTED-LOOP JOIN | |1 |191 | |6 | NESTED-LOOP JOIN | |6 |141 | |7 | MERGE OUTER JOIN | |6 |92 | @@ -22705,11 +22689,11 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |261 | +|0 |DELETE | |1 |262 | |1 | SUBPLAN FILTER | |1 |250 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |204 | -|4 | NESTED-LOOP OUTER JOIN | |1 |204 | +|3 | LIMIT | |1 |205 | +|4 | NESTED-LOOP OUTER JOIN | |1 |205 | |5 | NESTED-LOOP JOIN | |1 |191 | |6 | NESTED-LOOP JOIN | |6 |141 | |7 | MERGE OUTER JOIN | |6 |92 | @@ -23118,8 +23102,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |LIMIT | |6 |46 | -|1 | MERGE GROUP BY| |6 |46 | +|0 |LIMIT | |6 |47 | +|1 | MERGE GROUP BY| |6 |47 | |2 | SORT | |6 |46 | |3 | TABLE SCAN |t1 |6 |46 | ======================================== @@ -23149,8 +23133,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |LIMIT | |6 |46 | -|1 | MERGE GROUP BY| |6 |46 | +|0 |LIMIT | |6 |47 | +|1 | MERGE GROUP BY| |6 |47 | |2 | SORT | |6 |46 | |3 | TABLE SCAN |t1 |6 |46 | ======================================== @@ -23181,9 +23165,9 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- |0 |INSERT | |6 |91 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |46 | -|2 | LIMIT | |6 |46 | -|3 | MERGE GROUP BY| |6 |46 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |47 | +|2 | LIMIT | |6 |47 | +|3 | MERGE GROUP BY| |6 |47 | |4 | SORT | |6 |46 | |5 | TABLE SCAN |t1 |6 |46 | ===================================================== @@ -23211,9 +23195,9 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- |0 |INSERT | |6 |91 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |46 | -|2 | LIMIT | |6 |46 | -|3 | MERGE GROUP BY| |6 |46 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |47 | +|2 | LIMIT | |6 |47 | +|3 | MERGE GROUP BY| |6 |47 | |4 | SORT | |6 |46 | |5 | TABLE SCAN |t1 |6 |46 | ===================================================== @@ -25331,8 +25315,8 @@ Query Plan |0 |UPDATE | |6 |207 | |1 | SUBPLAN FILTER | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |92 | -|4 | NESTED-LOOP OUTER JOIN| |1 |92 | +|3 | LIMIT | |1 |93 | +|4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | @@ -25447,11 +25431,11 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |149 | +|0 |DELETE | |1 |150 | |1 | SUBPLAN FILTER | |1 |138 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |92 | -|4 | NESTED-LOOP OUTER JOIN| |1 |92 | +|3 | LIMIT | |1 |93 | +|4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | @@ -30209,7 +30193,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |142 | |4 | NESTED-LOOP OUTER JOIN| |1 |142 | -|5 | HASH OUTER JOIN | |6 |92 | +|5 | HASH OUTER JOIN | |6 |93 | |6 | TABLE SCAN |t3 |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | |8 | DISTRIBUTED TABLE GET|t1 |1 |7 | @@ -30333,7 +30317,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |142 | |4 | NESTED-LOOP OUTER JOIN| |1 |142 | -|5 | HASH OUTER JOIN | |6 |92 | +|5 | HASH OUTER JOIN | |6 |93 | |6 | TABLE SCAN |t3 |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | |8 | DISTRIBUTED TABLE GET|t1 |1 |7 | @@ -30584,7 +30568,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |142 | |4 | NESTED-LOOP OUTER JOIN| |1 |142 | -|5 | HASH OUTER JOIN | |6 |92 | +|5 | HASH OUTER JOIN | |6 |93 | |6 | TABLE SCAN |t3 |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | |8 | DISTRIBUTED TABLE GET|t1 |1 |7 | @@ -30703,7 +30687,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |142 | |4 | NESTED-LOOP OUTER JOIN| |1 |142 | -|5 | HASH OUTER JOIN | |6 |92 | +|5 | HASH OUTER JOIN | |6 |93 | |6 | TABLE SCAN |t3 |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | |8 | DISTRIBUTED TABLE GET|t1 |1 |7 | @@ -31628,18 +31612,25 @@ insert into t11_temp (select /*+ NO_REWRITE */t1.c1 as a1, t2.c1 as a2 from t1 l rollback; EXPLAIN update t1 set c2 = (select t1.c1 as a1 from t1 left join t2 on t1.c1 != t2.c1 where t1.c2 in (1, 2, t2.c2) limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |6 |206 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |91 | -|4 | NESTED-LOOP OUTER JOIN| |1 |91 | -|5 | TABLE SCAN |t1 |1 |46 | -|6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================== +===================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------- +|0 |UPDATE | |6 |115 | +|1 | SUBPLAN FILTER | |6 |46 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | LIMIT | |1 |183 | +|4 | UNION ALL | |1 |183 | +|5 | LIMIT | |1 |91 | +|6 | NESTED-LOOP OUTER JOIN| |2 |91 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | +|9 | MATERIAL | |6 |46 | +|10| TABLE SCAN |t2 |6 |46 | +|11| LIMIT | |1 |92 | +|12| HASH JOIN | |2 |92 | +|13| TABLE SCAN |t1 |3 |46 | +|14| TABLE SCAN |t2 |3 |46 | +===================================================== Outputs & filters: ------------------------------------- @@ -31649,13 +31640,25 @@ Outputs & filters: exec_params_(nil), onetime_exprs_([subquery(1)]), init_plan_idxs_(nil) 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 4 - output([t1.c1]), filter([t1.c2 IN (1, 2) OR t1.c2 = t2.c2]), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 3 - output([UNION([1])]), filter(nil), rowset=256, limit(1), offset(nil) + 4 - output([UNION([1])]), filter(nil), rowset=256 + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + conds([VIEW2.t1.c1 != t2.c1]), nl_params_(nil) + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + access([VIEW2.t1.c1]) + 8 - output([t1.c1]), filter([t1.c2 IN (1, 2)]), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0), + limit(1), offset(nil) + 9 - output([t2.c1]), filter(nil), rowset=256 + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 11 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 12 - output([t1.c1]), filter(nil), rowset=256, + equal_conds([t1.c2 = t2.c2]), other_conds([t1.c1 != t2.c1]) + 13 - output([t1.c1], [t1.c2]), filter([lnnvl(cast(t1.c2 IN (1, 2), TINYINT(-1, 0)))]), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 6 - output([t2.c1], [t2.c2]), filter(nil), rowset=256 - 7 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, + 14 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) update t1 set c2 = (select t1.c1 as a1 from t1 left join t2 on t1.c1 != t2.c1 where t1.c2 in (1, 2, t2.c2) limit 1); @@ -31740,18 +31743,25 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select t1.c1 as a1 from t1 left join t2 on t1.c1 != t2.c1 where t1.c2 in (1, 2, t2.c2) limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |148 | -|1 | SUBPLAN FILTER | |1 |137 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |91 | -|4 | NESTED-LOOP OUTER JOIN| |1 |91 | -|5 | TABLE SCAN |t1 |1 |46 | -|6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | -================================================== +===================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------- +|0 |DELETE | |1 |58 | +|1 | SUBPLAN FILTER | |1 |46 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |183 | +|4 | UNION ALL | |1 |183 | +|5 | LIMIT | |1 |91 | +|6 | NESTED-LOOP OUTER JOIN| |2 |91 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | +|9 | MATERIAL | |6 |46 | +|10| TABLE SCAN |t2 |6 |46 | +|11| LIMIT | |1 |92 | +|12| HASH JOIN | |2 |92 | +|13| TABLE SCAN |t1 |3 |46 | +|14| TABLE SCAN |t2 |3 |46 | +===================================================== Outputs & filters: ------------------------------------- @@ -31760,13 +31770,25 @@ Outputs & filters: exec_params_(nil), onetime_exprs_([subquery(1)]), init_plan_idxs_(nil) 2 - output([t1.c1], [t1.c2]), filter([t1.c2 = ?]), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 4 - output([t1.c1]), filter([t1.c2 IN (1, 2) OR t1.c2 = t2.c2]), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 3 - output([UNION([1])]), filter(nil), rowset=256, limit(1), offset(nil) + 4 - output([UNION([1])]), filter(nil), rowset=256 + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + conds([VIEW2.t1.c1 != t2.c1]), nl_params_(nil) + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + access([VIEW2.t1.c1]) + 8 - output([t1.c1]), filter([t1.c2 IN (1, 2)]), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0), + limit(1), offset(nil) + 9 - output([t2.c1]), filter(nil), rowset=256 + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 11 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 12 - output([t1.c1]), filter(nil), rowset=256, + equal_conds([t1.c2 = t2.c2]), other_conds([t1.c1 != t2.c1]) + 13 - output([t1.c1], [t1.c2]), filter([lnnvl(cast(t1.c2 IN (1, 2), TINYINT(-1, 0)))]), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) - 6 - output([t2.c1], [t2.c2]), filter(nil), rowset=256 - 7 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, + 14 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) delete from t1 where c2 = (select t1.c1 as a1 from t1 left join t2 on t1.c1 != t2.c1 where t1.c2 in (1, 2, t2.c2) limit 1); @@ -32037,8 +32059,8 @@ Query Plan |0 |UPDATE | |6 |206 | |1 | SUBPLAN FILTER | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |91 | -|4 | NESTED-LOOP OUTER JOIN| |1 |91 | +|3 | LIMIT | |1 |92 | +|4 | NESTED-LOOP OUTER JOIN| |1 |92 | |5 | TABLE SCAN |t1 |1 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | @@ -32145,11 +32167,11 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |DELETE | |1 |148 | +|0 |DELETE | |1 |149 | |1 | SUBPLAN FILTER | |1 |137 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |91 | -|4 | NESTED-LOOP OUTER JOIN| |1 |91 | +|3 | LIMIT | |1 |92 | +|4 | NESTED-LOOP OUTER JOIN| |1 |92 | |5 | TABLE SCAN |t1 |1 |46 | |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t2 |6 |46 | @@ -32253,7 +32275,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |30 |289 | +|0 |INSERT | |30 |290 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|30 |93 | |2 | NESTED-LOOP OUTER JOIN| |30 |93 | |3 | TABLE SCAN |t1 |6 |46 | @@ -32589,7 +32611,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |184 | +|0 |NESTED-LOOP OUTER JOIN | |1 |185 | |1 | NESTED-LOOP OUTER JOIN | |1 |139 | |2 | NESTED-LOOP OUTER JOIN| |1 |93 | |3 | TABLE SCAN |t1 |6 |46 | @@ -32679,8 +32701,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- |0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP OUTER JOIN | |1 |184 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP OUTER JOIN | |1 |185 | |3 | NESTED-LOOP OUTER JOIN | |1 |139 | |4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | @@ -32726,7 +32748,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- |0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | +|1 | SUBPLAN FILTER | |6 |229 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP ANTI JOIN | |1 |183 | @@ -32802,7 +32824,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -32945,7 +32967,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -33054,7 +33076,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |184 | +|0 |NESTED-LOOP OUTER JOIN | |1 |185 | |1 | NESTED-LOOP OUTER JOIN | |1 |139 | |2 | NESTED-LOOP OUTER JOIN| |1 |93 | |3 | TABLE SCAN |t1 |6 |46 | @@ -33144,8 +33166,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- |0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP OUTER JOIN | |1 |184 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP OUTER JOIN | |1 |185 | |3 | NESTED-LOOP OUTER JOIN | |1 |139 | |4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | @@ -33191,7 +33213,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------- |0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | +|1 | SUBPLAN FILTER | |6 |229 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |183 | @@ -33276,7 +33298,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -33428,7 +33450,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -33537,7 +33559,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |184 | +|0 |NESTED-LOOP OUTER JOIN | |1 |185 | |1 | NESTED-LOOP OUTER JOIN | |1 |139 | |2 | NESTED-LOOP OUTER JOIN| |1 |93 | |3 | TABLE SCAN |t1 |6 |46 | @@ -33627,8 +33649,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- |0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP OUTER JOIN | |1 |184 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP OUTER JOIN | |1 |185 | |3 | NESTED-LOOP OUTER JOIN | |1 |139 | |4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | @@ -33674,7 +33696,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ |0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | +|1 | SUBPLAN FILTER | |6 |229 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |183 | @@ -33750,7 +33772,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -33893,7 +33915,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -33960,7 +33982,7 @@ Query Plan ====================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ -|0 |NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |NESTED-LOOP ANTI JOIN | |1 |185 | |1 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | MATERIAL | |1 |92 | @@ -34000,7 +34022,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |184 | +|0 |NESTED-LOOP OUTER JOIN | |1 |185 | |1 | NESTED-LOOP OUTER JOIN | |1 |139 | |2 | NESTED-LOOP OUTER JOIN| |1 |93 | |3 | TABLE SCAN |t1 |6 |46 | @@ -34042,9 +34064,9 @@ Query Plan =================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------- -|0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |INSERT | |1 |192 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP ANTI JOIN | |1 |185 | |3 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |4 | TABLE SCAN |t1 |6 |46 | |5 | MATERIAL | |1 |92 | @@ -34087,9 +34109,9 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP OUTER JOIN | |1 |184 | +|0 |INSERT | |1 |192 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP OUTER JOIN | |1 |185 | |3 | NESTED-LOOP OUTER JOIN | |1 |139 | |4 | NESTED-LOOP OUTER JOIN| |1 |93 | |5 | TABLE SCAN |t1 |6 |46 | @@ -34219,7 +34241,7 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -34370,7 +34392,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | NESTED-LOOP OUTER JOIN | |1 |184 | -|5 | NESTED-LOOP OUTER JOIN | |1 |138 | +|5 | NESTED-LOOP OUTER JOIN | |1 |139 | |6 | NESTED-LOOP OUTER JOIN| |1 |93 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -34568,7 +34590,7 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |1 |192 | +|0 |INSERT | |1 |193 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |186 | |2 | NESTED-LOOP OUTER JOIN | |1 |186 | |3 | NESTED-LOOP OUTER JOIN | |1 |140 | @@ -34616,7 +34638,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ |0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | +|1 | SUBPLAN FILTER | |6 |229 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |183 | @@ -34902,7 +34924,7 @@ Query Plan ====================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ -|0 |NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |NESTED-LOOP ANTI JOIN | |1 |185 | |1 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | MATERIAL | |1 |92 | @@ -34984,9 +35006,9 @@ Query Plan =================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------- -|0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |INSERT | |1 |192 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP ANTI JOIN | |1 |185 | |3 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |4 | TABLE SCAN |t1 |6 |46 | |5 | MATERIAL | |1 |92 | @@ -35029,7 +35051,7 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |1 |192 | +|0 |INSERT | |1 |193 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |186 | |2 | NESTED-LOOP OUTER JOIN | |1 |186 | |3 | NESTED-LOOP OUTER JOIN | |1 |140 | @@ -35076,7 +35098,7 @@ Query Plan ========================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------------- -|0 |UPDATE | |6 |344 | +|0 |UPDATE | |6 |345 | |1 | SUBPLAN FILTER | |6 |275 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |230 | @@ -35359,7 +35381,7 @@ Query Plan ====================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------ -|0 |NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |NESTED-LOOP ANTI JOIN | |1 |185 | |1 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |2 | TABLE SCAN |t1 |6 |46 | |3 | MATERIAL | |1 |92 | @@ -35441,9 +35463,9 @@ Query Plan =================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------- -|0 |INSERT | |1 |191 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |184 | -|2 | NESTED-LOOP ANTI JOIN | |1 |184 | +|0 |INSERT | |1 |192 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |185 | +|2 | NESTED-LOOP ANTI JOIN | |1 |185 | |3 | NESTED-LOOP JOIN CARTESIAN | |6 |138 | |4 | TABLE SCAN |t1 |6 |46 | |5 | MATERIAL | |1 |92 | @@ -35533,7 +35555,7 @@ Query Plan ========================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------------- -|0 |UPDATE | |6 |344 | +|0 |UPDATE | |6 |345 | |1 | SUBPLAN FILTER | |6 |275 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |230 | @@ -35606,8 +35628,8 @@ Query Plan |0 |UPDATE | |6 |301 | |1 | SUBPLAN FILTER | |6 |232 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |186 | -|4 | NESTED-LOOP OUTER JOIN | |1 |186 | +|3 | LIMIT | |1 |187 | +|4 | NESTED-LOOP OUTER JOIN | |1 |187 | |5 | NESTED-LOOP OUTER JOIN | |5 |140 | |6 | NESTED-LOOP OUTER JOIN| |5 |93 | |7 | TABLE SCAN |t1 |6 |46 | @@ -35744,11 +35766,11 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |243 | +|0 |DELETE | |1 |244 | |1 | SUBPLAN FILTER | |1 |232 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |186 | -|4 | NESTED-LOOP OUTER JOIN | |1 |186 | +|3 | LIMIT | |1 |187 | +|4 | NESTED-LOOP OUTER JOIN | |1 |187 | |5 | NESTED-LOOP OUTER JOIN | |5 |140 | |6 | NESTED-LOOP OUTER JOIN| |5 |93 | |7 | TABLE SCAN |t1 |6 |46 | @@ -35939,7 +35961,7 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |4 |215 | +|0 |INSERT | |4 |216 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |187 | |2 | NESTED-LOOP OUTER JOIN | |4 |187 | |3 | NESTED-LOOP OUTER JOIN | |5 |140 | @@ -36328,10 +36350,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |240 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |242 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -36420,12 +36442,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |247 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |240 | -|2 | NESTED-LOOP OUTER JOIN | |0 |240 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |249 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |242 | +|2 | NESTED-LOOP OUTER JOIN | |0 |242 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -36468,7 +36490,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- |0 |UPDATE | |6 |300 | -|1 | SUBPLAN FILTER | |6 |230 | +|1 | SUBPLAN FILTER | |6 |231 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |185 | |4 | NESTED-LOOP ANTI JOIN | |1 |185 | @@ -36543,13 +36565,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- |0 |UPDATE | |6 |354 | -|1 | SUBPLAN FILTER | |6 |284 | +|1 | SUBPLAN FILTER | |6 |285 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -36615,7 +36637,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- |0 |DELETE | |1 |242 | -|1 | SUBPLAN FILTER | |1 |230 | +|1 | SUBPLAN FILTER | |1 |231 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |185 | |4 | NESTED-LOOP ANTI JOIN | |1 |185 | @@ -36688,14 +36710,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |296 | -|1 | SUBPLAN FILTER | |1 |284 | +|0 |DELETE | |1 |297 | +|1 | SUBPLAN FILTER | |1 |285 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -36802,10 +36824,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |240 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |242 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -36844,7 +36866,7 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |3 |203 | +|0 |INSERT | |3 |204 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |183 | |2 | NESTED-LOOP JOIN CARTESIAN | |3 |183 | |3 | TABLE SCAN |t4 |6 |46 | @@ -36891,12 +36913,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |247 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |240 | -|2 | NESTED-LOOP OUTER JOIN | |0 |240 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |249 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |242 | +|2 | NESTED-LOOP OUTER JOIN | |0 |242 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -36935,28 +36957,28 @@ insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 != rollback; EXPLAIN update t1 set c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0 limit 1); Query Plan -========================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |183 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | -|5 | SUBPLAN SCAN |VIEW3|1 |46 | -|6 | TABLE SCAN |t4 |1 |46 | -|7 | MATERIAL | |1 |138 | -|8 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|9 | SUBPLAN SCAN |VIEW2|1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |92 | -|12| SUBPLAN SCAN |VIEW1|1 |92 | -|13| LIMIT | |1 |92 | -|14| NESTED-LOOP ANTI JOIN | |1 |92 | -|15| TABLE SCAN |t1 |6 |46 | -|16| MATERIAL | |6 |46 | -|17| TABLE SCAN |t2 |6 |46 | -========================================================= +======================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------- +|0 |UPDATE | |6 |298 | +|1 | SUBPLAN FILTER | |6 |228 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | LIMIT | |1 |183 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | +|6 | SUBPLAN SCAN |VIEW1|1 |92 | +|7 | LIMIT | |1 |92 | +|8 | NESTED-LOOP ANTI JOIN | |1 |92 | +|9 | TABLE SCAN |t1 |6 |46 | +|10| MATERIAL | |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | +|12| MATERIAL | |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t3 |1 |46 | +|15| MATERIAL | |1 |46 | +|16| SUBPLAN SCAN |VIEW3|1 |46 | +|17| TABLE SCAN |t4 |1 |46 | +======================================================== Outputs & filters: ------------------------------------- @@ -36969,30 +36991,30 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 7 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 8 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 9 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + access([VIEW1.t1.c1]) + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, + conds([t1.c1 != t2.c1]), nl_params_(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256 + 11 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, access(nil) - 10 - output([1]), filter(nil), rowset=256, + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 15 - output(nil), filter(nil), rowset=256 + 16 - output(nil), filter(nil), rowset=256, + access(nil) + 17 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 11 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256, - access([VIEW1.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 16 - output([t2.c1]), filter(nil), rowset=256 - 17 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0 limit 1); EXPLAIN select stddev(c2) from t1; @@ -37024,13 +37046,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- |0 |UPDATE | |6 |354 | -|1 | SUBPLAN FILTER | |6 |284 | +|1 | SUBPLAN FILTER | |6 |285 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -37092,28 +37114,28 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0 limit 1); Query Plan -========================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |DELETE | |1 |240 | -|1 | SUBPLAN FILTER | |1 |228 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |183 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | -|5 | SUBPLAN SCAN |VIEW3|1 |46 | -|6 | TABLE SCAN |t4 |1 |46 | -|7 | MATERIAL | |1 |138 | -|8 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|9 | SUBPLAN SCAN |VIEW2|1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |92 | -|12| SUBPLAN SCAN |VIEW1|1 |92 | -|13| LIMIT | |1 |92 | -|14| NESTED-LOOP ANTI JOIN | |1 |92 | -|15| TABLE SCAN |t1 |6 |46 | -|16| MATERIAL | |6 |46 | -|17| TABLE SCAN |t2 |6 |46 | -========================================================= +======================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------- +|0 |DELETE | |1 |240 | +|1 | SUBPLAN FILTER | |1 |229 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |183 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | +|6 | SUBPLAN SCAN |VIEW1|1 |92 | +|7 | LIMIT | |1 |92 | +|8 | NESTED-LOOP ANTI JOIN | |1 |92 | +|9 | TABLE SCAN |t1 |6 |46 | +|10| MATERIAL | |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | +|12| MATERIAL | |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t3 |1 |46 | +|15| MATERIAL | |1 |46 | +|16| SUBPLAN SCAN |VIEW3|1 |46 | +|17| TABLE SCAN |t4 |1 |46 | +======================================================== Outputs & filters: ------------------------------------- @@ -37125,30 +37147,30 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 7 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 8 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 9 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + access([VIEW1.t1.c1]) + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, + conds([t1.c1 != t2.c1]), nl_params_(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256 + 11 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, access(nil) - 10 - output([1]), filter(nil), rowset=256, + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 15 - output(nil), filter(nil), rowset=256 + 16 - output(nil), filter(nil), rowset=256, + access(nil) + 17 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 11 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256, - access([VIEW1.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 16 - output([t2.c1]), filter(nil), rowset=256 - 17 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0 limit 1); EXPLAIN select stddev(c2) from t1; @@ -37179,14 +37201,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |296 | -|1 | SUBPLAN FILTER | |1 |284 | +|0 |DELETE | |1 |297 | +|1 | SUBPLAN FILTER | |1 |285 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -37293,10 +37315,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |240 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |242 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -37335,7 +37357,7 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |3 |203 | +|0 |INSERT | |3 |204 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |183 | |2 | NESTED-LOOP JOIN CARTESIAN | |3 |183 | |3 | TABLE SCAN |t4 |6 |46 | @@ -37382,12 +37404,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |247 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |240 | -|2 | NESTED-LOOP OUTER JOIN | |0 |240 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |249 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |242 | +|2 | NESTED-LOOP OUTER JOIN | |0 |242 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -37426,28 +37448,28 @@ insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 != rollback; EXPLAIN update t1 set c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL limit 1); Query Plan -========================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |UPDATE | |6 |298 | -|1 | SUBPLAN FILTER | |6 |228 | -|2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |183 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | -|5 | SUBPLAN SCAN |VIEW3|1 |46 | -|6 | TABLE SCAN |t4 |1 |46 | -|7 | MATERIAL | |1 |138 | -|8 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|9 | SUBPLAN SCAN |VIEW2|1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |92 | -|12| SUBPLAN SCAN |VIEW1|1 |92 | -|13| LIMIT | |1 |92 | -|14| NESTED-LOOP ANTI JOIN | |1 |92 | -|15| TABLE SCAN |t1 |6 |46 | -|16| MATERIAL | |6 |46 | -|17| TABLE SCAN |t2 |6 |46 | -========================================================= +======================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------- +|0 |UPDATE | |6 |298 | +|1 | SUBPLAN FILTER | |6 |228 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | LIMIT | |1 |183 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | +|6 | SUBPLAN SCAN |VIEW1|1 |92 | +|7 | LIMIT | |1 |92 | +|8 | NESTED-LOOP ANTI JOIN | |1 |92 | +|9 | TABLE SCAN |t1 |6 |46 | +|10| MATERIAL | |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | +|12| MATERIAL | |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t3 |1 |46 | +|15| MATERIAL | |1 |46 | +|16| SUBPLAN SCAN |VIEW3|1 |46 | +|17| TABLE SCAN |t4 |1 |46 | +======================================================== Outputs & filters: ------------------------------------- @@ -37460,30 +37482,30 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 7 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 8 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 9 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + access([VIEW1.t1.c1]) + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, + conds([t1.c1 != t2.c1]), nl_params_(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256 + 11 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, access(nil) - 10 - output([1]), filter(nil), rowset=256, + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 15 - output(nil), filter(nil), rowset=256 + 16 - output(nil), filter(nil), rowset=256, + access(nil) + 17 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 11 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256, - access([VIEW1.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 16 - output([t2.c1]), filter(nil), rowset=256 - 17 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL limit 1); EXPLAIN select stddev(c2) from t1; @@ -37515,13 +37537,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- |0 |UPDATE | |6 |354 | -|1 | SUBPLAN FILTER | |6 |284 | +|1 | SUBPLAN FILTER | |6 |285 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -37583,28 +37605,28 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL limit 1); Query Plan -========================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |DELETE | |1 |240 | -|1 | SUBPLAN FILTER | |1 |228 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |183 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | -|5 | SUBPLAN SCAN |VIEW3|1 |46 | -|6 | TABLE SCAN |t4 |1 |46 | -|7 | MATERIAL | |1 |138 | -|8 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | -|9 | SUBPLAN SCAN |VIEW2|1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |92 | -|12| SUBPLAN SCAN |VIEW1|1 |92 | -|13| LIMIT | |1 |92 | -|14| NESTED-LOOP ANTI JOIN | |1 |92 | -|15| TABLE SCAN |t1 |6 |46 | -|16| MATERIAL | |6 |46 | -|17| TABLE SCAN |t2 |6 |46 | -========================================================= +======================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------- +|0 |DELETE | |1 |240 | +|1 | SUBPLAN FILTER | |1 |229 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |183 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |183 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |138 | +|6 | SUBPLAN SCAN |VIEW1|1 |92 | +|7 | LIMIT | |1 |92 | +|8 | NESTED-LOOP ANTI JOIN | |1 |92 | +|9 | TABLE SCAN |t1 |6 |46 | +|10| MATERIAL | |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | +|12| MATERIAL | |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t3 |1 |46 | +|15| MATERIAL | |1 |46 | +|16| SUBPLAN SCAN |VIEW3|1 |46 | +|17| TABLE SCAN |t4 |1 |46 | +======================================================== Outputs & filters: ------------------------------------- @@ -37616,30 +37638,30 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 7 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 8 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 9 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + access([VIEW1.t1.c1]) + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, + conds([t1.c1 != t2.c1]), nl_params_(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256 + 11 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, access(nil) - 10 - output([1]), filter(nil), rowset=256, + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 15 - output(nil), filter(nil), rowset=256 + 16 - output(nil), filter(nil), rowset=256, + access(nil) + 17 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 11 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256, - access([VIEW1.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, - conds([t1.c1 != t2.c1]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 16 - output([t2.c1]), filter(nil), rowset=256 - 17 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL limit 1); EXPLAIN select stddev(c2) from t1; @@ -37670,14 +37692,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |296 | -|1 | SUBPLAN FILTER | |1 |284 | +|0 |DELETE | |1 |297 | +|1 | SUBPLAN FILTER | |1 |285 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |239 | -|4 | NESTED-LOOP OUTER JOIN | |0 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |240 | +|4 | NESTED-LOOP OUTER JOIN | |0 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -37784,10 +37806,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |240 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |1 |242 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -37826,7 +37848,7 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |3 |203 | +|0 |INSERT | |3 |204 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |183 | |2 | NESTED-LOOP JOIN CARTESIAN | |3 |183 | |3 | TABLE SCAN |t4 |6 |46 | @@ -37873,12 +37895,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |247 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |240 | -|2 | NESTED-LOOP OUTER JOIN | |1 |240 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |1 |249 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |242 | +|2 | NESTED-LOOP OUTER JOIN | |1 |242 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -38001,13 +38023,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- |0 |UPDATE | |6 |354 | -|1 | SUBPLAN FILTER | |6 |284 | +|1 | SUBPLAN FILTER | |6 |285 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |239 | -|4 | NESTED-LOOP OUTER JOIN | |1 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |1 |240 | +|4 | NESTED-LOOP OUTER JOIN | |1 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -38151,14 +38173,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |296 | -|1 | SUBPLAN FILTER | |1 |284 | +|0 |DELETE | |1 |297 | +|1 | SUBPLAN FILTER | |1 |285 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |239 | -|4 | NESTED-LOOP OUTER JOIN | |1 |239 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |1 |240 | +|4 | NESTED-LOOP OUTER JOIN | |1 |240 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -38268,10 +38290,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |237 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |239 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -38360,12 +38382,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |243 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |237 | -|2 | NESTED-LOOP OUTER JOIN | |0 |237 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |239 | +|2 | NESTED-LOOP OUTER JOIN | |0 |239 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -38408,11 +38430,11 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------- |0 |UPDATE | |6 |304 | -|1 | SUBPLAN FILTER | |6 |234 | +|1 | SUBPLAN FILTER | |6 |235 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |189 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |189 | -|5 | NESTED-LOOP ANTI JOIN | |1 |143 | +|5 | NESTED-LOOP ANTI JOIN | |1 |144 | |6 | TABLE SCAN |t1 |6 |46 | |7 | MATERIAL | |30 |93 | |8 | SUBPLAN SCAN |VIEW1|30 |93 | @@ -38482,14 +38504,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |350 | +|0 |UPDATE | |6 |351 | |1 | SUBPLAN FILTER | |6 |281 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -38555,11 +38577,11 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------- |0 |DELETE | |1 |246 | -|1 | SUBPLAN FILTER | |1 |234 | +|1 | SUBPLAN FILTER | |1 |235 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |189 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |189 | -|5 | NESTED-LOOP ANTI JOIN | |1 |143 | +|5 | NESTED-LOOP ANTI JOIN | |1 |144 | |6 | TABLE SCAN |t1 |6 |46 | |7 | MATERIAL | |30 |93 | |8 | SUBPLAN SCAN |VIEW1|30 |93 | @@ -38628,14 +38650,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |292 | -|1 | SUBPLAN FILTER | |1 |281 | +|0 |DELETE | |1 |293 | +|1 | SUBPLAN FILTER | |1 |282 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -38705,32 +38727,32 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |3 | TABLE SCAN |t2 |6 |46 | |4 | MATERIAL | |6 |46 | -|5 | TABLE SCAN |t3 |6 |46 | +|5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t4 |6 |46 | +|7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t4 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 2 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 5 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0; +----+------+----+------+------+----+------+------+----+------+------+ @@ -38742,10 +38764,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |237 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |239 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -38784,18 +38806,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | |4 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |5 | TABLE SCAN |t2 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t3 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t4 |6 |46 | +|9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t4 |6 |46 | ================================================================== Outputs & filters: @@ -38807,21 +38829,21 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 4 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 5 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 9 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 10 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 11 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0); @@ -38831,12 +38853,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |243 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |237 | -|2 | NESTED-LOOP OUTER JOIN | |0 |237 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |239 | +|2 | NESTED-LOOP OUTER JOIN | |0 |239 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -38966,14 +38988,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |350 | +|0 |UPDATE | |6 |351 | |1 | SUBPLAN FILTER | |6 |281 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -39125,14 +39147,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |292 | -|1 | SUBPLAN FILTER | |1 |281 | +|0 |DELETE | |1 |293 | +|1 | SUBPLAN FILTER | |1 |282 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -39202,32 +39224,32 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |3 | TABLE SCAN |t2 |6 |46 | |4 | MATERIAL | |6 |46 | -|5 | TABLE SCAN |t3 |6 |46 | +|5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t4 |6 |46 | +|7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t4 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 2 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 5 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL; +----+------+----+------+------+----+------+------+----+------+------+ @@ -39239,10 +39261,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |237 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |0 |239 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -39281,18 +39303,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | |4 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |5 | TABLE SCAN |t2 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t3 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t4 |6 |46 | +|9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t4 |6 |46 | ================================================================== Outputs & filters: @@ -39304,21 +39326,21 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 4 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 5 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 9 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 10 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 11 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL); @@ -39328,12 +39350,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |0 |243 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |237 | -|2 | NESTED-LOOP OUTER JOIN | |0 |237 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |0 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |239 | +|2 | NESTED-LOOP OUTER JOIN | |0 |239 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -39463,14 +39485,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |350 | +|0 |UPDATE | |6 |351 | |1 | SUBPLAN FILTER | |6 |281 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -39622,14 +39644,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |292 | -|1 | SUBPLAN FILTER | |1 |281 | +|0 |DELETE | |1 |293 | +|1 | SUBPLAN FILTER | |1 |282 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |235 | -|4 | NESTED-LOOP OUTER JOIN | |0 |235 | -|5 | NESTED-LOOP OUTER JOIN | |150 |147 | +|3 | LIMIT | |0 |236 | +|4 | NESTED-LOOP OUTER JOIN | |0 |236 | +|5 | NESTED-LOOP OUTER JOIN | |150 |148 | |6 | TABLE SCAN |t1 |6 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -39699,32 +39721,32 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |3 | TABLE SCAN |t2 |6 |46 | |4 | MATERIAL | |6 |46 | -|5 | TABLE SCAN |t3 |6 |46 | +|5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t4 |6 |46 | +|7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t4 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 2 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 5 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0; +----+------+----+------+------+----+------+------+----+------+------+ @@ -39736,10 +39758,10 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |4 |237 | -|1 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |NESTED-LOOP OUTER JOIN | |4 |239 | +|1 | NESTED-LOOP OUTER JOIN | |150 |150 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | MATERIAL | |30 |94 | +|3 | MATERIAL | |30 |96 | |4 | NESTED-LOOP OUTER JOIN| |30 |93 | |5 | TABLE SCAN |t3 |6 |46 | |6 | MATERIAL | |6 |46 | @@ -39778,18 +39800,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | |4 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |5 | TABLE SCAN |t2 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t3 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t4 |6 |46 | +|9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t4 |6 |46 | ================================================================== Outputs & filters: @@ -39801,21 +39823,21 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 4 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 5 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 9 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 10 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 11 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 != t2.c1) left join (t3 left join t4 on t4.c1 != t3.c1) on t1.c1 != t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0); @@ -39825,12 +39847,12 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |4 |265 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |237 | -|2 | NESTED-LOOP OUTER JOIN | |4 |237 | -|3 | NESTED-LOOP OUTER JOIN | |150 |148 | +|0 |INSERT | |4 |267 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |239 | +|2 | NESTED-LOOP OUTER JOIN | |4 |239 | +|3 | NESTED-LOOP OUTER JOIN | |150 |150 | |4 | TABLE SCAN |t1 |6 |46 | -|5 | MATERIAL | |30 |94 | +|5 | MATERIAL | |30 |96 | |6 | NESTED-LOOP OUTER JOIN| |30 |93 | |7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | @@ -39949,14 +39971,14 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |UPDATE | |6 |313 | -|1 | SUBPLAN FILTER | |6 |244 | +|0 |UPDATE | |6 |314 | +|1 | SUBPLAN FILTER | |6 |245 | |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |199 | |4 | NESTED-LOOP OUTER JOIN | |1 |199 | -|5 | NESTED-LOOP OUTER JOIN | |44 |141 | +|5 | NESTED-LOOP OUTER JOIN | |44 |142 | |6 | TABLE SCAN |t1 |2 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -40098,13 +40120,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- |0 |DELETE | |1 |256 | -|1 | SUBPLAN FILTER | |1 |244 | +|1 | SUBPLAN FILTER | |1 |245 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |199 | |4 | NESTED-LOOP OUTER JOIN | |1 |199 | -|5 | NESTED-LOOP OUTER JOIN | |44 |141 | +|5 | NESTED-LOOP OUTER JOIN | |44 |142 | |6 | TABLE SCAN |t1 |2 |46 | -|7 | MATERIAL | |30 |93 | +|7 | MATERIAL | |30 |94 | |8 | NESTED-LOOP OUTER JOIN| |30 |93 | |9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | @@ -40209,8 +40231,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -40291,10 +40313,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |189 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |190 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -40406,8 +40428,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -40539,11 +40561,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -40607,10 +40629,10 @@ Query Plan ===================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- -|0 |NESTED-LOOP JOIN CARTESIAN | |180 |191 | +|0 |NESTED-LOOP JOIN CARTESIAN | |180 |192 | |1 | NESTED-LOOP JOIN CARTESIAN| |30 |138 | |2 | TABLE SCAN |t3 |6 |46 | -|3 | MATERIAL | |5 |91 | +|3 | MATERIAL | |5 |92 | |4 | NESTED-LOOP ANTI JOIN | |5 |91 | |5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |1 |46 | @@ -40653,8 +40675,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -40692,11 +40714,11 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- |0 |INSERT | |180 |1338| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|180 |191 | -|2 | NESTED-LOOP JOIN CARTESIAN | |180 |191 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|180 |192 | +|2 | NESTED-LOOP JOIN CARTESIAN | |180 |192 | |3 | NESTED-LOOP JOIN CARTESIAN| |30 |138 | |4 | TABLE SCAN |t3 |6 |46 | -|5 | MATERIAL | |5 |91 | +|5 | MATERIAL | |5 |92 | |6 | NESTED-LOOP ANTI JOIN | |5 |91 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |1 |46 | @@ -40742,10 +40764,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -40790,20 +40812,20 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |182 | |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | -|5 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | TABLE SCAN |t3 |1 |46 | -|8 | MATERIAL | |1 |46 | -|9 | SUBPLAN SCAN |VIEW4|1 |46 | -|10| TABLE SCAN |t4 |1 |46 | -|11| MATERIAL | |1 |91 | -|12| SUBPLAN SCAN |VIEW2|1 |91 | -|13| LIMIT | |1 |91 | -|14| NESTED-LOOP ANTI JOIN | |2 |91 | -|15| TABLE SCAN |t1 |2 |46 | -|16| MATERIAL | |1 |46 | -|17| SUBPLAN SCAN |VIEW1|1 |46 | -|18| TABLE GET |t2 |1 |46 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |137 | +|6 | SUBPLAN SCAN |VIEW2|1 |91 | +|7 | LIMIT | |1 |91 | +|8 | NESTED-LOOP ANTI JOIN | |2 |91 | +|9 | TABLE SCAN |t1 |2 |46 | +|10| MATERIAL | |1 |46 | +|11| SUBPLAN SCAN |VIEW1|1 |46 | +|12| TABLE GET |t2 |1 |46 | +|13| MATERIAL | |1 |46 | +|14| SUBPLAN SCAN |VIEW3|1 |46 | +|15| TABLE SCAN |t3 |1 |46 | +|16| MATERIAL | |1 |46 | +|17| SUBPLAN SCAN |VIEW4|1 |46 | +|18| TABLE SCAN |t4 |1 |46 | ======================================================== Outputs & filters: @@ -40817,27 +40839,27 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, - access(nil) - 7 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 8 - output(nil), filter(nil), rowset=256 - 9 - output(nil), filter(nil), rowset=256, - access(nil) - 10 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 0]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, + 9 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256 + 14 - output(nil), filter(nil), rowset=256, + access(nil) + 15 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter(nil), rowset=256, access(nil) @@ -40877,8 +40899,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -40947,20 +40969,20 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |182 | |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | -|5 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | TABLE SCAN |t3 |1 |46 | -|8 | MATERIAL | |1 |46 | -|9 | SUBPLAN SCAN |VIEW4|1 |46 | -|10| TABLE SCAN |t4 |1 |46 | -|11| MATERIAL | |1 |91 | -|12| SUBPLAN SCAN |VIEW2|1 |91 | -|13| LIMIT | |1 |91 | -|14| NESTED-LOOP ANTI JOIN | |2 |91 | -|15| TABLE SCAN |t1 |2 |46 | -|16| MATERIAL | |1 |46 | -|17| SUBPLAN SCAN |VIEW1|1 |46 | -|18| TABLE GET |t2 |1 |46 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |137 | +|6 | SUBPLAN SCAN |VIEW2|1 |91 | +|7 | LIMIT | |1 |91 | +|8 | NESTED-LOOP ANTI JOIN | |2 |91 | +|9 | TABLE SCAN |t1 |2 |46 | +|10| MATERIAL | |1 |46 | +|11| SUBPLAN SCAN |VIEW1|1 |46 | +|12| TABLE GET |t2 |1 |46 | +|13| MATERIAL | |1 |46 | +|14| SUBPLAN SCAN |VIEW3|1 |46 | +|15| TABLE SCAN |t3 |1 |46 | +|16| MATERIAL | |1 |46 | +|17| SUBPLAN SCAN |VIEW4|1 |46 | +|18| TABLE SCAN |t4 |1 |46 | ======================================================== Outputs & filters: @@ -40973,27 +40995,27 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, - access(nil) - 7 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 8 - output(nil), filter(nil), rowset=256 - 9 - output(nil), filter(nil), rowset=256, - access(nil) - 10 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 0]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, + 9 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256 + 14 - output(nil), filter(nil), rowset=256, + access(nil) + 15 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter(nil), rowset=256, access(nil) @@ -41030,11 +41052,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -41098,10 +41120,10 @@ Query Plan ===================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- -|0 |NESTED-LOOP JOIN CARTESIAN | |180 |191 | +|0 |NESTED-LOOP JOIN CARTESIAN | |180 |192 | |1 | NESTED-LOOP JOIN CARTESIAN| |30 |138 | |2 | TABLE SCAN |t3 |6 |46 | -|3 | MATERIAL | |5 |91 | +|3 | MATERIAL | |5 |92 | |4 | NESTED-LOOP ANTI JOIN | |5 |91 | |5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |1 |46 | @@ -41144,8 +41166,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -41183,11 +41205,11 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- |0 |INSERT | |180 |1338| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|180 |191 | -|2 | NESTED-LOOP JOIN CARTESIAN | |180 |191 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|180 |192 | +|2 | NESTED-LOOP JOIN CARTESIAN | |180 |192 | |3 | NESTED-LOOP JOIN CARTESIAN| |30 |138 | |4 | TABLE SCAN |t3 |6 |46 | -|5 | MATERIAL | |5 |91 | +|5 | MATERIAL | |5 |92 | |6 | NESTED-LOOP ANTI JOIN | |5 |91 | |7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |1 |46 | @@ -41233,10 +41255,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -41281,20 +41303,20 @@ Query Plan |2 | TABLE SCAN |t1 |6 |46 | |3 | LIMIT | |1 |182 | |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | -|5 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | TABLE SCAN |t3 |1 |46 | -|8 | MATERIAL | |1 |46 | -|9 | SUBPLAN SCAN |VIEW4|1 |46 | -|10| TABLE SCAN |t4 |1 |46 | -|11| MATERIAL | |1 |91 | -|12| SUBPLAN SCAN |VIEW2|1 |91 | -|13| LIMIT | |1 |91 | -|14| NESTED-LOOP ANTI JOIN | |2 |91 | -|15| TABLE SCAN |t1 |2 |46 | -|16| MATERIAL | |1 |46 | -|17| SUBPLAN SCAN |VIEW1|1 |46 | -|18| TABLE GET |t2 |1 |46 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |137 | +|6 | SUBPLAN SCAN |VIEW2|1 |91 | +|7 | LIMIT | |1 |91 | +|8 | NESTED-LOOP ANTI JOIN | |2 |91 | +|9 | TABLE SCAN |t1 |2 |46 | +|10| MATERIAL | |1 |46 | +|11| SUBPLAN SCAN |VIEW1|1 |46 | +|12| TABLE GET |t2 |1 |46 | +|13| MATERIAL | |1 |46 | +|14| SUBPLAN SCAN |VIEW3|1 |46 | +|15| TABLE SCAN |t3 |1 |46 | +|16| MATERIAL | |1 |46 | +|17| SUBPLAN SCAN |VIEW4|1 |46 | +|18| TABLE SCAN |t4 |1 |46 | ======================================================== Outputs & filters: @@ -41308,27 +41330,27 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, - access(nil) - 7 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 8 - output(nil), filter(nil), rowset=256 - 9 - output(nil), filter(nil), rowset=256, - access(nil) - 10 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 0]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, + 9 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256 + 14 - output(nil), filter(nil), rowset=256, + access(nil) + 15 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter(nil), rowset=256, access(nil) @@ -41368,8 +41390,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -41438,20 +41460,20 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |182 | |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | -|5 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|6 | SUBPLAN SCAN |VIEW3|1 |46 | -|7 | TABLE SCAN |t3 |1 |46 | -|8 | MATERIAL | |1 |46 | -|9 | SUBPLAN SCAN |VIEW4|1 |46 | -|10| TABLE SCAN |t4 |1 |46 | -|11| MATERIAL | |1 |91 | -|12| SUBPLAN SCAN |VIEW2|1 |91 | -|13| LIMIT | |1 |91 | -|14| NESTED-LOOP ANTI JOIN | |2 |91 | -|15| TABLE SCAN |t1 |2 |46 | -|16| MATERIAL | |1 |46 | -|17| SUBPLAN SCAN |VIEW1|1 |46 | -|18| TABLE GET |t2 |1 |46 | +|5 | NESTED-LOOP JOIN CARTESIAN| |1 |137 | +|6 | SUBPLAN SCAN |VIEW2|1 |91 | +|7 | LIMIT | |1 |91 | +|8 | NESTED-LOOP ANTI JOIN | |2 |91 | +|9 | TABLE SCAN |t1 |2 |46 | +|10| MATERIAL | |1 |46 | +|11| SUBPLAN SCAN |VIEW1|1 |46 | +|12| TABLE GET |t2 |1 |46 | +|13| MATERIAL | |1 |46 | +|14| SUBPLAN SCAN |VIEW3|1 |46 | +|15| TABLE SCAN |t3 |1 |46 | +|16| MATERIAL | |1 |46 | +|17| SUBPLAN SCAN |VIEW4|1 |46 | +|18| TABLE SCAN |t4 |1 |46 | ======================================================== Outputs & filters: @@ -41464,27 +41486,27 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), startup_filter([0]), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, - access(nil) - 7 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 8 - output(nil), filter(nil), rowset=256 - 9 - output(nil), filter(nil), rowset=256, - access(nil) - 10 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 14 - output([t1.c1]), filter(nil), rowset=256, + 7 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 8 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 0]), nl_params_(nil) - 15 - output([t1.c1]), filter(nil), rowset=256, + 9 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256 + 14 - output(nil), filter(nil), rowset=256, + access(nil) + 15 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter(nil), rowset=256, access(nil) @@ -41521,11 +41543,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -41628,8 +41650,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -41710,10 +41732,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -41825,8 +41847,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -41958,11 +41980,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -42065,8 +42087,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -42147,10 +42169,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -42262,8 +42284,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -42395,11 +42417,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -42468,32 +42490,32 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |3 | TABLE SCAN |t2 |6 |46 | |4 | MATERIAL | |6 |46 | -|5 | TABLE SCAN |t3 |6 |46 | +|5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t4 |6 |46 | +|7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t4 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 2 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 5 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) select * from (t1 full join t2 on t1.c1 = t2.c1) left join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0; +----+------+----+------+------+----+------+------+----+------+------+ @@ -42505,8 +42527,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -42543,18 +42565,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | |4 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |5 | TABLE SCAN |t2 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t3 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t4 |6 |46 | +|9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t4 |6 |46 | ================================================================== Outputs & filters: @@ -42566,21 +42588,21 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 4 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 5 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 9 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 10 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 11 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) insert into t7_temp (select * from (t1 full join t2 on t1.c1 = t2.c1) left join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0); @@ -42590,10 +42612,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -42640,11 +42662,11 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t2 |1 |46 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t1 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t2 |1 |46 | |12| MATERIAL | |1 |46 | |13| SUBPLAN SCAN |VIEW3|1 |46 | |14| TABLE SCAN |t3 |1 |46 | @@ -42668,17 +42690,17 @@ Outputs & filters: conds(nil), nl_params_(nil) 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 9 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 10 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 11 - output([t1.c1]), filter(nil), rowset=256, + 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 9 - output(nil), filter(nil), rowset=256 + 10 - output(nil), filter(nil), rowset=256, + access(nil) + 11 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 12 - output(nil), filter(nil), rowset=256 13 - output(nil), filter(nil), rowset=256, access(nil) @@ -42724,8 +42746,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -42796,11 +42818,11 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t2 |1 |46 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t1 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t2 |1 |46 | |12| MATERIAL | |1 |46 | |13| SUBPLAN SCAN |VIEW3|1 |46 | |14| TABLE SCAN |t3 |1 |46 | @@ -42823,17 +42845,17 @@ Outputs & filters: conds(nil), nl_params_(nil) 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 9 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 10 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 11 - output([t1.c1]), filter(nil), rowset=256, + 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 9 - output(nil), filter(nil), rowset=256 + 10 - output(nil), filter(nil), rowset=256, + access(nil) + 11 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 12 - output(nil), filter(nil), rowset=256 13 - output(nil), filter(nil), rowset=256, access(nil) @@ -42876,11 +42898,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -42949,32 +42971,32 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |3 | TABLE SCAN |t2 |6 |46 | |4 | MATERIAL | |6 |46 | -|5 | TABLE SCAN |t3 |6 |46 | +|5 | TABLE SCAN |t1 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t4 |6 |46 | +|7 | TABLE SCAN |t3 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t4 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 2 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 5 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) select * from (t1 full join t2 on t1.c1 = t2.c1) left join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL; +----+------+----+------+------+----+------+------+----+------+------+ @@ -42986,8 +43008,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -43024,18 +43046,18 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | |4 | NESTED-LOOP JOIN CARTESIAN| |36 |93 | |5 | TABLE SCAN |t2 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t3 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t4 |6 |46 | +|9 | TABLE SCAN |t3 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t4 |6 |46 | ================================================================== Outputs & filters: @@ -43047,21 +43069,21 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 4 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 5 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 - 7 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, - access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) - 8 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 - 9 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, - access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256 + 9 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, + access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) + 10 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 + 11 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) insert into t7_temp (select * from (t1 full join t2 on t1.c1 = t2.c1) left join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL); @@ -43071,10 +43093,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -43121,11 +43143,11 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t2 |1 |46 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t1 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t2 |1 |46 | |12| MATERIAL | |1 |46 | |13| SUBPLAN SCAN |VIEW3|1 |46 | |14| TABLE SCAN |t3 |1 |46 | @@ -43149,17 +43171,17 @@ Outputs & filters: conds(nil), nl_params_(nil) 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 9 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 10 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 11 - output([t1.c1]), filter(nil), rowset=256, + 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 9 - output(nil), filter(nil), rowset=256 + 10 - output(nil), filter(nil), rowset=256, + access(nil) + 11 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 12 - output(nil), filter(nil), rowset=256 13 - output(nil), filter(nil), rowset=256, access(nil) @@ -43205,8 +43227,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -43277,11 +43299,11 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t2 |1 |46 | +|7 | SUBPLAN SCAN |VIEW2|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t1 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t2 |1 |46 | |12| MATERIAL | |1 |46 | |13| SUBPLAN SCAN |VIEW3|1 |46 | |14| TABLE SCAN |t3 |1 |46 | @@ -43304,17 +43326,17 @@ Outputs & filters: conds(nil), nl_params_(nil) 6 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), - limit(1), offset(nil) - 9 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 10 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 7 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 11 - output([t1.c1]), filter(nil), rowset=256, + 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 9 - output(nil), filter(nil), rowset=256 + 10 - output(nil), filter(nil), rowset=256, + access(nil) + 11 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), + limit(1), offset(nil) 12 - output(nil), filter(nil), rowset=256 13 - output(nil), filter(nil), rowset=256, access(nil) @@ -43357,11 +43379,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -43461,8 +43483,8 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |MERGE FULL OUTER JOIN | |1 |182 | -|1 | MERGE OUTER JOIN | |6 |136 | +|0 |MERGE FULL OUTER JOIN | |1 |183 | +|1 | MERGE OUTER JOIN | |6 |137 | |2 | TABLE SCAN |t1 |6 |46 | |3 | SORT | |6 |90 | |4 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -43540,10 +43562,10 @@ Query Plan =============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------------------- -|0 |INSERT | |1 |188 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |182 | -|2 | MERGE FULL OUTER JOIN | |1 |182 | -|3 | MERGE OUTER JOIN | |6 |136 | +|0 |INSERT | |1 |189 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |183 | +|2 | MERGE FULL OUTER JOIN | |1 |183 | +|3 | MERGE OUTER JOIN | |6 |137 | |4 | TABLE SCAN |t1 |6 |46 | |5 | SORT | |6 |90 | |6 | NESTED-LOOP OUTER JOIN| |6 |89 | @@ -43652,8 +43674,8 @@ Query Plan |0 |UPDATE | |6 |302 | |1 | SUBPLAN FILTER | |6 |233 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -43782,11 +43804,11 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |244 | +|0 |DELETE | |1 |245 | |1 | SUBPLAN FILTER | |1 |233 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | MERGE FULL OUTER JOIN | |1 |187 | +|3 | LIMIT | |1 |188 | +|4 | MERGE FULL OUTER JOIN | |1 |188 | |5 | MERGE OUTER JOIN | |6 |142 | |6 | TABLE SCAN |t1 |6 |46 | |7 | SORT | |6 |96 | @@ -43847,18 +43869,17 @@ rollback; EXPLAIN select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -43866,16 +43887,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL; @@ -43885,18 +43905,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -43904,16 +43923,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL; @@ -43923,20 +43941,19 @@ select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -43949,16 +43966,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL); @@ -43966,20 +43982,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -43992,16 +44007,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 is NULL); @@ -44015,14 +44029,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44039,15 +44053,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44083,14 +44097,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44107,15 +44121,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44148,17 +44162,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44174,15 +44188,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44215,17 +44229,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44241,15 +44255,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44320,18 +44334,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -44339,16 +44352,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0; @@ -44361,7 +44373,7 @@ Query Plan ========================================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------------- -|0 |INSERT | |36 |419 | +|0 |INSERT | |36 |420 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|36 |185 | |2 | NESTED-LOOP JOIN CARTESIAN | |36 |185 | |3 | NESTED-LOOP OUTER JOIN | |6 |138 | @@ -44403,20 +44415,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -44429,16 +44440,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 is NULL and t4.c1 = 0); @@ -44535,14 +44545,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44559,15 +44569,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44682,17 +44692,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -44708,15 +44718,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -44786,18 +44796,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -44805,16 +44814,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL; @@ -44868,20 +44876,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -44894,16 +44901,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 is NULL); @@ -44986,14 +44992,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -45010,15 +45016,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -45119,17 +45125,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -45145,15 +45151,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -45220,18 +45226,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 = 0; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |1 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -45239,16 +45244,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 = 0; @@ -45299,20 +45303,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 = 0); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |1 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |179 | -|2 | NESTED-LOOP OUTER JOIN | |1 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |1 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |180 | +|2 | NESTED-LOOP OUTER JOIN | |1 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -45325,16 +45328,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 is NULL and t3.c1 = 0 and t4.c1 = 0); @@ -45414,14 +45416,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |191 | -|4 | NESTED-LOOP OUTER JOIN | |1 |191 | +|3 | LIMIT | |1 |192 | +|4 | NESTED-LOOP OUTER JOIN | |1 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -45438,15 +45440,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -45544,17 +45546,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |191 | -|4 | NESTED-LOOP OUTER JOIN | |1 |191 | +|3 | LIMIT | |1 |192 | +|4 | NESTED-LOOP OUTER JOIN | |1 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -45570,15 +45572,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -45648,18 +45650,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 is NULL; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -45667,16 +45668,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 is NULL; @@ -45730,20 +45730,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 is NULL); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -45756,16 +45755,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 is NULL); @@ -45848,14 +45846,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -45872,15 +45870,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -45981,17 +45979,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -46007,15 +46005,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -46056,16 +46054,16 @@ Query Plan |4 | MATERIAL | |6 |46 | |5 | TABLE SCAN |t4 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t2 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) @@ -46074,12 +46072,12 @@ Outputs & filters: 4 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, - access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 + 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0; +----+------+----+------+------+----+------+------+----+------+------+ @@ -46088,18 +46086,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -46107,16 +46104,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0; @@ -46129,7 +46125,7 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | @@ -46138,9 +46134,9 @@ Query Plan |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t4 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t2 |6 |46 | +|9 | TABLE SCAN |t1 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | ================================================================== Outputs & filters: @@ -46152,7 +46148,7 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) @@ -46161,32 +46157,31 @@ Outputs & filters: 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, - access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 10 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 + 11 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0); rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -46199,16 +46194,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 is NULL and t4.c1 = 0); @@ -46226,14 +46220,14 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t3 |1 |46 | +|7 | SUBPLAN SCAN |VIEW3|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t3 |1 |46 | |12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW3|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t4 |1 |46 | |15| MATERIAL | |1 |46 | |16| SUBPLAN SCAN |VIEW4|1 |46 | |17| TABLE SCAN |t2 |1 |46 | @@ -46252,12 +46246,12 @@ Outputs & filters: conds(nil), nl_params_(nil) 5 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), + 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + access([VIEW3.t1.c1]) + 8 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0), limit(1), offset(nil) 9 - output(nil), filter(nil), rowset=256 10 - output(nil), filter(nil), rowset=256, @@ -46265,11 +46259,11 @@ Outputs & filters: 11 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 12 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256, - access([VIEW3.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0), + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, + access(nil) + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), limit(1), offset(nil) 15 - output(nil), filter(nil), rowset=256 16 - output(nil), filter(nil), rowset=256, @@ -46310,14 +46304,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -46334,15 +46328,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -46382,14 +46376,14 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t3 |1 |46 | +|7 | SUBPLAN SCAN |VIEW3|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t3 |1 |46 | |12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW3|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t4 |1 |46 | |15| MATERIAL | |1 |46 | |16| SUBPLAN SCAN |VIEW4|1 |46 | |17| TABLE SCAN |t2 |1 |46 | @@ -46407,12 +46401,12 @@ Outputs & filters: conds(nil), nl_params_(nil) 5 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), + 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + access([VIEW3.t1.c1]) + 8 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0), limit(1), offset(nil) 9 - output(nil), filter(nil), rowset=256 10 - output(nil), filter(nil), rowset=256, @@ -46420,11 +46414,11 @@ Outputs & filters: 11 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 12 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256, - access([VIEW3.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0), + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, + access(nil) + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), limit(1), offset(nil) 15 - output(nil), filter(nil), rowset=256 16 - output(nil), filter(nil), rowset=256, @@ -46462,17 +46456,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -46488,15 +46482,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -46537,16 +46531,16 @@ Query Plan |4 | MATERIAL | |6 |46 | |5 | TABLE SCAN |t4 |6 |46 | |6 | MATERIAL | |6 |46 | -|7 | TABLE SCAN |t2 |6 |46 | +|7 | TABLE SCAN |t1 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t1 |6 |46 | +|9 | TABLE SCAN |t2 |6 |46 | ===================================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), startup_filter([0]), rowset=256, conds(nil), nl_params_(nil) - 1 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) @@ -46555,12 +46549,12 @@ Outputs & filters: 4 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, - access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 + 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL; +----+------+----+------+------+----+------+------+----+------+------+ @@ -46569,18 +46563,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |0 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |0 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -46588,16 +46581,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL; @@ -46610,7 +46602,7 @@ Query Plan ================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------ -|0 |INSERT | |1296 |8461| +|0 |INSERT | |1296 |8462| |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1296 |250 | |2 | NESTED-LOOP JOIN CARTESIAN | |1296 |249 | |3 | NESTED-LOOP JOIN CARTESIAN | |216 |148 | @@ -46619,9 +46611,9 @@ Query Plan |6 | MATERIAL | |6 |46 | |7 | TABLE SCAN |t4 |6 |46 | |8 | MATERIAL | |6 |46 | -|9 | TABLE SCAN |t2 |6 |46 | +|9 | TABLE SCAN |t1 |6 |46 | |10| MATERIAL | |6 |46 | -|11| TABLE SCAN |t1 |6 |46 | +|11| TABLE SCAN |t2 |6 |46 | ================================================================== Outputs & filters: @@ -46633,7 +46625,7 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c3]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 3 - output([t2.c1], [t2.c2], [t2.c3], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, + 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_(nil) @@ -46642,32 +46634,31 @@ Outputs & filters: 6 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, - access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) - 10 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 - 11 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256 + 9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) + 10 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256 + 11 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + access([t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL); rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |0 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |179 | -|2 | NESTED-LOOP OUTER JOIN | |0 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |0 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|0 |180 | +|2 | NESTED-LOOP OUTER JOIN | |0 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -46680,16 +46671,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 IS NULL); @@ -46707,14 +46697,14 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t3 |1 |46 | +|7 | SUBPLAN SCAN |VIEW3|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t3 |1 |46 | |12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW3|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t4 |1 |46 | |15| MATERIAL | |1 |46 | |16| SUBPLAN SCAN |VIEW4|1 |46 | |17| TABLE SCAN |t2 |1 |46 | @@ -46733,12 +46723,12 @@ Outputs & filters: conds(nil), nl_params_(nil) 5 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), + 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + access([VIEW3.t1.c1]) + 8 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0), limit(1), offset(nil) 9 - output(nil), filter(nil), rowset=256 10 - output(nil), filter(nil), rowset=256, @@ -46746,11 +46736,11 @@ Outputs & filters: 11 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 12 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256, - access([VIEW3.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0), + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, + access(nil) + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), limit(1), offset(nil) 15 - output(nil), filter(nil), rowset=256 16 - output(nil), filter(nil), rowset=256, @@ -46791,14 +46781,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -46815,15 +46805,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -46863,14 +46853,14 @@ Query Plan |4 | NESTED-LOOP JOIN CARTESIAN | |1 |182 | |5 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | |6 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |t3 |1 |46 | +|7 | SUBPLAN SCAN |VIEW3|1 |46 | +|8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | -|10| SUBPLAN SCAN |VIEW2|1 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|10| SUBPLAN SCAN |VIEW1|1 |46 | +|11| TABLE SCAN |t3 |1 |46 | |12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW3|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|13| SUBPLAN SCAN |VIEW2|1 |46 | +|14| TABLE SCAN |t4 |1 |46 | |15| MATERIAL | |1 |46 | |16| SUBPLAN SCAN |VIEW4|1 |46 | |17| TABLE SCAN |t2 |1 |46 | @@ -46888,12 +46878,12 @@ Outputs & filters: conds(nil), nl_params_(nil) 5 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 6 - output(nil), filter(nil), rowset=256, + 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 7 - output(nil), filter(nil), rowset=256, - access(nil) - 8 - output([1]), filter(nil), rowset=256, - access(nil), partitions(p0), + 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + access([VIEW3.t1.c1]) + 8 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0), limit(1), offset(nil) 9 - output(nil), filter(nil), rowset=256 10 - output(nil), filter(nil), rowset=256, @@ -46901,11 +46891,11 @@ Outputs & filters: 11 - output([1]), filter(nil), rowset=256, access(nil), partitions(p0), limit(1), offset(nil) - 12 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256, - access([VIEW3.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0), + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter(nil), rowset=256, + access(nil) + 14 - output([1]), filter(nil), rowset=256, + access(nil), partitions(p0), limit(1), offset(nil) 15 - output(nil), filter(nil), rowset=256 16 - output(nil), filter(nil), rowset=256, @@ -46943,17 +46933,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |0 |191 | -|4 | NESTED-LOOP OUTER JOIN | |0 |191 | +|3 | LIMIT | |0 |192 | +|4 | NESTED-LOOP OUTER JOIN | |0 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -46969,15 +46959,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -47044,18 +47034,17 @@ select * from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t +----+------+----+------+------+----+------+------+----+------+------+ EXPLAIN select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0; Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |1 |179 | -|1 | MERGE FULL OUTER JOIN | |6 |136 | -|2 | SORT | |6 |90 | -|3 | NESTED-LOOP OUTER JOIN| |6 |89 | -|4 | TABLE SCAN |t3 |6 |46 | -|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|6 | TABLE SCAN |t1 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t2 |1 |7 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |1 |180 | +|1 | HASH FULL OUTER JOIN | |6 |136 | +|2 | TABLE SCAN |t1 |6 |46 | +|3 | NESTED-LOOP OUTER JOIN| |6 |89 | +|4 | TABLE SCAN |t3 |6 |46 | +|5 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|6 | DISTRIBUTED TABLE GET |t2 |1 |7 | +================================================= Outputs & filters: ------------------------------------- @@ -47063,16 +47052,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 1 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 2 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 3 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 4 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 5 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 6 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0; @@ -47123,20 +47111,19 @@ insert into t7_temp (select * from (t1 left join t2 on t1.c1 = t2.c1) full join rollback; EXPLAIN insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0); Query Plan -=============================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------------- -|0 |INSERT | |1 |186 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |179 | -|2 | NESTED-LOOP OUTER JOIN | |1 |179 | -|3 | MERGE FULL OUTER JOIN | |6 |136 | -|4 | SORT | |6 |90 | -|5 | NESTED-LOOP OUTER JOIN| |6 |89 | -|6 | TABLE SCAN |t3 |6 |46 | -|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|8 | TABLE SCAN |t1 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t2 |1 |7 | -=============================================================== +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |1 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |180 | +|2 | NESTED-LOOP OUTER JOIN | |1 |180 | +|3 | HASH FULL OUTER JOIN | |6 |136 | +|4 | TABLE SCAN |t1 |6 |46 | +|5 | NESTED-LOOP OUTER JOIN| |6 |89 | +|6 | TABLE SCAN |t3 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t4 |1 |7 | +|8 | DISTRIBUTED TABLE GET |t2 |1 |7 | +============================================================== Outputs & filters: ------------------------------------- @@ -47149,16 +47136,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 3 - output([t1.c1], [t1.c2], [t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 5 - output([t3.c1], [t3.c2], [t3.c3], [t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, conds(nil), nl_params_([t3.c1]) 6 - output([t3.c1], [t3.c2], [t3.c3]), filter(nil), rowset=256, access([t3.c1], [t3.c2], [t3.c3]), partitions(p0) 7 - output([t4.c1], [t4.c2], [t4.c3]), filter(nil), rowset=256, access([GROUP_ID], [t4.c1], [t4.c2], [t4.c3]), partitions(p0) - 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 9 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, + 8 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1], [t2.c2], [t2.c3]), partitions(p0) insert into t7_temp (select /*+ NO_REWRITE */* from (t1 left join t2 on t1.c1 = t2.c1) full join (t3 left join t4 on t4.c1 = t3.c1) on t1.c1 = t4.c1 where t2.c1 = 0 and t3.c1 = 0 and t4.c1 = 0); @@ -47238,14 +47224,14 @@ Query Plan |0 |UPDATE | |6 |306 | |1 | SUBPLAN FILTER | |6 |237 | |2 | TABLE SCAN |t1 |6 |46 | -|3 | LIMIT | |1 |191 | -|4 | NESTED-LOOP OUTER JOIN | |1 |191 | +|3 | LIMIT | |1 |192 | +|4 | NESTED-LOOP OUTER JOIN | |1 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -47262,15 +47248,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -47368,17 +47354,17 @@ Query Plan ===================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------------- -|0 |DELETE | |1 |248 | +|0 |DELETE | |1 |249 | |1 | SUBPLAN FILTER | |1 |237 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |191 | -|4 | NESTED-LOOP OUTER JOIN | |1 |191 | +|3 | LIMIT | |1 |192 | +|4 | NESTED-LOOP OUTER JOIN | |1 |192 | |5 | MERGE FULL OUTER JOIN | |6 |142 | -|6 | SORT | |6 |96 | -|7 | NESTED-LOOP OUTER JOIN| |6 |96 | -|8 | TABLE SCAN |t3 |6 |46 | -|9 | DISTRIBUTED TABLE GET|t4 |1 |7 | -|10| TABLE SCAN |t1 |6 |46 | +|6 | TABLE SCAN |t1 |6 |46 | +|7 | SORT | |6 |96 | +|8 | NESTED-LOOP OUTER JOIN| |6 |96 | +|9 | TABLE SCAN |t3 |6 |46 | +|10| DISTRIBUTED TABLE GET|t4 |1 |7 | |11| DISTRIBUTED TABLE GET |t2 |1 |7 | ===================================================== @@ -47394,15 +47380,15 @@ Outputs & filters: conds(nil), nl_params_([t1.c1]) 5 - output([t1.c1], [t4.c1], [t3.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) - 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, - conds(nil), nl_params_([t3.c1]) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, - access([GROUP_ID], [t4.c1]), partitions(p0) - 10 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) + 7 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, sort_keys([t4.c1, ASC]) + 8 - output([t4.c1], [t3.c1]), filter(nil), rowset=256, + conds(nil), nl_params_([t3.c1]) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([GROUP_ID], [t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([GROUP_ID], [t2.c1]), partitions(p0) @@ -54517,24 +54503,24 @@ insert into t11_temp (select /*+no_rewrite*/* from t1 where (11) in (select t3.c rollback; EXPLAIN update t1 set c2 = (select t1.c1 from t1 where (11) in (select t3.c1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1 = 1) limit 1); Query Plan -========================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |UPDATE | |8 |267 | -|1 | SUBPLAN FILTER | |8 |182 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |137 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | -|5 | SUBPLAN SCAN |VIEW1|1 |91 | -|6 | LIMIT | |1 |91 | -|7 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|8 | TABLE SCAN |t2 |1 |46 | -|9 | MATERIAL | |1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |46 | -|12| SUBPLAN SCAN |VIEW2|1 |46 | -|13| TABLE SCAN |t1 |1 |46 | -========================================================== +=========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------------- +|0 |UPDATE | |8 |267 | +|1 | SUBPLAN FILTER | |8 |182 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |137 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |91 | +|8 | SUBPLAN SCAN |VIEW1|1 |91 | +|9 | LIMIT | |1 |91 | +|10| NESTED-LOOP JOIN CARTESIAN| |1 |91 | +|11| TABLE SCAN |t2 |1 |46 | +|12| MATERIAL | |1 |46 | +|13| TABLE SCAN |t3 |1 |46 | +=========================================================== Outputs & filters: ------------------------------------- @@ -54547,22 +54533,22 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_(nil) - 8 - output(nil), filter([t2.c1 = 11]), rowset=256, - access([t2.c1]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256 - 10 - output(nil), filter([t3.c1 = 11]), rowset=256, - access([t3.c1]), partitions(p0) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, + 6 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_(nil) + 11 - output(nil), filter([t2.c1 = 11]), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter([t3.c1 = 11]), rowset=256, + access([t3.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from t1 where (11) in (select t3.c1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1 = 1) limit 1); EXPLAIN select stddev(c2) from t1; @@ -54650,24 +54636,24 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select t1.c1 from t1 where (11) in (select t3.c1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1 = 1) limit 1); Query Plan -========================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |DELETE | |1 |194 | -|1 | SUBPLAN FILTER | |1 |182 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |137 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | -|5 | SUBPLAN SCAN |VIEW1|1 |91 | -|6 | LIMIT | |1 |91 | -|7 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|8 | TABLE SCAN |t2 |1 |46 | -|9 | MATERIAL | |1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |46 | -|12| SUBPLAN SCAN |VIEW2|1 |46 | -|13| TABLE SCAN |t1 |1 |46 | -========================================================== +=========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------------- +|0 |DELETE | |1 |194 | +|1 | SUBPLAN FILTER | |1 |182 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |137 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |91 | +|8 | SUBPLAN SCAN |VIEW1|1 |91 | +|9 | LIMIT | |1 |91 | +|10| NESTED-LOOP JOIN CARTESIAN| |1 |91 | +|11| TABLE SCAN |t2 |1 |46 | +|12| MATERIAL | |1 |46 | +|13| TABLE SCAN |t3 |1 |46 | +=========================================================== Outputs & filters: ------------------------------------- @@ -54679,22 +54665,22 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_(nil) - 8 - output(nil), filter([t2.c1 = 11]), rowset=256, - access([t2.c1]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256 - 10 - output(nil), filter([t3.c1 = 11]), rowset=256, - access([t3.c1]), partitions(p0) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, + 6 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_(nil) + 11 - output(nil), filter([t2.c1 = 11]), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter([t3.c1 = 11]), rowset=256, + access([t3.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from t1 where (11) in (select t3.c1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1 = 1) limit 1); EXPLAIN select stddev(c2) from t1; @@ -54785,7 +54771,7 @@ Query Plan ============================================= |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- -|0 |HASH RIGHT SEMI JOIN| |8 |140 | +|0 |HASH RIGHT SEMI JOIN| |8 |141 | |1 | TABLE SCAN |t3 |8 |46 | |2 | HASH JOIN | |8 |93 | |3 | TABLE SCAN |t1 |8 |46 | @@ -54819,7 +54805,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -54854,8 +54840,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- |0 |INSERT | |8 |192 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | -|2 | HASH RIGHT SEMI JOIN| |8 |140 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |141 | +|2 | HASH RIGHT SEMI JOIN| |8 |141 | |3 | TABLE SCAN |t3 |8 |46 | |4 | HASH JOIN | |8 |93 | |5 | TABLE SCAN |t1 |8 |46 | @@ -54888,9 +54874,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -54924,7 +54910,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |UPDATE | |8 |269 | -|1 | SUBPLAN FILTER | |8 |184 | +|1 | SUBPLAN FILTER | |8 |185 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT SEMI JOIN| |1 |139 | @@ -54988,7 +54974,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -55044,7 +55030,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |DELETE | |1 |196 | -|1 | SUBPLAN FILTER | |1 |184 | +|1 | SUBPLAN FILTER | |1 |185 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT SEMI JOIN| |1 |139 | @@ -55107,7 +55093,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -55162,7 +55148,7 @@ Query Plan ============================================= |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- -|0 |HASH RIGHT SEMI JOIN| |8 |140 | +|0 |HASH RIGHT SEMI JOIN| |8 |141 | |1 | TABLE SCAN |t3 |8 |46 | |2 | HASH OUTER JOIN | |8 |93 | |3 | TABLE SCAN |t1 |8 |46 | @@ -55197,7 +55183,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -55233,8 +55219,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- |0 |INSERT | |8 |198 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | -|2 | HASH RIGHT SEMI JOIN| |8 |140 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |141 | +|2 | HASH RIGHT SEMI JOIN| |8 |141 | |3 | TABLE SCAN |t3 |8 |46 | |4 | HASH OUTER JOIN | |8 |93 | |5 | TABLE SCAN |t1 |8 |46 | @@ -55267,9 +55253,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -55372,7 +55358,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -55496,7 +55482,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -55943,22 +55929,22 @@ rollback; EXPLAIN select * from t1 where exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1); Query Plan -======================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |HASH SEMI JOIN| |8 |93 | -|1 | TABLE SCAN |t1 |8 |46 | -|2 | TABLE SCAN |t2 |9 |46 | -======================================= +============================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +--------------------------------------------- +|0 |HASH RIGHT SEMI JOIN| |8 |93 | +|1 | TABLE SCAN |t2 |9 |46 | +|2 | TABLE SCAN |t1 |8 |46 | +============================================= Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 1 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 2 - output([t2.c1]), filter(nil), rowset=256, + 1 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) select * from t1 where exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1); +------+------+ @@ -55999,15 +55985,15 @@ select /*+NO_REWRITE*/* from t1 where exists (select 1 from t2 left join t3 on t +------+------+ EXPLAIN insert into t11_temp (select * from t1 where exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1)); Query Plan -==================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- -|0 |INSERT | |8 |151 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |93 | -|2 | HASH SEMI JOIN| |8 |93 | -|3 | TABLE SCAN |t1 |8 |46 | -|4 | TABLE SCAN |t2 |9 |46 | -==================================================== +========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +---------------------------------------------------------- +|0 |INSERT | |8 |151 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |93 | +|2 | HASH RIGHT SEMI JOIN| |8 |93 | +|3 | TABLE SCAN |t2 |9 |46 | +|4 | TABLE SCAN |t1 |8 |46 | +========================================================== Outputs & filters: ------------------------------------- @@ -56018,10 +56004,10 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]) 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 4 - output([t2.c1]), filter(nil), rowset=256, + 3 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) insert into t11_temp (select * from t1 where exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1)); @@ -56426,7 +56412,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------- |0 |UPDATE | |8 |270 | -|1 | SUBPLAN FILTER | |8 |185 | +|1 | SUBPLAN FILTER | |8 |186 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |140 | |4 | HASH ANTI JOIN| |1 |140 | @@ -56551,7 +56537,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------- |0 |DELETE | |1 |197 | -|1 | SUBPLAN FILTER | |1 |185 | +|1 | SUBPLAN FILTER | |1 |186 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |140 | |4 | HASH ANTI JOIN| |1 |140 | @@ -56671,22 +56657,22 @@ rollback; EXPLAIN select * from t1 where not exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1); Query Plan -======================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |HASH ANTI JOIN| |1 |93 | -|1 | TABLE SCAN |t1 |8 |46 | -|2 | TABLE SCAN |t2 |9 |46 | -======================================= +============================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +--------------------------------------------- +|0 |HASH RIGHT ANTI JOIN| |1 |93 | +|1 | TABLE SCAN |t2 |9 |46 | +|2 | TABLE SCAN |t1 |8 |46 | +============================================= Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 1 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 2 - output([t2.c1]), filter(nil), rowset=256, + 1 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) select * from t1 where not exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1); +------+------+ @@ -56727,15 +56713,15 @@ select /*+NO_REWRITE*/* from t1 where not exists (select 1 from t2 left join t3 +------+------+ EXPLAIN insert into t11_temp (select * from t1 where not exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1)); Query Plan -==================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- -|0 |INSERT | |1 |100 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |93 | -|2 | HASH ANTI JOIN| |1 |93 | -|3 | TABLE SCAN |t1 |8 |46 | -|4 | TABLE SCAN |t2 |9 |46 | -==================================================== +========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +---------------------------------------------------------- +|0 |INSERT | |1 |100 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |93 | +|2 | HASH RIGHT ANTI JOIN| |1 |93 | +|3 | TABLE SCAN |t2 |9 |46 | +|4 | TABLE SCAN |t1 |8 |46 | +========================================================== Outputs & filters: ------------------------------------- @@ -56746,10 +56732,10 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]) 2 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 4 - output([t2.c1]), filter(nil), rowset=256, + 3 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 4 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) insert into t11_temp (select * from t1 where not exists (select 1 from t2 left join t3 on t2.c1=t3.c1 where t1.c1=t2.c1)); @@ -57038,7 +57024,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -57073,7 +57059,7 @@ Query Plan ========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |INSERT | |1 |152 | +|0 |INSERT | |1 |153 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |140 | |2 | HASH RIGHT ANTI JOIN| |1 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -57108,9 +57094,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -57144,7 +57130,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |UPDATE | |8 |270 | -|1 | SUBPLAN FILTER | |8 |185 | +|1 | SUBPLAN FILTER | |8 |186 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |140 | |4 | HASH RIGHT ANTI JOIN| |1 |140 | @@ -57208,7 +57194,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -57264,7 +57250,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |DELETE | |1 |197 | -|1 | SUBPLAN FILTER | |1 |185 | +|1 | SUBPLAN FILTER | |1 |186 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |140 | |4 | HASH RIGHT ANTI JOIN| |1 |140 | @@ -57327,7 +57313,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -57602,7 +57588,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -57731,7 +57717,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58009,7 +57995,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58138,7 +58124,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58409,7 +58395,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58533,7 +58519,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58589,7 +58575,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------- -|0 |HASH RIGHT ANTI JOIN NA| |7 |139 | +|0 |HASH RIGHT ANTI JOIN NA| |7 |140 | |1 | SUBPLAN SCAN |VIEW1|2 |46 | |2 | TABLE SCAN |t3 |2 |46 | |3 | HASH OUTER JOIN | |8 |93 | @@ -58658,9 +58644,9 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |7 |185 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|7 |139 | -|2 | HASH RIGHT ANTI JOIN NA| |7 |139 | +|0 |INSERT | |7 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|7 |140 | +|2 | HASH RIGHT ANTI JOIN NA| |7 |140 | |3 | SUBPLAN SCAN |VIEW1 |2 |46 | |4 | TABLE SCAN |t3 |2 |46 | |5 | HASH OUTER JOIN | |8 |93 | @@ -58802,7 +58788,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58926,7 +58912,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | SUBPLAN FILTER | |1 |138 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |2 |46 | @@ -58982,7 +58968,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT SEMI JOIN| |8 |187 | +|0 |HASH RIGHT SEMI JOIN| |8 |188 | |1 | SUBPLAN SCAN |VIEW1|8 |93 | |2 | HASH JOIN | |8 |93 | |3 | TABLE SCAN |t3 |8 |46 | @@ -59025,7 +59011,7 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |SUBPLAN FILTER | |4 |820 | +|0 |SUBPLAN FILTER | |4 |821 | |1 | HASH OUTER JOIN | |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -59068,8 +59054,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- |0 |INSERT | |8 |239 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT SEMI JOIN| |8 |187 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT SEMI JOIN| |8 |188 | |3 | SUBPLAN SCAN |VIEW1 |8 |93 | |4 | HASH JOIN | |8 |93 | |5 | TABLE SCAN |t3 |8 |46 | @@ -59112,8 +59098,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- |0 |INSERT | |4 |852 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |820 | -|2 | SUBPLAN FILTER | |4 |820 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |821 | +|2 | SUBPLAN FILTER | |4 |821 | |3 | HASH OUTER JOIN | |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -59155,7 +59141,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------- |0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |231 | +|1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH RIGHT SEMI JOIN| |1 |186 | @@ -59228,7 +59214,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -59292,7 +59278,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------- |0 |DELETE | |1 |243 | -|1 | SUBPLAN FILTER | |1 |231 | +|1 | SUBPLAN FILTER | |1 |232 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |186 | |4 | HASH RIGHT SEMI JOIN| |1 |186 | @@ -59364,7 +59350,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -59427,7 +59413,7 @@ Query Plan ============================================= |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- -|0 |HASH RIGHT SEMI JOIN| |8 |140 | +|0 |HASH RIGHT SEMI JOIN| |8 |141 | |1 | TABLE SCAN |t3 |8 |46 | |2 | HASH JOIN | |8 |93 | |3 | TABLE SCAN |t1 |8 |46 | @@ -59461,7 +59447,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -59496,8 +59482,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- |0 |INSERT | |8 |192 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | -|2 | HASH RIGHT SEMI JOIN| |8 |140 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |141 | +|2 | HASH RIGHT SEMI JOIN| |8 |141 | |3 | TABLE SCAN |t3 |8 |46 | |4 | HASH JOIN | |8 |93 | |5 | TABLE SCAN |t1 |8 |46 | @@ -59530,9 +59516,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -59566,7 +59552,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |UPDATE | |8 |269 | -|1 | SUBPLAN FILTER | |8 |184 | +|1 | SUBPLAN FILTER | |8 |185 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT SEMI JOIN| |1 |139 | @@ -59630,7 +59616,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -59662,8 +59648,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -59686,7 +59672,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |DELETE | |1 |196 | -|1 | SUBPLAN FILTER | |1 |184 | +|1 | SUBPLAN FILTER | |1 |185 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT SEMI JOIN| |1 |139 | @@ -59721,8 +59707,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -59749,7 +59735,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -59780,8 +59766,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -59801,33 +59787,33 @@ rollback; EXPLAIN select * from t1 left join t2 on t1.c1=t2.c1 where exists (select 1 from t3 left join t4 on t3.c1=t4.c1 where t1.c1=t4.c1); Query Plan -=============================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------ -|0 |HASH OUTER JOIN | |8 |187 | -|1 | HASH RIGHT SEMI JOIN| |8 |140 | -|2 | SUBPLAN SCAN |VIEW1|8 |93 | -|3 | HASH JOIN | |8 |93 | -|4 | TABLE SCAN |t3 |8 |46 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | -=============================================== +============================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +---------------------------------------------- +|0 |HASH RIGHT SEMI JOIN| |8 |143 | +|1 | SUBPLAN SCAN |VIEW1|8 |93 | +|2 | HASH JOIN | |8 |93 | +|3 | TABLE SCAN |t3 |8 |46 | +|4 | TABLE SCAN |t4 |8 |46 | +|5 | HASH OUTER JOIN | |8 |48 | +|6 | TABLE SCAN |t1 |8 |1 | +|7 | TABLE SCAN |t2 |9 |46 | +============================================== Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 1 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = VIEW1.t4.c1]), other_conds(nil) - 2 - output([VIEW1.t4.c1]), filter(nil), rowset=256, + 1 - output([VIEW1.t4.c1]), filter(nil), rowset=256, access([VIEW1.t4.c1]) - 3 - output([t4.c1]), filter(nil), rowset=256, + 2 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1]), filter(nil), rowset=256, + 3 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 5 - output([t4.c1]), filter(nil), rowset=256, + 4 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 5 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) 7 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, @@ -59847,7 +59833,7 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |SUBPLAN FILTER | |4 |820 | +|0 |SUBPLAN FILTER | |4 |821 | |1 | HASH OUTER JOIN | |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -59886,20 +59872,20 @@ select /*+NO_REWRITE*/* from t1 left join t2 on t1.c1=t2.c1 where exists (select +------+------+------+------+ EXPLAIN insert into t4_temp (select * from t1 left join t2 on t1.c1=t2.c1 where exists (select 1 from t3 left join t4 on t3.c1=t4.c1 where t1.c1=t4.c1)); Query Plan -=========================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |8 |245 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH OUTER JOIN | |8 |187 | -|3 | HASH RIGHT SEMI JOIN| |8 |140 | -|4 | SUBPLAN SCAN |VIEW1 |8 |93 | -|5 | HASH JOIN | |8 |93 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | TABLE SCAN |t4 |8 |46 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | TABLE SCAN |t2 |9 |46 | -=========================================================== +========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +---------------------------------------------------------- +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT SEMI JOIN| |8 |188 | +|3 | SUBPLAN SCAN |VIEW1 |8 |93 | +|4 | HASH JOIN | |8 |93 | +|5 | TABLE SCAN |t3 |8 |46 | +|6 | TABLE SCAN |t4 |8 |46 | +|7 | HASH OUTER JOIN | |8 |93 | +|8 | TABLE SCAN |t1 |8 |46 | +|9 | TABLE SCAN |t2 |9 |46 | +========================================================== Outputs & filters: ------------------------------------- @@ -59909,17 +59895,17 @@ Outputs & filters: 1 - output([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]), filter(nil), rowset=256, access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = VIEW1.t4.c1]), other_conds(nil) - 4 - output([VIEW1.t4.c1]), filter(nil), rowset=256, + 3 - output([VIEW1.t4.c1]), filter(nil), rowset=256, access([VIEW1.t4.c1]) - 5 - output([t4.c1]), filter(nil), rowset=256, + 4 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 6 - output([t3.c1]), filter(nil), rowset=256, + 5 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 7 - output([t4.c1]), filter(nil), rowset=256, + 6 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 7 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) 8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) 9 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, @@ -59934,8 +59920,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- |0 |INSERT | |4 |852 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |820 | -|2 | SUBPLAN FILTER | |4 |820 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |821 | +|2 | SUBPLAN FILTER | |4 |821 | |3 | HASH OUTER JOIN | |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -59979,8 +59965,8 @@ Query Plan |0 |UPDATE | |8 |316 | |1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |186 | -|4 | HASH OUTER JOIN | |1 |186 | +|3 | LIMIT | |1 |187 | +|4 | HASH OUTER JOIN | |1 |187 | |5 | SUBPLAN SCAN |VIEW2|1 |140 | |6 | LIMIT | |1 |140 | |7 | HASH SEMI JOIN| |8 |140 | @@ -60027,8 +60013,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60055,7 +60041,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -60095,8 +60081,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60118,11 +60104,11 @@ Query Plan ============================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------- -|0 |DELETE | |1 |243 | +|0 |DELETE | |1 |244 | |1 | SUBPLAN FILTER | |1 |232 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |186 | -|4 | HASH OUTER JOIN | |1 |186 | +|3 | LIMIT | |1 |187 | +|4 | HASH OUTER JOIN | |1 |187 | |5 | SUBPLAN SCAN |VIEW2|1 |140 | |6 | LIMIT | |1 |140 | |7 | HASH SEMI JOIN| |8 |140 | @@ -60196,7 +60182,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -60235,8 +60221,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60303,7 +60289,7 @@ Query Plan ==================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |SUBPLAN FILTER | |4 |820 | +|0 |SUBPLAN FILTER | |4 |821 | |1 | HASH OUTER JOIN | |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -60346,7 +60332,7 @@ Query Plan ========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |INSERT | |1 |199 | +|0 |INSERT | |1 |200 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |187 | |2 | HASH RIGHT ANTI JOIN| |1 |187 | |3 | SUBPLAN SCAN |VIEW1 |8 |93 | @@ -60391,8 +60377,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------- |0 |INSERT | |4 |852 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |820 | -|2 | SUBPLAN FILTER | |4 |820 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |821 | +|2 | SUBPLAN FILTER | |4 |821 | |3 | HASH OUTER JOIN | |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -60434,7 +60420,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------- |0 |UPDATE | |8 |317 | -|1 | SUBPLAN FILTER | |8 |232 | +|1 | SUBPLAN FILTER | |8 |233 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |187 | |4 | HASH RIGHT ANTI JOIN| |1 |187 | @@ -60479,8 +60465,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60507,7 +60493,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -60547,8 +60533,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60615,8 +60601,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60643,7 +60629,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -60682,8 +60668,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60741,7 +60727,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -60776,7 +60762,7 @@ Query Plan ========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |INSERT | |1 |152 | +|0 |INSERT | |1 |153 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |140 | |2 | HASH RIGHT ANTI JOIN| |1 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -60811,9 +60797,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -60847,7 +60833,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |UPDATE | |8 |270 | -|1 | SUBPLAN FILTER | |8 |185 | +|1 | SUBPLAN FILTER | |8 |186 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |140 | |4 | HASH RIGHT ANTI JOIN| |1 |140 | @@ -60883,8 +60869,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60911,7 +60897,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -60943,8 +60929,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -60967,7 +60953,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ |0 |DELETE | |1 |197 | -|1 | SUBPLAN FILTER | |1 |185 | +|1 | SUBPLAN FILTER | |1 |186 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |140 | |4 | HASH RIGHT ANTI JOIN| |1 |140 | @@ -61002,8 +60988,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61030,7 +61016,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -61061,8 +61047,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61130,7 +61116,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |2 |1188| +|0 |SUBPLAN FILTER | |2 |1189| |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -61220,8 +61206,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ |0 |INSERT | |2 |1208| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |1188| -|2 | SUBPLAN FILTER | |2 |1188| +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |1189| +|2 | SUBPLAN FILTER | |2 |1189| |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -61263,7 +61249,7 @@ Query Plan =================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |8 |362 | +|0 |UPDATE | |8 |363 | |1 | SUBPLAN FILTER | |8 |278 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |233 | @@ -61315,8 +61301,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61384,8 +61370,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61550,7 +61536,7 @@ Query Plan =============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------------- -|0 |HASH OUTER JOIN | |3 |185 | +|0 |HASH OUTER JOIN | |3 |186 | |1 | HASH SEMI JOIN | |3 |139 | |2 | HASH RIGHT ANTI JOIN| |3 |93 | |3 | TABLE SCAN |t5 |5 |46 | @@ -61626,8 +61612,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ |0 |INSERT | |3 |211 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |185 | -|2 | HASH OUTER JOIN | |3 |185 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |186 | +|2 | HASH OUTER JOIN | |3 |186 | |3 | HASH SEMI JOIN | |3 |139 | |4 | HASH RIGHT ANTI JOIN| |3 |93 | |5 | TABLE SCAN |t5 |5 |46 | @@ -61752,8 +61738,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61772,20 +61758,20 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=t2.c1 where exists (select 1 from t3 left join t4 on t3.c1=t4.c1 where t1.c2=t3.c2) and not exists (select 1 from t5 left join t6 on t5.c1=t6.c1 where t1.c1=t5.c1) limit 1); Query Plan -============================================ -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- -|0 |UPDATE | |8 |586 | -|1 | SUBPLAN FILTER | |8 |501 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |456 | -|4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN| |4 |93 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | TABLE SCAN |t2 |5 |46 | -|8 | TABLE SCAN |t3 |1 |46 | -|9 | TABLE SCAN |t5 |1 |46 | -============================================ +================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +-------------------------------------------------- +|0 |UPDATE | |8 |586 | +|1 | SUBPLAN FILTER | |8 |502 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |456 | +|4 | SUBPLAN FILTER | |1 |456 | +|5 | HASH RIGHT OUTER JOIN| |4 |93 | +|6 | TABLE SCAN |t2 |9 |46 | +|7 | TABLE SCAN |t1 |4 |46 | +|8 | TABLE SCAN |t3 |1 |46 | +|9 | TABLE SCAN |t5 |1 |46 | +================================================== Outputs & filters: ------------------------------------- @@ -61800,10 +61786,10 @@ Outputs & filters: exec_params_([t1.c2], [t1.c1]), onetime_exprs_(nil), init_plan_idxs_(nil) 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 6 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 8 - output([1]), filter([? = t3.c2]), rowset=256, access([t3.c2]), partitions(p0) 9 - output([1]), filter([? = t5.c1]), rowset=256, @@ -61815,8 +61801,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -61905,20 +61891,20 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=t2.c1 where exists (select 1 from t3 left join t4 on t3.c1=t4.c1 where t1.c2=t3.c2) and not exists (select 1 from t5 left join t6 on t5.c1=t6.c1 where t1.c1=t5.c1) limit 1); Query Plan -============================================ -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- -|0 |DELETE | |1 |513 | -|1 | SUBPLAN FILTER | |1 |501 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |456 | -|4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN| |4 |93 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | TABLE SCAN |t2 |5 |46 | -|8 | TABLE SCAN |t3 |1 |46 | -|9 | TABLE SCAN |t5 |1 |46 | -============================================ +================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +-------------------------------------------------- +|0 |DELETE | |1 |513 | +|1 | SUBPLAN FILTER | |1 |502 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |456 | +|4 | SUBPLAN FILTER | |1 |456 | +|5 | HASH RIGHT OUTER JOIN| |4 |93 | +|6 | TABLE SCAN |t2 |9 |46 | +|7 | TABLE SCAN |t1 |4 |46 | +|8 | TABLE SCAN |t3 |1 |46 | +|9 | TABLE SCAN |t5 |1 |46 | +================================================== Outputs & filters: ------------------------------------- @@ -61932,10 +61918,10 @@ Outputs & filters: exec_params_([t1.c2], [t1.c1]), onetime_exprs_(nil), init_plan_idxs_(nil) 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 6 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 6 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 7 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) 8 - output([1]), filter([? = t3.c2]), rowset=256, access([t3.c2]), partitions(p0) 9 - output([1]), filter([? = t5.c1]), rowset=256, @@ -62017,7 +62003,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |2 |1188| +|0 |SUBPLAN FILTER | |2 |1189| |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -62108,8 +62094,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ |0 |INSERT | |2 |1208| -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |1188| -|2 | SUBPLAN FILTER | |2 |1188| +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |1189| +|2 | SUBPLAN FILTER | |2 |1189| |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -62203,8 +62189,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62272,8 +62258,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62296,7 +62282,7 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- |0 |DELETE | |1 |289 | -|1 | SUBPLAN FILTER | |1 |277 | +|1 | SUBPLAN FILTER | |1 |278 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |232 | |4 | HASH JOIN | |1 |232 | @@ -62346,8 +62332,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62414,8 +62400,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62651,7 +62637,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |365 | |4 | SUBPLAN FILTER | |1 |365 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | LIMIT | |1 |137 | @@ -62701,8 +62687,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62729,7 +62715,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |365 | |4 | SUBPLAN FILTER | |1 |365 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | SUBPLAN FILTER | |8 |137 | @@ -62777,8 +62763,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62805,7 +62791,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |365 | |4 | SUBPLAN FILTER | |1 |365 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | LIMIT | |1 |137 | @@ -62854,8 +62840,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -62882,7 +62868,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |365 | |4 | SUBPLAN FILTER | |1 |365 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | SUBPLAN FILTER | |8 |137 | @@ -62929,8 +62915,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63196,7 +63182,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |456 | |4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | LIMIT | |1 |182 | @@ -63254,8 +63240,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63282,7 +63268,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |456 | |4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | SUBPLAN FILTER | |1 |182 | @@ -63338,8 +63324,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63362,11 +63348,11 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------------- |0 |DELETE | |1 |513 | -|1 | SUBPLAN FILTER | |1 |501 | +|1 | SUBPLAN FILTER | |1 |502 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |456 | |4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | LIMIT | |1 |182 | @@ -63423,8 +63409,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63447,11 +63433,11 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------------- |0 |DELETE | |1 |513 | -|1 | SUBPLAN FILTER | |1 |501 | +|1 | SUBPLAN FILTER | |1 |502 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |456 | |4 | SUBPLAN FILTER | |1 |456 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | SUBPLAN FILTER | |1 |182 | @@ -63506,8 +63492,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63566,7 +63552,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -63637,9 +63623,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -63711,8 +63697,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63739,7 +63725,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |3 |46 | @@ -63771,8 +63757,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63832,8 +63818,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63860,7 +63846,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |3 |46 | @@ -63891,8 +63877,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -63952,7 +63938,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -64024,9 +64010,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -64064,7 +64050,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP ANTI JOIN| |1 |138 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |2 |46 | |8 | MATERIAL | |8 |46 | @@ -64098,8 +64084,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64126,7 +64112,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |3 |46 | @@ -64158,8 +64144,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64186,7 +64172,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP ANTI JOIN| |1 |138 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |2 |46 | |8 | MATERIAL | |8 |46 | @@ -64247,7 +64233,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |3 |46 | @@ -64338,7 +64324,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -64409,9 +64395,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -64483,8 +64469,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64511,7 +64497,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -64543,8 +64529,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64604,8 +64590,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64632,7 +64618,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -64663,8 +64649,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64724,7 +64710,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |SUBPLAN FILTER | |4 |456 | +|0 |SUBPLAN FILTER | |4 |457 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -64796,9 +64782,9 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |4 |488 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |456 | -|2 | SUBPLAN FILTER | |4 |456 | +|0 |INSERT | |4 |489 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|4 |457 | +|2 | SUBPLAN FILTER | |4 |457 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -64832,7 +64818,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- |0 |UPDATE | |8 |268 | -|1 | SUBPLAN FILTER | |8 |183 | +|1 | SUBPLAN FILTER | |8 |184 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP ANTI JOIN| |1 |138 | @@ -64870,8 +64856,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64898,7 +64884,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -64930,8 +64916,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -64954,7 +64940,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- |0 |DELETE | |1 |195 | -|1 | SUBPLAN FILTER | |1 |183 | +|1 | SUBPLAN FILTER | |1 |184 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP ANTI JOIN| |1 |138 | @@ -65019,7 +65005,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |1 |46 | @@ -65284,8 +65270,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65344,8 +65330,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65412,8 +65398,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65471,8 +65457,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65497,7 +65483,7 @@ Query Plan ----------------------------------------------------- |0 |NESTED-LOOP OUTER JOIN | |8 |137 | |1 | TABLE SCAN |t1 |8 |46 | -|2 | MATERIAL | |1 |91 | +|2 | MATERIAL | |1 |92 | |3 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | |4 | TABLE SCAN |t3 |1 |46 | |5 | MATERIAL | |1 |46 | @@ -65583,7 +65569,7 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |137 | |2 | NESTED-LOOP OUTER JOIN | |8 |137 | |3 | TABLE SCAN |t1 |8 |46 | -|4 | MATERIAL | |1 |91 | +|4 | MATERIAL | |1 |92 | |5 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | |6 | TABLE SCAN |t3 |1 |46 | |7 | MATERIAL | |1 |46 | @@ -65700,8 +65686,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65762,8 +65748,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65829,8 +65815,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65890,8 +65876,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -65992,7 +65978,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |197 | +|0 |INSERT | |8 |198 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | |2 | HASH RIGHT OUTER JOIN| |8 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -66027,7 +66013,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |197 | +|0 |INSERT | |8 |198 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | |2 | HASH RIGHT OUTER JOIN| |8 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -66103,8 +66089,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66163,8 +66149,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66226,8 +66212,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66250,7 +66236,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- |0 |DELETE | |1 |196 | -|1 | SUBPLAN FILTER | |1 |184 | +|1 | SUBPLAN FILTER | |1 |185 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT OUTER JOIN| |1 |139 | @@ -66285,8 +66271,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66422,7 +66408,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |8 |196 | +|0 |INSERT | |8 |197 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |139 | |2 | HASH RIGHT OUTER JOIN | |8 |139 | |3 | HASH RIGHT OUTER JOIN| |2 |93 | @@ -66498,8 +66484,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66518,19 +66504,19 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join (t2 left join t3 on t2.c1=t3.c1) on t1.c1=t3.c1 and t3.c2 = 1 limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |8 |268 | -|1 | SUBPLAN FILTER | |8 |184 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |139 | -|4 | HASH RIGHT OUTER JOIN | |1 |139 | -|5 | HASH RIGHT OUTER JOIN| |2 |93 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | -|8 | TABLE SCAN |t1 |1 |46 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |UPDATE | |8 |269 | +|1 | SUBPLAN FILTER | |8 |184 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |139 | +|4 | HASH RIGHT OUTER JOIN| |1 |139 | +|5 | HASH OUTER JOIN | |2 |93 | +|6 | TABLE SCAN |t2 |9 |46 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t1 |1 |46 | +================================================= Outputs & filters: ------------------------------------- @@ -66545,10 +66531,10 @@ Outputs & filters: equal_conds([t1.c1 = t3.c1]), other_conds(nil) 5 - output([t3.c1]), filter([t3.c2 = 1]), rowset=256, equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 6 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) @@ -66558,8 +66544,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66621,8 +66607,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66641,19 +66627,19 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join (t2 left join t3 on t2.c1=t3.c1) on t1.c1=t3.c1 and t3.c2 = 1 limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |196 | -|1 | SUBPLAN FILTER | |1 |184 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |139 | -|4 | HASH RIGHT OUTER JOIN | |1 |139 | -|5 | HASH RIGHT OUTER JOIN| |2 |93 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | -|8 | TABLE SCAN |t1 |1 |46 | -================================================== +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |DELETE | |1 |196 | +|1 | SUBPLAN FILTER | |1 |184 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |139 | +|4 | HASH RIGHT OUTER JOIN| |1 |139 | +|5 | HASH OUTER JOIN | |2 |93 | +|6 | TABLE SCAN |t2 |9 |46 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t1 |1 |46 | +================================================= Outputs & filters: ------------------------------------- @@ -66667,10 +66653,10 @@ Outputs & filters: equal_conds([t1.c1 = t3.c1]), other_conds(nil) 5 - output([t3.c1]), filter([t3.c2 = 1]), rowset=256, equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, + 6 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) @@ -66680,8 +66666,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66815,7 +66801,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |9 |204 | +|0 |INSERT | |9 |205 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |141 | |2 | NESTED-LOOP OUTER JOIN| |9 |141 | |3 | HASH RIGHT OUTER JOIN| |9 |93 | @@ -66852,7 +66838,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |9 |204 | +|0 |INSERT | |9 |205 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |141 | |2 | NESTED-LOOP OUTER JOIN| |9 |141 | |3 | HASH RIGHT OUTER JOIN| |9 |93 | @@ -66889,7 +66875,7 @@ Query Plan =================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |8 |267 | +|0 |UPDATE | |8 |268 | |1 | SUBPLAN FILTER | |8 |183 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | @@ -66932,8 +66918,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -66956,7 +66942,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |UPDATE | |8 |268 | -|1 | SUBPLAN FILTER | |8 |183 | +|1 | SUBPLAN FILTER | |8 |184 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP OUTER JOIN| |1 |138 | @@ -66994,8 +66980,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67059,8 +67045,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67083,7 +67069,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |DELETE | |1 |195 | -|1 | SUBPLAN FILTER | |1 |183 | +|1 | SUBPLAN FILTER | |1 |184 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |138 | |4 | NESTED-LOOP OUTER JOIN| |1 |138 | @@ -67120,8 +67106,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67303,24 +67289,24 @@ insert into t5_temp (select /*+NO_REWRITE*/* from t1 right join (t2 left join t3 rollback; EXPLAIN update t1 set c2 = (select t1.c1 from t1 right join (t2 left join t3 on t2.c1=t3.c1) on t2.c1=1 and t3.c1=1 where t1.c1>1 limit 1); Query Plan -========================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |UPDATE | |8 |267 | -|1 | SUBPLAN FILTER | |8 |182 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |137 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | -|5 | SUBPLAN SCAN |VIEW1|1 |91 | -|6 | LIMIT | |1 |91 | -|7 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|8 | TABLE SCAN |t2 |1 |46 | -|9 | MATERIAL | |1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |46 | -|12| SUBPLAN SCAN |VIEW2|1 |46 | -|13| TABLE SCAN |t1 |1 |46 | -========================================================== +=========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------------- +|0 |UPDATE | |8 |267 | +|1 | SUBPLAN FILTER | |8 |182 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |137 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |91 | +|8 | SUBPLAN SCAN |VIEW1|1 |91 | +|9 | LIMIT | |1 |91 | +|10| NESTED-LOOP JOIN CARTESIAN| |1 |91 | +|11| TABLE SCAN |t2 |1 |46 | +|12| MATERIAL | |1 |46 | +|13| TABLE SCAN |t3 |1 |46 | +=========================================================== Outputs & filters: ------------------------------------- @@ -67333,22 +67319,22 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_(nil) - 8 - output(nil), filter([t2.c1 = 1]), rowset=256, - access([t2.c1]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256 - 10 - output(nil), filter([t3.c1 = 1]), rowset=256, - access([t3.c1]), partitions(p0) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter([t1.c1 > 1]), rowset=256, + 6 - output([t1.c1]), filter([t1.c1 > 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_(nil) + 11 - output(nil), filter([t2.c1 = 1]), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter([t3.c1 = 1]), rowset=256, + access([t3.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from t1 right join (t2 left join t3 on t2.c1=t3.c1) on t2.c1=1 and t3.c1=1 where t1.c1>1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -67356,8 +67342,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67379,7 +67365,7 @@ Query Plan ================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |8 |270 | +|0 |UPDATE | |8 |271 | |1 | SUBPLAN FILTER | |8 |186 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |141 | @@ -67418,8 +67404,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67438,24 +67424,24 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select t1.c1 from t1 right join (t2 left join t3 on t2.c1=t3.c1) on t2.c1=1 and t3.c1=1 where t1.c1>1 limit 1); Query Plan -========================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |DELETE | |1 |194 | -|1 | SUBPLAN FILTER | |1 |182 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |137 | -|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | -|5 | SUBPLAN SCAN |VIEW1|1 |91 | -|6 | LIMIT | |1 |91 | -|7 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | -|8 | TABLE SCAN |t2 |1 |46 | -|9 | MATERIAL | |1 |46 | -|10| TABLE SCAN |t3 |1 |46 | -|11| MATERIAL | |1 |46 | -|12| SUBPLAN SCAN |VIEW2|1 |46 | -|13| TABLE SCAN |t1 |1 |46 | -========================================================== +=========================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +----------------------------------------------------------- +|0 |DELETE | |1 |194 | +|1 | SUBPLAN FILTER | |1 |182 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |137 | +|4 | NESTED-LOOP JOIN CARTESIAN | |1 |137 | +|5 | SUBPLAN SCAN |VIEW2|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |91 | +|8 | SUBPLAN SCAN |VIEW1|1 |91 | +|9 | LIMIT | |1 |91 | +|10| NESTED-LOOP JOIN CARTESIAN| |1 |91 | +|11| TABLE SCAN |t2 |1 |46 | +|12| MATERIAL | |1 |46 | +|13| TABLE SCAN |t3 |1 |46 | +=========================================================== Outputs & filters: ------------------------------------- @@ -67467,22 +67453,22 @@ Outputs & filters: 3 - output([VIEW2.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW2.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - access(nil) - 6 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 7 - output(nil), filter(nil), rowset=256, - conds(nil), nl_params_(nil) - 8 - output(nil), filter([t2.c1 = 1]), rowset=256, - access([t2.c1]), partitions(p0) - 9 - output(nil), filter(nil), rowset=256 - 10 - output(nil), filter([t3.c1 = 1]), rowset=256, - access([t3.c1]), partitions(p0) - 11 - output([VIEW2.t1.c1]), filter(nil), rowset=256 - 12 - output([VIEW2.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW2.t1.c1]), filter(nil), rowset=256, access([VIEW2.t1.c1]) - 13 - output([t1.c1]), filter([t1.c1 > 1]), rowset=256, + 6 - output([t1.c1]), filter([t1.c1 > 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + access(nil) + 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256, + conds(nil), nl_params_(nil) + 11 - output(nil), filter([t2.c1 = 1]), rowset=256, + access([t2.c1]), partitions(p0) + 12 - output(nil), filter(nil), rowset=256 + 13 - output(nil), filter([t3.c1 = 1]), rowset=256, + access([t3.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from t1 right join (t2 left join t3 on t2.c1=t3.c1) on t2.c1=1 and t3.c1=1 where t1.c1>1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -67490,8 +67476,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67551,8 +67537,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -67653,7 +67639,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |196 | +|0 |INSERT | |8 |197 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |139 | |2 | HASH RIGHT OUTER JOIN| |8 |139 | |3 | TABLE SCAN |t3 |1 |46 | @@ -67688,7 +67674,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |197 | +|0 |INSERT | |8 |198 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |140 | |2 | HASH RIGHT OUTER JOIN| |8 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -67723,7 +67709,7 @@ Query Plan ================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------- -|0 |UPDATE | |8 |267 | +|0 |UPDATE | |8 |268 | |1 | SUBPLAN FILTER | |8 |183 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |138 | @@ -67911,7 +67897,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- |0 |DELETE | |1 |196 | -|1 | SUBPLAN FILTER | |1 |184 | +|1 | SUBPLAN FILTER | |1 |185 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |139 | |4 | HASH RIGHT OUTER JOIN| |1 |139 | @@ -67970,11 +67956,11 @@ Query Plan ============================================================ |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------------------ -|0 |HASH JOIN | |8 |184 | +|0 |HASH JOIN | |8 |185 | |1 | TABLE SCAN |t4 |8 |46 | |2 | NESTED-LOOP JOIN CARTESIAN | |9 |137 | |3 | TABLE SCAN |t2 |9 |46 | -|4 | MATERIAL | |1 |91 | +|4 | MATERIAL | |1 |92 | |5 | NESTED-LOOP OUTER JOIN CARTESIAN| |1 |91 | |6 | TABLE SCAN |t1 |1 |46 | |7 | MATERIAL | |1 |46 | @@ -68059,12 +68045,12 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------------- |0 |INSERT | |8 |242 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |184 | -|2 | HASH JOIN | |8 |184 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |185 | +|2 | HASH JOIN | |8 |185 | |3 | TABLE SCAN |t4 |8 |46 | |4 | NESTED-LOOP JOIN CARTESIAN | |9 |137 | |5 | TABLE SCAN |t2 |9 |46 | -|6 | MATERIAL | |1 |91 | +|6 | MATERIAL | |1 |92 | |7 | NESTED-LOOP OUTER JOIN CARTESIAN| |1 |91 | |8 | TABLE SCAN |t1 |1 |46 | |9 | MATERIAL | |1 |46 | @@ -68103,7 +68089,7 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |8 |245 | +|0 |INSERT | |8 |246 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | |2 | HASH RIGHT OUTER JOIN | |8 |188 | |3 | TABLE SCAN |t3 |8 |46 | @@ -68154,14 +68140,14 @@ Query Plan |5 | SUBPLAN SCAN |VIEW1|1 |138 | |6 | LIMIT | |1 |138 | |7 | NESTED-LOOP JOIN CARTESIAN | |1 |138 | -|8 | SUBPLAN SCAN |VIEW2|1 |92 | -|9 | LIMIT | |1 |92 | -|10| HASH JOIN | |1 |92 | -|11| TABLE SCAN |t4 |8 |46 | -|12| TABLE SCAN |t2 |2 |46 | -|13| MATERIAL | |1 |46 | -|14| SUBPLAN SCAN |VIEW3|1 |46 | -|15| TABLE SCAN |t1 |1 |46 | +|8 | SUBPLAN SCAN |VIEW3|1 |46 | +|9 | TABLE SCAN |t1 |1 |46 | +|10| MATERIAL | |1 |92 | +|11| SUBPLAN SCAN |VIEW2|1 |92 | +|12| LIMIT | |1 |92 | +|13| HASH JOIN | |1 |92 | +|14| TABLE SCAN |t4 |8 |46 | +|15| TABLE SCAN |t2 |2 |46 | |16| MATERIAL | |1 |46 | |17| TABLE SCAN |t3 |1 |46 | ============================================================= @@ -68182,21 +68168,21 @@ Outputs & filters: 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 8 - output(nil), filter(nil), rowset=256, - access(nil) - 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 10 - output(nil), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 11 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 12 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 14 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + 8 - output([VIEW3.t1.c1]), filter(nil), rowset=256, access([VIEW3.t1.c1]) - 15 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, + 9 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 14 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) + 15 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter([t3.c1 = 1]), rowset=256, access([t3.c1]), partitions(p0) @@ -68227,22 +68213,22 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 inner join t4 on t4.c1=t2.c1 limit 1); Query Plan -=================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |8 |314 | -|1 | SUBPLAN FILTER | |8 |230 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |185 | -|4 | HASH JOIN | |1 |185 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | NESTED-LOOP OUTER JOIN| |2 |138 | -|7 | HASH OUTER JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |9 |46 | -|11| TABLE SCAN |t2 |9 |46 | -=================================================== +==================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +---------------------------------------------------- +|0 |UPDATE | |8 |317 | +|1 | SUBPLAN FILTER | |8 |233 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |188 | +|4 | HASH OUTER JOIN | |1 |188 | +|5 | HASH JOIN | |8 |141 | +|6 | TABLE SCAN |t4 |8 |46 | +|7 | NESTED-LOOP OUTER JOIN| |9 |94 | +|8 | TABLE SCAN |t1 |8 |46 | +|9 | MATERIAL | |9 |46 | +|10| TABLE SCAN |t2 |9 |46 | +|11| TABLE SCAN |t3 |1 |46 | +==================================================== Outputs & filters: ------------------------------------- @@ -68254,20 +68240,20 @@ Outputs & filters: access([t1.__pk_increment], [t1.c2], [t1.c1]), partitions(p0) 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 5 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - conds([t1.c1 = 1]), nl_params_(nil) - 7 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 5 - output([t1.c1]), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 6 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) + 7 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + conds([t1.c1 = 1]), nl_params_(nil) 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter(nil), rowset=256 - 11 - output([t2.c1]), filter(nil), rowset=256, + 9 - output([t2.c1]), filter(nil), rowset=256 + 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 11 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 inner join t4 on t4.c1=t2.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -68298,7 +68284,7 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |DELETE | |1 |240 | +|0 |DELETE | |1 |241 | |1 | SUBPLAN FILTER | |1 |229 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | @@ -68306,14 +68292,14 @@ Query Plan |5 | SUBPLAN SCAN |VIEW1|1 |138 | |6 | LIMIT | |1 |138 | |7 | NESTED-LOOP JOIN CARTESIAN | |1 |138 | -|8 | SUBPLAN SCAN |VIEW2|1 |92 | -|9 | LIMIT | |1 |92 | -|10| HASH JOIN | |1 |92 | -|11| TABLE SCAN |t4 |8 |46 | -|12| TABLE SCAN |t2 |2 |46 | -|13| MATERIAL | |1 |46 | -|14| SUBPLAN SCAN |VIEW3|1 |46 | -|15| TABLE SCAN |t1 |1 |46 | +|8 | SUBPLAN SCAN |VIEW3|1 |46 | +|9 | TABLE SCAN |t1 |1 |46 | +|10| MATERIAL | |1 |92 | +|11| SUBPLAN SCAN |VIEW2|1 |92 | +|12| LIMIT | |1 |92 | +|13| HASH JOIN | |1 |92 | +|14| TABLE SCAN |t4 |8 |46 | +|15| TABLE SCAN |t2 |2 |46 | |16| MATERIAL | |1 |46 | |17| TABLE SCAN |t3 |1 |46 | ============================================================= @@ -68333,21 +68319,21 @@ Outputs & filters: 6 - output([VIEW3.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 7 - output([VIEW3.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 8 - output(nil), filter(nil), rowset=256, - access(nil) - 9 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) - 10 - output(nil), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 11 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 12 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 13 - output([VIEW3.t1.c1]), filter(nil), rowset=256 - 14 - output([VIEW3.t1.c1]), filter(nil), rowset=256, + 8 - output([VIEW3.t1.c1]), filter(nil), rowset=256, access([VIEW3.t1.c1]) - 15 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, + 9 - output([t1.c1]), filter([t1.c1 = 1]), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 10 - output(nil), filter(nil), rowset=256 + 11 - output(nil), filter(nil), rowset=256, + access(nil) + 12 - output([1]), filter(nil), rowset=256, limit(1), offset(nil) + 13 - output(nil), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 14 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) + 15 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) 16 - output(nil), filter(nil), rowset=256 17 - output(nil), filter([t3.c1 = 1]), rowset=256, access([t3.c1]), partitions(p0) @@ -68378,22 +68364,22 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 inner join t4 on t4.c1=t2.c1 limit 1); Query Plan -=================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |242 | -|1 | SUBPLAN FILTER | |1 |230 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |185 | -|4 | HASH JOIN | |1 |185 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | NESTED-LOOP OUTER JOIN| |2 |138 | -|7 | HASH OUTER JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |9 |46 | -|11| TABLE SCAN |t2 |9 |46 | -=================================================== +==================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +---------------------------------------------------- +|0 |DELETE | |1 |245 | +|1 | SUBPLAN FILTER | |1 |233 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |188 | +|4 | HASH OUTER JOIN | |1 |188 | +|5 | HASH JOIN | |8 |141 | +|6 | TABLE SCAN |t4 |8 |46 | +|7 | NESTED-LOOP OUTER JOIN| |9 |94 | +|8 | TABLE SCAN |t1 |8 |46 | +|9 | MATERIAL | |9 |46 | +|10| TABLE SCAN |t2 |9 |46 | +|11| TABLE SCAN |t3 |1 |46 | +==================================================== Outputs & filters: ------------------------------------- @@ -68404,20 +68390,20 @@ Outputs & filters: access([t1.__pk_increment], [t1.c1], [t1.c2]), partitions(p0) 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 5 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - conds([t1.c1 = 1]), nl_params_(nil) - 7 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 5 - output([t1.c1]), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 6 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) + 7 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + conds([t1.c1 = 1]), nl_params_(nil) 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter(nil), rowset=256 - 11 - output([t2.c1]), filter(nil), rowset=256, + 9 - output([t2.c1]), filter(nil), rowset=256 + 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 11 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 inner join t4 on t4.c1=t2.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -68557,7 +68543,7 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |9 |251 | +|0 |INSERT | |9 |252 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |188 | |2 | HASH RIGHT OUTER JOIN | |9 |188 | |3 | TABLE SCAN |t4 |8 |46 | @@ -68600,7 +68586,7 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |9 |251 | +|0 |INSERT | |9 |252 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |188 | |2 | HASH RIGHT OUTER JOIN | |9 |188 | |3 | TABLE SCAN |t4 |8 |46 | @@ -68646,8 +68632,8 @@ Query Plan |0 |UPDATE | |8 |313 | |1 | SUBPLAN FILTER | |8 |229 | |2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |183 | -|4 | HASH RIGHT OUTER JOIN | |1 |183 | +|3 | LIMIT | |1 |184 | +|4 | HASH RIGHT OUTER JOIN | |1 |184 | |5 | TABLE SCAN |t4 |8 |46 | |6 | NESTED-LOOP OUTER JOIN| |1 |137 | |7 | HASH OUTER JOIN | |1 |91 | @@ -68712,22 +68698,22 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 left join t4 on t4.c1=t2.c1 limit 1); Query Plan -=================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |8 |314 | -|1 | SUBPLAN FILTER | |8 |230 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |185 | -|4 | HASH RIGHT OUTER JOIN | |1 |185 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |138 | -|7 | HASH OUTER JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |9 |46 | -|11| TABLE SCAN |t2 |9 |46 | -=================================================== +==================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +---------------------------------------------------- +|0 |UPDATE | |8 |315 | +|1 | SUBPLAN FILTER | |8 |231 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |185 | +|4 | HASH RIGHT OUTER JOIN | |1 |185 | +|5 | TABLE SCAN |t3 |8 |46 | +|6 | NESTED-LOOP OUTER JOIN | |1 |139 | +|7 | TABLE SCAN |t1 |1 |46 | +|8 | MATERIAL | |9 |93 | +|9 | HASH RIGHT OUTER JOIN| |9 |93 | +|10| TABLE SCAN |t4 |8 |46 | +|11| TABLE SCAN |t2 |9 |46 | +==================================================== Outputs & filters: ------------------------------------- @@ -68739,18 +68725,18 @@ Outputs & filters: access([t1.__pk_increment], [t1.c2], [t1.c1]), partitions(p0) 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 5 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 5 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 6 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 1]), nl_params_(nil) 7 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t3.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256 + 9 - output(nil), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -68783,11 +68769,11 @@ Query Plan ==================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |240 | +|0 |DELETE | |1 |241 | |1 | SUBPLAN FILTER | |1 |229 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |183 | -|4 | HASH RIGHT OUTER JOIN | |1 |183 | +|3 | LIMIT | |1 |184 | +|4 | HASH RIGHT OUTER JOIN | |1 |184 | |5 | TABLE SCAN |t4 |8 |46 | |6 | NESTED-LOOP OUTER JOIN| |1 |137 | |7 | HASH OUTER JOIN | |1 |91 | @@ -68851,22 +68837,22 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join t2 on t1.c1=1 left join t3 on t1.c1=t3.c1 left join t4 on t4.c1=t2.c1 limit 1); Query Plan -=================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |242 | -|1 | SUBPLAN FILTER | |1 |230 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |185 | -|4 | HASH RIGHT OUTER JOIN | |1 |185 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | NESTED-LOOP OUTER JOIN| |1 |138 | -|7 | HASH OUTER JOIN | |1 |92 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| MATERIAL | |9 |46 | -|11| TABLE SCAN |t2 |9 |46 | -=================================================== +==================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +---------------------------------------------------- +|0 |DELETE | |1 |242 | +|1 | SUBPLAN FILTER | |1 |231 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |185 | +|4 | HASH RIGHT OUTER JOIN | |1 |185 | +|5 | TABLE SCAN |t3 |8 |46 | +|6 | NESTED-LOOP OUTER JOIN | |1 |139 | +|7 | TABLE SCAN |t1 |1 |46 | +|8 | MATERIAL | |9 |93 | +|9 | HASH RIGHT OUTER JOIN| |9 |93 | +|10| TABLE SCAN |t4 |8 |46 | +|11| TABLE SCAN |t2 |9 |46 | +==================================================== Outputs & filters: ------------------------------------- @@ -68877,18 +68863,18 @@ Outputs & filters: access([t1.__pk_increment], [t1.c1], [t1.c2]), partitions(p0) 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t4.c1 = t2.c1]), other_conds(nil) - 5 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 5 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 6 - output([t1.c1]), filter(nil), rowset=256, conds([t1.c1 = 1]), nl_params_(nil) 7 - output([t1.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t3.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256 + 9 - output(nil), filter(nil), rowset=256, + equal_conds([t4.c1 = t2.c1]), other_conds(nil) + 10 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) 11 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -68922,7 +68908,7 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |HASH OUTER JOIN| |8 |187 | +|0 |HASH OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t1 |8 |46 | |2 | HASH JOIN | |8 |140 | |3 | TABLE SCAN |t4 |8 |46 | @@ -68964,17 +68950,17 @@ select * from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2. +------+------+------+------+------+------+------+------+ EXPLAIN select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1; Query Plan -=============================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ -|0 |HASH OUTER JOIN | |9 |187 | -|1 | TABLE SCAN |t1 |8 |46 | -|2 | HASH RIGHT OUTER JOIN| |9 |140 | -|3 | HASH OUTER JOIN | |8 |93 | -|4 | TABLE SCAN |t3 |8 |46 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | TABLE SCAN |t2 |9 |46 | -=============================================== +================================================ +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------ +|0 |HASH OUTER JOIN | |9 |188 | +|1 | TABLE SCAN |t1 |8 |46 | +|2 | HASH RIGHT OUTER JOIN | |9 |140 | +|3 | TABLE SCAN |t4 |8 |46 | +|4 | HASH RIGHT OUTER JOIN| |9 |93 | +|5 | TABLE SCAN |t3 |8 |46 | +|6 | TABLE SCAN |t2 |9 |46 | +================================================ Outputs & filters: ------------------------------------- @@ -68983,13 +68969,13 @@ Outputs & filters: 1 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) 2 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 3 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 5 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 3 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 6 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -69012,9 +68998,9 @@ Query Plan ===================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t1 |8 |46 | |4 | HASH JOIN | |8 |140 | |5 | TABLE SCAN |t4 |8 |46 | @@ -69050,19 +69036,19 @@ insert into t7_temp (select * from t1 left join (t2 left join (t3 left join t4 o rollback; EXPLAIN insert into t7_temp (select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1); Query Plan -============================================================ -|ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |9 |251 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |187 | -|2 | HASH OUTER JOIN | |9 |187 | -|3 | TABLE SCAN |t1 |8 |46 | -|4 | HASH RIGHT OUTER JOIN| |9 |140 | -|5 | HASH OUTER JOIN | |8 |93 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | TABLE SCAN |t4 |8 |46 | -|8 | TABLE SCAN |t2 |9 |46 | -============================================================ +============================================================= +|ID|OPERATOR |NAME |EST. ROWS|COST| +------------------------------------------------------------- +|0 |INSERT | |9 |251 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |188 | +|2 | HASH OUTER JOIN | |9 |188 | +|3 | TABLE SCAN |t1 |8 |46 | +|4 | HASH RIGHT OUTER JOIN | |9 |140 | +|5 | TABLE SCAN |t4 |8 |46 | +|6 | HASH RIGHT OUTER JOIN| |9 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t2 |9 |46 | +============================================================= Outputs & filters: ------------------------------------- @@ -69076,13 +69062,13 @@ Outputs & filters: 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, access([t1.c1], [t1.c2]), partitions(p0) 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 5 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 7 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 5 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 6 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 8 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -69095,17 +69081,17 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------- |0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |231 | +|1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH OUTER JOIN| |1 |186 | |5 | SUBPLAN SCAN |VIEW1|1 |46 | |6 | TABLE SCAN |t1 |1 |46 | |7 | HASH JOIN | |8 |140 | -|8 | TABLE SCAN |t4 |8 |46 | -|9 | HASH JOIN | |8 |93 | -|10| TABLE SCAN |t3 |8 |46 | -|11| TABLE SCAN |t2 |9 |46 | +|8 | HASH JOIN | |8 |93 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t2 |9 |46 | +|11| TABLE SCAN |t4 |8 |46 | ============================================ Outputs & filters: @@ -69126,14 +69112,14 @@ Outputs & filters: limit(1), offset(nil) 7 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, + 8 - output([t3.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 10 - output([t3.c1]), filter(nil), rowset=256, + 9 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 11 - output([t2.c1]), filter(nil), rowset=256, + 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 11 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -69161,21 +69147,21 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1 limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |231 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |186 | -|4 | HASH OUTER JOIN | |1 |186 | -|5 | TABLE SCAN |t1 |8 |46 | -|6 | HASH RIGHT OUTER JOIN| |1 |139 | -|7 | HASH OUTER JOIN | |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | -|10| TABLE SCAN |t2 |1 |46 | -================================================== +=================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +--------------------------------------------------- +|0 |UPDATE | |8 |316 | +|1 | SUBPLAN FILTER | |8 |231 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |186 | +|4 | HASH OUTER JOIN | |1 |186 | +|5 | TABLE SCAN |t1 |8 |46 | +|6 | HASH RIGHT OUTER JOIN | |1 |139 | +|7 | TABLE SCAN |t4 |8 |46 | +|8 | HASH RIGHT OUTER JOIN| |1 |92 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t2 |1 |46 | +=================================================== Outputs & filters: ------------------------------------- @@ -69191,13 +69177,13 @@ Outputs & filters: 5 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) 6 - output([t4.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 7 - output([t3.c1], [t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 7 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 8 - output([t3.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -69238,10 +69224,10 @@ Query Plan |5 | SUBPLAN SCAN |VIEW1|1 |46 | |6 | TABLE SCAN |t1 |1 |46 | |7 | HASH JOIN | |8 |140 | -|8 | TABLE SCAN |t4 |8 |46 | -|9 | HASH JOIN | |8 |93 | -|10| TABLE SCAN |t3 |8 |46 | -|11| TABLE SCAN |t2 |9 |46 | +|8 | HASH JOIN | |8 |93 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t2 |9 |46 | +|11| TABLE SCAN |t4 |8 |46 | ============================================ Outputs & filters: @@ -69261,14 +69247,14 @@ Outputs & filters: limit(1), offset(nil) 7 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t4.c1]), filter(nil), rowset=256, - access([t4.c1]), partitions(p0) - 9 - output([t3.c1]), filter(nil), rowset=256, + 8 - output([t3.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 10 - output([t3.c1]), filter(nil), rowset=256, + 9 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 11 - output([t2.c1]), filter(nil), rowset=256, + 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) + 11 - output([t4.c1]), filter(nil), rowset=256, + access([t4.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -69296,21 +69282,21 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t4.c1 limit 1); Query Plan -================================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |243 | -|1 | SUBPLAN FILTER | |1 |231 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |186 | -|4 | HASH OUTER JOIN | |1 |186 | -|5 | TABLE SCAN |t1 |8 |46 | -|6 | HASH RIGHT OUTER JOIN| |1 |139 | -|7 | HASH OUTER JOIN | |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | -|10| TABLE SCAN |t2 |1 |46 | -================================================== +=================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +--------------------------------------------------- +|0 |DELETE | |1 |243 | +|1 | SUBPLAN FILTER | |1 |231 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |186 | +|4 | HASH OUTER JOIN | |1 |186 | +|5 | TABLE SCAN |t1 |8 |46 | +|6 | HASH RIGHT OUTER JOIN | |1 |139 | +|7 | TABLE SCAN |t4 |8 |46 | +|8 | HASH RIGHT OUTER JOIN| |1 |92 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t2 |1 |46 | +=================================================== Outputs & filters: ------------------------------------- @@ -69325,13 +69311,13 @@ Outputs & filters: 5 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0) 6 - output([t4.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 7 - output([t3.c1], [t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 7 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 8 - output([t3.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 9 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -69365,7 +69351,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT OUTER JOIN| |8 |187 | +|0 |HASH RIGHT OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t4 |8 |46 | |2 | HASH OUTER JOIN | |8 |140 | |3 | TABLE SCAN |t1 |8 |46 | @@ -69407,32 +69393,32 @@ select * from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2. +------+------+------+------+------+------+------+------+ EXPLAIN select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t3.c1; Query Plan -=============================================== -|ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ -|0 |HASH OUTER JOIN | |9 |187 | -|1 | TABLE SCAN |t1 |8 |46 | -|2 | HASH RIGHT OUTER JOIN| |9 |140 | -|3 | HASH OUTER JOIN | |8 |93 | -|4 | TABLE SCAN |t3 |8 |46 | -|5 | TABLE SCAN |t4 |8 |46 | -|6 | TABLE SCAN |t2 |9 |46 | -=============================================== +================================================ +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------ +|0 |HASH RIGHT OUTER JOIN | |9 |188 | +|1 | TABLE SCAN |t4 |8 |46 | +|2 | HASH OUTER JOIN | |9 |140 | +|3 | TABLE SCAN |t1 |8 |46 | +|4 | HASH RIGHT OUTER JOIN| |9 |93 | +|5 | TABLE SCAN |t3 |8 |46 | +|6 | TABLE SCAN |t2 |9 |46 | +================================================ Outputs & filters: ------------------------------------- 0 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t1.c1 = t3.c1]), other_conds(nil) - 1 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 2 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 3 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 5 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 1 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) + 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 6 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -69455,9 +69441,9 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t4 |8 |46 | |4 | HASH OUTER JOIN | |8 |140 | |5 | TABLE SCAN |t1 |8 |46 | @@ -69493,19 +69479,19 @@ insert into t7_temp (select * from t1 left join (t2 left join (t3 left join t4 o rollback; EXPLAIN insert into t7_temp (select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t1.c1=t3.c1); Query Plan -============================================================ -|ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |9 |251 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |187 | -|2 | HASH OUTER JOIN | |9 |187 | -|3 | TABLE SCAN |t1 |8 |46 | -|4 | HASH RIGHT OUTER JOIN| |9 |140 | -|5 | HASH OUTER JOIN | |8 |93 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | TABLE SCAN |t4 |8 |46 | -|8 | TABLE SCAN |t2 |9 |46 | -============================================================ +============================================================= +|ID|OPERATOR |NAME |EST. ROWS|COST| +------------------------------------------------------------- +|0 |INSERT | |9 |251 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|9 |188 | +|2 | HASH RIGHT OUTER JOIN | |9 |188 | +|3 | TABLE SCAN |t4 |8 |46 | +|4 | HASH OUTER JOIN | |9 |140 | +|5 | TABLE SCAN |t1 |8 |46 | +|6 | HASH RIGHT OUTER JOIN| |9 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t2 |9 |46 | +============================================================= Outputs & filters: ------------------------------------- @@ -69515,17 +69501,17 @@ Outputs & filters: 1 - output([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]), filter(nil), rowset=256, access([ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c1], [ANONYMOUS_VIEW1.c2]) 2 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t1.c1 = t3.c1]), other_conds(nil) - 3 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, - access([t1.c1], [t1.c2]), partitions(p0) - 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 5 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 7 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 3 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 4 - output([t1.c1], [t1.c2], [t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t1.c1 = t3.c1]), other_conds(nil) + 5 - output([t1.c1], [t1.c2]), filter(nil), rowset=256, + access([t1.c1], [t1.c2]), partitions(p0) + 6 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 8 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -69608,12 +69594,12 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |231 | +|1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH OUTER JOIN | |1 |186 | |5 | TABLE SCAN |t1 |8 |46 | -|6 | HASH RIGHT OUTER JOIN| |1 |139 | +|6 | HASH RIGHT OUTER JOIN| |1 |140 | |7 | HASH OUTER JOIN | |8 |93 | |8 | TABLE SCAN |t3 |8 |46 | |9 | TABLE SCAN |t4 |8 |46 | @@ -69743,12 +69729,12 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |DELETE | |1 |243 | -|1 | SUBPLAN FILTER | |1 |231 | +|1 | SUBPLAN FILTER | |1 |232 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |186 | |4 | HASH OUTER JOIN | |1 |186 | |5 | TABLE SCAN |t1 |8 |46 | -|6 | HASH RIGHT OUTER JOIN| |1 |139 | +|6 | HASH RIGHT OUTER JOIN| |1 |140 | |7 | HASH OUTER JOIN | |8 |93 | |8 | TABLE SCAN |t3 |8 |46 | |9 | TABLE SCAN |t4 |8 |46 | @@ -69881,7 +69867,7 @@ Query Plan ================================================ |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ -|0 |NESTED-LOOP OUTER JOIN | |1 |186 | +|0 |NESTED-LOOP OUTER JOIN | |1 |187 | |1 | NESTED-LOOP OUTER JOIN| |1 |141 | |2 | HASH OUTER JOIN | |8 |93 | |3 | TABLE SCAN |t1 |8 |46 | @@ -70000,8 +69986,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- |0 |INSERT | |1 |199 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |186 | -|2 | NESTED-LOOP OUTER JOIN | |1 |186 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |187 | +|2 | NESTED-LOOP OUTER JOIN | |1 |187 | |3 | NESTED-LOOP OUTER JOIN| |1 |141 | |4 | HASH OUTER JOIN | |8 |93 | |5 | TABLE SCAN |t1 |8 |46 | @@ -70336,11 +70322,11 @@ Query Plan |0 |NESTED-LOOP JOIN CARTESIAN| |6 |183 | |1 | TABLE SCAN |t1 |8 |46 | |2 | MATERIAL | |1 |137 | -|3 | HASH OUTER JOIN | |1 |137 | -|4 | HASH JOIN | |1 |92 | -|5 | TABLE SCAN |t3 |1 |46 | -|6 | TABLE SCAN |t2 |1 |46 | -|7 | TABLE SCAN |t4 |1 |46 | +|3 | HASH RIGHT OUTER JOIN | |1 |137 | +|4 | TABLE SCAN |t4 |1 |46 | +|5 | HASH JOIN | |1 |92 | +|6 | TABLE SCAN |t3 |1 |46 | +|7 | TABLE SCAN |t2 |1 |46 | =================================================== Outputs & filters: @@ -70352,14 +70338,14 @@ Outputs & filters: 2 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256 3 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter([t3.c1 > 1]), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t2.c1], [t2.c2]), filter([t2.c1 > 1]), rowset=256, - access([t2.c1], [t2.c2]), partitions(p0) - 7 - output([t4.c1], [t4.c2]), filter([t4.c1 > 1]), rowset=256, + 4 - output([t4.c1], [t4.c2]), filter([t4.c1 > 1]), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 5 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 6 - output([t3.c1], [t3.c2]), filter([t3.c1 > 1]), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) + 7 - output([t2.c1], [t2.c2]), filter([t2.c1 > 1]), rowset=256, + access([t2.c1], [t2.c2]), partitions(p0) select * from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1; +------+------+------+------+------+------+------+------+ @@ -70384,18 +70370,18 @@ select * from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2. +------+------+------+------+------+------+------+------+ EXPLAIN select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1; Query Plan -================================================ -|ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |NESTED-LOOP OUTER JOIN | |8 |186 | -|1 | TABLE SCAN |t1 |8 |46 | -|2 | MATERIAL | |1 |140 | -|3 | HASH RIGHT OUTER JOIN| |1 |140 | -|4 | HASH OUTER JOIN | |8 |93 | -|5 | TABLE SCAN |t3 |8 |46 | -|6 | TABLE SCAN |t4 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | -================================================ +================================================= +|ID|OPERATOR |NAME|EST. ROWS|COST| +------------------------------------------------- +|0 |NESTED-LOOP OUTER JOIN | |8 |186 | +|1 | TABLE SCAN |t1 |8 |46 | +|2 | MATERIAL | |1 |141 | +|3 | HASH RIGHT OUTER JOIN | |1 |140 | +|4 | TABLE SCAN |t4 |8 |46 | +|5 | HASH RIGHT OUTER JOIN| |9 |93 | +|6 | TABLE SCAN |t3 |8 |46 | +|7 | TABLE SCAN |t2 |9 |46 | +================================================= Outputs & filters: ------------------------------------- @@ -70405,13 +70391,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 2 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256 3 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter([t3.c1 > 1]), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 4 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 5 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 6 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 4 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 5 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 6 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 7 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -70446,11 +70432,11 @@ Query Plan |2 | NESTED-LOOP JOIN CARTESIAN| |6 |183 | |3 | TABLE SCAN |t1 |8 |46 | |4 | MATERIAL | |1 |137 | -|5 | HASH OUTER JOIN | |1 |137 | -|6 | HASH JOIN | |1 |92 | -|7 | TABLE SCAN |t3 |1 |46 | -|8 | TABLE SCAN |t2 |1 |46 | -|9 | TABLE SCAN |t4 |1 |46 | +|5 | HASH RIGHT OUTER JOIN | |1 |137 | +|6 | TABLE SCAN |t4 |1 |46 | +|7 | HASH JOIN | |1 |92 | +|8 | TABLE SCAN |t3 |1 |46 | +|9 | TABLE SCAN |t2 |1 |46 | ================================================================ Outputs & filters: @@ -70467,34 +70453,34 @@ Outputs & filters: 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256 5 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 6 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 7 - output([t3.c1], [t3.c2]), filter([t3.c1 > 1]), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 8 - output([t2.c1], [t2.c2]), filter([t2.c1 > 1]), rowset=256, - access([t2.c1], [t2.c2]), partitions(p0) - 9 - output([t4.c1], [t4.c2]), filter([t4.c1 > 1]), rowset=256, + 6 - output([t4.c1], [t4.c2]), filter([t4.c1 > 1]), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 7 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 8 - output([t3.c1], [t3.c2]), filter([t3.c1 > 1]), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) + 9 - output([t2.c1], [t2.c2]), filter([t2.c1 > 1]), rowset=256, + access([t2.c1], [t2.c2]), partitions(p0) insert into t7_temp (select * from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1); rollback; EXPLAIN insert into t7_temp (select /*+NO_REWRITE*/* from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1); Query Plan -============================================================= -|ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |INSERT | |8 |238 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |186 | -|2 | NESTED-LOOP OUTER JOIN | |8 |186 | -|3 | TABLE SCAN |t1 |8 |46 | -|4 | MATERIAL | |1 |140 | -|5 | HASH RIGHT OUTER JOIN| |1 |140 | -|6 | HASH OUTER JOIN | |8 |93 | -|7 | TABLE SCAN |t3 |8 |46 | -|8 | TABLE SCAN |t4 |8 |46 | -|9 | TABLE SCAN |t2 |9 |46 | -============================================================= +============================================================== +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------------------------- +|0 |INSERT | |8 |238 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |186 | +|2 | NESTED-LOOP OUTER JOIN | |8 |186 | +|3 | TABLE SCAN |t1 |8 |46 | +|4 | MATERIAL | |1 |141 | +|5 | HASH RIGHT OUTER JOIN | |1 |140 | +|6 | TABLE SCAN |t4 |8 |46 | +|7 | HASH RIGHT OUTER JOIN| |9 |93 | +|8 | TABLE SCAN |t3 |8 |46 | +|9 | TABLE SCAN |t2 |9 |46 | +============================================================== Outputs & filters: ------------------------------------- @@ -70509,13 +70495,13 @@ Outputs & filters: access([t1.c1], [t1.c2]), partitions(p0) 4 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256 5 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter([t3.c1 > 1]), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 6 - output([t3.c1], [t3.c2], [t4.c1], [t4.c2]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 7 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, - access([t3.c1], [t3.c2]), partitions(p0) - 8 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, + 6 - output([t4.c1], [t4.c2]), filter(nil), rowset=256, access([t4.c1], [t4.c2]), partitions(p0) + 7 - output([t2.c1], [t2.c2], [t3.c1], [t3.c2]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 8 - output([t3.c1], [t3.c2]), filter(nil), rowset=256, + access([t3.c1], [t3.c2]), partitions(p0) 9 - output([t2.c1], [t2.c2]), filter(nil), rowset=256, access([t2.c1], [t2.c2]), partitions(p0) @@ -70532,16 +70518,16 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |183 | -|5 | HASH OUTER JOIN | |1 |137 | -|6 | SUBPLAN SCAN |VIEW2|1 |92 | -|7 | LIMIT | |1 |92 | -|8 | HASH JOIN | |1 |92 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| TABLE SCAN |t2 |1 |46 | -|11| TABLE SCAN |t4 |1 |46 | -|12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW1|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|5 | SUBPLAN SCAN |VIEW1|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |137 | +|8 | HASH OUTER JOIN | |1 |137 | +|9 | SUBPLAN SCAN |VIEW2|1 |92 | +|10| LIMIT | |1 |92 | +|11| HASH JOIN | |1 |92 | +|12| TABLE SCAN |t3 |1 |46 | +|13| TABLE SCAN |t2 |1 |46 | +|14| TABLE SCAN |t4 |1 |46 | ======================================================= Outputs & filters: @@ -70555,25 +70541,25 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - equal_conds([VIEW2.t3.c1 = t4.c1]), other_conds(nil) - 6 - output([VIEW2.t3.c1]), filter(nil), rowset=256, - access([VIEW2.t3.c1]) - 7 - output([t3.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 9 - output([t3.c1]), filter([t3.c1 > 1]), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter([t2.c1 > 1]), rowset=256, - access([t2.c1]), partitions(p0) - 11 - output([t4.c1]), filter([t4.c1 > 1]), rowset=256, - access([t4.c1]), partitions(p0) - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, access([VIEW1.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + equal_conds([VIEW2.t3.c1 = t4.c1]), other_conds(nil) + 9 - output([VIEW2.t3.c1]), filter(nil), rowset=256, + access([VIEW2.t3.c1]) + 10 - output([t3.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 11 - output([t3.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 12 - output([t3.c1]), filter([t3.c1 > 1]), rowset=256, + access([t3.c1]), partitions(p0) + 13 - output([t2.c1]), filter([t2.c1 > 1]), rowset=256, + access([t2.c1]), partitions(p0) + 14 - output([t4.c1]), filter([t4.c1 > 1]), rowset=256, + access([t4.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -70607,8 +70593,8 @@ Query Plan |0 |UPDATE | |8 |315 | |1 | SUBPLAN FILTER | |8 |231 | |2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |185 | -|4 | NESTED-LOOP OUTER JOIN | |1 |185 | +|3 | LIMIT | |1 |186 | +|4 | NESTED-LOOP OUTER JOIN | |1 |186 | |5 | TABLE SCAN |t1 |2 |46 | |6 | MATERIAL | |1 |140 | |7 | HASH RIGHT OUTER JOIN| |1 |140 | @@ -70677,16 +70663,16 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | NESTED-LOOP JOIN CARTESIAN| |1 |183 | -|5 | HASH OUTER JOIN | |1 |137 | -|6 | SUBPLAN SCAN |VIEW2|1 |92 | -|7 | LIMIT | |1 |92 | -|8 | HASH JOIN | |1 |92 | -|9 | TABLE SCAN |t3 |1 |46 | -|10| TABLE SCAN |t2 |1 |46 | -|11| TABLE SCAN |t4 |1 |46 | -|12| MATERIAL | |1 |46 | -|13| SUBPLAN SCAN |VIEW1|1 |46 | -|14| TABLE SCAN |t1 |1 |46 | +|5 | SUBPLAN SCAN |VIEW1|1 |46 | +|6 | TABLE SCAN |t1 |1 |46 | +|7 | MATERIAL | |1 |137 | +|8 | HASH OUTER JOIN | |1 |137 | +|9 | SUBPLAN SCAN |VIEW2|1 |92 | +|10| LIMIT | |1 |92 | +|11| HASH JOIN | |1 |92 | +|12| TABLE SCAN |t3 |1 |46 | +|13| TABLE SCAN |t2 |1 |46 | +|14| TABLE SCAN |t4 |1 |46 | ======================================================= Outputs & filters: @@ -70699,25 +70685,25 @@ Outputs & filters: 3 - output([VIEW1.t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([VIEW1.t1.c1]), filter(nil), rowset=256, conds(nil), nl_params_(nil) - 5 - output(nil), filter(nil), rowset=256, - equal_conds([VIEW2.t3.c1 = t4.c1]), other_conds(nil) - 6 - output([VIEW2.t3.c1]), filter(nil), rowset=256, - access([VIEW2.t3.c1]) - 7 - output([t3.c1]), filter(nil), rowset=256, limit(1), offset(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 9 - output([t3.c1]), filter([t3.c1 > 1]), rowset=256, - access([t3.c1]), partitions(p0) - 10 - output([t2.c1]), filter([t2.c1 > 1]), rowset=256, - access([t2.c1]), partitions(p0) - 11 - output([t4.c1]), filter([t4.c1 > 1]), rowset=256, - access([t4.c1]), partitions(p0) - 12 - output([VIEW1.t1.c1]), filter(nil), rowset=256 - 13 - output([VIEW1.t1.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.t1.c1]), filter(nil), rowset=256, access([VIEW1.t1.c1]) - 14 - output([t1.c1]), filter(nil), rowset=256, + 6 - output([t1.c1]), filter(nil), rowset=256, access([t1.c1]), partitions(p0), limit(1), offset(nil) + 7 - output(nil), filter(nil), rowset=256 + 8 - output(nil), filter(nil), rowset=256, + equal_conds([VIEW2.t3.c1 = t4.c1]), other_conds(nil) + 9 - output([VIEW2.t3.c1]), filter(nil), rowset=256, + access([VIEW2.t3.c1]) + 10 - output([t3.c1]), filter(nil), rowset=256, limit(1), offset(nil) + 11 - output([t3.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 12 - output([t3.c1]), filter([t3.c1 > 1]), rowset=256, + access([t3.c1]), partitions(p0) + 13 - output([t2.c1]), filter([t2.c1 > 1]), rowset=256, + access([t2.c1]), partitions(p0) + 14 - output([t4.c1]), filter([t4.c1 > 1]), rowset=256, + access([t4.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from t1 left join (t2 left join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t3.c1) on t3.c1>1 where t3.c1>1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -70748,11 +70734,11 @@ Query Plan =================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------------- -|0 |DELETE | |1 |242 | +|0 |DELETE | |1 |243 | |1 | SUBPLAN FILTER | |1 |231 | |2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |185 | -|4 | NESTED-LOOP OUTER JOIN | |1 |185 | +|3 | LIMIT | |1 |186 | +|4 | NESTED-LOOP OUTER JOIN | |1 |186 | |5 | TABLE SCAN |t1 |2 |46 | |6 | MATERIAL | |1 |140 | |7 | HASH RIGHT OUTER JOIN| |1 |140 | @@ -70816,7 +70802,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT OUTER JOIN| |8 |187 | +|0 |HASH RIGHT OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t2 |9 |46 | |2 | HASH OUTER JOIN | |8 |140 | |3 | TABLE SCAN |t1 |8 |46 | @@ -70861,7 +70847,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT OUTER JOIN| |8 |187 | +|0 |HASH RIGHT OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t2 |9 |46 | |2 | HASH OUTER JOIN | |8 |140 | |3 | TABLE SCAN |t1 |8 |46 | @@ -70906,9 +70892,9 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t2 |9 |46 | |4 | HASH OUTER JOIN | |8 |140 | |5 | TABLE SCAN |t1 |8 |46 | @@ -70947,9 +70933,9 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t2 |9 |46 | |4 | HASH OUTER JOIN | |8 |140 | |5 | TABLE SCAN |t1 |8 |46 | @@ -71055,21 +71041,21 @@ select stddev(c2) from t1; rollback; EXPLAIN update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) left join (t3 left join t4 on t3.c1=t4.c1) on t1.c1=t4.c1 limit 1); Query Plan -============================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |232 | -|2 | TABLE SCAN |t1 |8 |46 | -|3 | LIMIT | |1 |187 | -|4 | HASH OUTER JOIN | |1 |187 | -|5 | HASH OUTER JOIN | |8 |140 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | HASH OUTER JOIN| |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | -|10| TABLE SCAN |t2 |2 |46 | -============================================= +================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +-------------------------------------------------- +|0 |UPDATE | |8 |317 | +|1 | SUBPLAN FILTER | |8 |232 | +|2 | TABLE SCAN |t1 |8 |46 | +|3 | LIMIT | |1 |187 | +|4 | HASH OUTER JOIN | |1 |187 | +|5 | HASH RIGHT OUTER JOIN| |8 |140 | +|6 | HASH OUTER JOIN | |8 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t4 |8 |46 | +|9 | TABLE SCAN |t1 |8 |46 | +|10| TABLE SCAN |t2 |2 |46 | +================================================== Outputs & filters: ------------------------------------- @@ -71084,14 +71070,14 @@ Outputs & filters: equal_conds([t1.c1 = t2.c1]), other_conds(nil) 5 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t4.c1]), filter(nil), rowset=256, + 6 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, + 7 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71190,21 +71176,21 @@ select stddev(c2) from t1; rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) left join (t3 left join t4 on t3.c1=t4.c1) on t1.c1=t4.c1 limit 1); Query Plan -============================================= -|ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |DELETE | |1 |244 | -|1 | SUBPLAN FILTER | |1 |232 | -|2 | TABLE SCAN |t1 |1 |46 | -|3 | LIMIT | |1 |187 | -|4 | HASH OUTER JOIN | |1 |187 | -|5 | HASH OUTER JOIN | |8 |140 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | HASH OUTER JOIN| |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | -|10| TABLE SCAN |t2 |2 |46 | -============================================= +================================================== +|ID|OPERATOR |NAME|EST. ROWS|COST| +-------------------------------------------------- +|0 |DELETE | |1 |244 | +|1 | SUBPLAN FILTER | |1 |232 | +|2 | TABLE SCAN |t1 |1 |46 | +|3 | LIMIT | |1 |187 | +|4 | HASH OUTER JOIN | |1 |187 | +|5 | HASH RIGHT OUTER JOIN| |8 |140 | +|6 | HASH OUTER JOIN | |8 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t4 |8 |46 | +|9 | TABLE SCAN |t1 |8 |46 | +|10| TABLE SCAN |t2 |2 |46 | +================================================== Outputs & filters: ------------------------------------- @@ -71218,14 +71204,14 @@ Outputs & filters: equal_conds([t1.c1 = t2.c1]), other_conds(nil) 5 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t4.c1]), filter(nil), rowset=256, + 6 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, + 7 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71259,7 +71245,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT OUTER JOIN| |8 |187 | +|0 |HASH RIGHT OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t2 |9 |46 | |2 | HASH FULL OUTER JOIN| |8 |140 | |3 | TABLE SCAN |t1 |8 |46 | @@ -71309,7 +71295,7 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |HASH RIGHT OUTER JOIN| |8 |187 | +|0 |HASH RIGHT OUTER JOIN| |8 |188 | |1 | TABLE SCAN |t2 |9 |46 | |2 | HASH FULL OUTER JOIN| |8 |140 | |3 | TABLE SCAN |t1 |8 |46 | @@ -71359,9 +71345,9 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t2 |9 |46 | |4 | HASH FULL OUTER JOIN| |8 |140 | |5 | TABLE SCAN |t1 |8 |46 | @@ -71400,9 +71386,9 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- -|0 |INSERT | |8 |244 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH RIGHT OUTER JOIN| |8 |187 | +|0 |INSERT | |8 |245 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH RIGHT OUTER JOIN| |8 |188 | |3 | TABLE SCAN |t2 |9 |46 | |4 | HASH FULL OUTER JOIN| |8 |140 | |5 | TABLE SCAN |t1 |8 |46 | @@ -71441,18 +71427,18 @@ Query Plan ==================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |8 |315 | -|1 | SUBPLAN FILTER | |8 |230 | +|0 |UPDATE | |8 |316 | +|1 | SUBPLAN FILTER | |8 |231 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH OUTER JOIN | |1 |186 | -|5 | SUBPLAN SCAN |VIEW1|1 |139 | -|6 | LIMIT | |1 |139 | -|7 | HASH FULL OUTER JOIN| |8 |139 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | HASH OUTER JOIN | |8 |92 | -|10| TABLE SCAN |t3 |8 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|5 | SUBPLAN SCAN |VIEW1|1 |140 | +|6 | LIMIT | |1 |140 | +|7 | HASH FULL OUTER JOIN| |8 |140 | +|8 | HASH OUTER JOIN | |8 |93 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t4 |8 |46 | +|11| TABLE SCAN |t1 |1 |46 | |12| TABLE SCAN |t2 |9 |46 | ==================================================== @@ -71472,14 +71458,14 @@ Outputs & filters: 6 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 7 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 10 - output([t3.c1]), filter(nil), rowset=256, + 9 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 11 - output([t4.c1]), filter(nil), rowset=256, + 10 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 11 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 12 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71512,16 +71498,16 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |UPDATE | |8 |316 | +|0 |UPDATE | |8 |317 | |1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |187 | |4 | HASH OUTER JOIN | |1 |187 | |5 | HASH FULL OUTER JOIN| |8 |140 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | HASH OUTER JOIN | |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | +|6 | HASH OUTER JOIN | |8 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t4 |8 |46 | +|9 | TABLE SCAN |t1 |8 |46 | |10| TABLE SCAN |t2 |2 |46 | ================================================= @@ -71538,14 +71524,14 @@ Outputs & filters: equal_conds([t1.c1 = t2.c1]), other_conds(nil) 5 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t4.c1]), filter(nil), rowset=256, + 6 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, + 7 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71578,18 +71564,18 @@ Query Plan ==================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------- -|0 |DELETE | |1 |242 | +|0 |DELETE | |1 |243 | |1 | SUBPLAN FILTER | |1 |231 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |186 | |4 | HASH OUTER JOIN | |1 |186 | -|5 | SUBPLAN SCAN |VIEW1|1 |139 | -|6 | LIMIT | |1 |139 | -|7 | HASH FULL OUTER JOIN| |8 |139 | -|8 | TABLE SCAN |t1 |8 |46 | -|9 | HASH OUTER JOIN | |8 |92 | -|10| TABLE SCAN |t3 |8 |46 | -|11| TABLE SCAN |t4 |1 |46 | +|5 | SUBPLAN SCAN |VIEW1|1 |140 | +|6 | LIMIT | |1 |140 | +|7 | HASH FULL OUTER JOIN| |8 |140 | +|8 | HASH OUTER JOIN | |8 |93 | +|9 | TABLE SCAN |t3 |8 |46 | +|10| TABLE SCAN |t4 |8 |46 | +|11| TABLE SCAN |t1 |1 |46 | |12| TABLE SCAN |t2 |9 |46 | ==================================================== @@ -71608,14 +71594,14 @@ Outputs & filters: 6 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 7 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 10 - output([t3.c1]), filter(nil), rowset=256, + 9 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 11 - output([t4.c1]), filter(nil), rowset=256, + 10 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 11 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 12 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71625,8 +71611,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -71640,7 +71626,7 @@ select stddev(c2) from t1; +--------------------+ | stddev(c2) | +--------------------+ -| 2.8722813232690143 | +| 2.8674417556808756 | +--------------------+ rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) full join (t3 left join t4 on t3.c1=t4.c1) on t1.c1=t4.c1 limit 1); @@ -71654,10 +71640,10 @@ Query Plan |3 | LIMIT | |1 |187 | |4 | HASH OUTER JOIN | |1 |187 | |5 | HASH FULL OUTER JOIN| |8 |140 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | HASH OUTER JOIN | |8 |93 | -|8 | TABLE SCAN |t3 |8 |46 | -|9 | TABLE SCAN |t4 |8 |46 | +|6 | HASH OUTER JOIN | |8 |93 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | TABLE SCAN |t4 |8 |46 | +|9 | TABLE SCAN |t1 |8 |46 | |10| TABLE SCAN |t2 |2 |46 | ================================================= @@ -71673,14 +71659,14 @@ Outputs & filters: equal_conds([t1.c1 = t2.c1]), other_conds(nil) 5 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t1.c1 = t4.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t4.c1]), filter(nil), rowset=256, + 6 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 8 - output([t3.c1]), filter(nil), rowset=256, + 7 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 9 - output([t4.c1]), filter(nil), rowset=256, + 8 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) 10 - output([t2.c1]), filter(nil), rowset=256, access([t2.c1]), partitions(p0) @@ -71714,7 +71700,7 @@ Query Plan ====================================== |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------- -|0 |HASH JOIN | |7 |187 | +|0 |HASH JOIN | |7 |188 | |1 | TABLE SCAN |t4 |8 |46 | |2 | HASH JOIN | |8 |140 | |3 | TABLE SCAN |t3 |8 |46 | @@ -71754,7 +71740,7 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |HASH JOIN | |8 |187 | +|0 |HASH JOIN | |8 |188 | |1 | HASH OUTER JOIN| |8 |93 | |2 | TABLE SCAN |t1 |8 |46 | |3 | TABLE SCAN |t2 |9 |46 | @@ -71795,8 +71781,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| --------------------------------------------------- |0 |INSERT | |7 |234 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|7 |187 | -|2 | HASH JOIN | |7 |187 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|7 |188 | +|2 | HASH JOIN | |7 |188 | |3 | TABLE SCAN |t4 |8 |46 | |4 | HASH JOIN | |8 |140 | |5 | TABLE SCAN |t3 |8 |46 | @@ -71836,8 +71822,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ |0 |INSERT | |8 |239 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |187 | -|2 | HASH JOIN | |8 |187 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |188 | +|2 | HASH JOIN | |8 |188 | |3 | HASH OUTER JOIN| |8 |93 | |4 | TABLE SCAN |t1 |8 |46 | |5 | TABLE SCAN |t2 |9 |46 | @@ -71877,16 +71863,16 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- |0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |232 | +|1 | SUBPLAN FILTER | |8 |231 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH JOIN | |1 |186 | -|5 | HASH JOIN | |8 |140 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | HASH JOIN | |8 |93 | -|8 | TABLE SCAN|t1 |8 |46 | -|9 | TABLE SCAN|t2 |9 |46 | -|10| TABLE SCAN |t4 |2 |46 | +|5 | TABLE SCAN |t4 |8 |46 | +|6 | HASH JOIN | |2 |139 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | HASH JOIN | |2 |92 | +|9 | TABLE SCAN|t1 |8 |46 | +|10| TABLE SCAN|t2 |2 |46 | ========================================= Outputs & filters: @@ -71900,18 +71886,18 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t4.c1]), other_conds(nil) - 5 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 6 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 7 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 9 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 10 - output([t4.c1]), filter(nil), rowset=256, + 5 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 7 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 8 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) update t1 set c2 = (select t1.c1 from (t1 left join t2 on t1.c1=t2.c1) inner join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -71943,16 +71929,16 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------- |0 |UPDATE | |8 |316 | -|1 | SUBPLAN FILTER | |8 |231 | +|1 | SUBPLAN FILTER | |8 |232 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |186 | |4 | HASH JOIN | |1 |186 | |5 | HASH OUTER JOIN| |8 |93 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | +|6 | TABLE SCAN |t3 |8 |46 | +|7 | TABLE SCAN |t4 |8 |46 | |8 | HASH OUTER JOIN| |2 |92 | -|9 | TABLE SCAN |t3 |8 |46 | -|10| TABLE SCAN |t4 |2 |46 | +|9 | TABLE SCAN |t1 |8 |46 | +|10| TABLE SCAN |t2 |2 |46 | ============================================ Outputs & filters: @@ -71966,18 +71952,18 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t4.c1]), other_conds(nil) - 5 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 8 - output([t4.c1]), filter(nil), rowset=256, + 5 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 9 - output([t3.c1]), filter(nil), rowset=256, + 6 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 10 - output([t4.c1]), filter(nil), rowset=256, + 7 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 8 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) update t1 set c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) inner join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -72008,17 +71994,17 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |DELETE | |1 |244 | -|1 | SUBPLAN FILTER | |1 |232 | +|0 |DELETE | |1 |243 | +|1 | SUBPLAN FILTER | |1 |231 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |186 | |4 | HASH JOIN | |1 |186 | -|5 | HASH JOIN | |8 |140 | -|6 | TABLE SCAN |t3 |8 |46 | -|7 | HASH JOIN | |8 |93 | -|8 | TABLE SCAN|t1 |8 |46 | -|9 | TABLE SCAN|t2 |9 |46 | -|10| TABLE SCAN |t4 |2 |46 | +|5 | TABLE SCAN |t4 |8 |46 | +|6 | HASH JOIN | |2 |139 | +|7 | TABLE SCAN |t3 |8 |46 | +|8 | HASH JOIN | |2 |92 | +|9 | TABLE SCAN|t1 |8 |46 | +|10| TABLE SCAN|t2 |2 |46 | ========================================= Outputs & filters: @@ -72031,18 +72017,18 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t4.c1]), other_conds(nil) - 5 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t2.c1 = t3.c1]), other_conds(nil) - 6 - output([t3.c1]), filter(nil), rowset=256, - access([t3.c1]), partitions(p0) - 7 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 8 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 9 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 10 - output([t4.c1]), filter(nil), rowset=256, + 5 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 6 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t2.c1 = t3.c1]), other_conds(nil) + 7 - output([t3.c1]), filter(nil), rowset=256, + access([t3.c1]), partitions(p0) + 8 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) delete from t1 where c2 = (select t1.c1 from (t1 left join t2 on t1.c1=t2.c1) inner join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -72050,8 +72036,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -72065,7 +72051,7 @@ select stddev(c2) from t1; +--------------------+ | stddev(c2) | +--------------------+ -| 2.8722813232690143 | +| 2.8674417556808756 | +--------------------+ rollback; EXPLAIN delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) inner join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t4.c1 limit 1); @@ -72079,11 +72065,11 @@ Query Plan |3 | LIMIT | |1 |186 | |4 | HASH JOIN | |1 |186 | |5 | HASH OUTER JOIN| |8 |93 | -|6 | TABLE SCAN |t1 |8 |46 | -|7 | TABLE SCAN |t2 |9 |46 | +|6 | TABLE SCAN |t3 |8 |46 | +|7 | TABLE SCAN |t4 |8 |46 | |8 | HASH OUTER JOIN| |2 |92 | -|9 | TABLE SCAN |t3 |8 |46 | -|10| TABLE SCAN |t4 |2 |46 | +|9 | TABLE SCAN |t1 |8 |46 | +|10| TABLE SCAN |t2 |2 |46 | ============================================ Outputs & filters: @@ -72096,18 +72082,18 @@ Outputs & filters: 3 - output([t1.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t1.c1]), filter(nil), rowset=256, equal_conds([t2.c1 = t4.c1]), other_conds(nil) - 5 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, - equal_conds([t1.c1 = t2.c1]), other_conds(nil) - 6 - output([t1.c1]), filter(nil), rowset=256, - access([t1.c1]), partitions(p0) - 7 - output([t2.c1]), filter(nil), rowset=256, - access([t2.c1]), partitions(p0) - 8 - output([t4.c1]), filter(nil), rowset=256, + 5 - output([t4.c1]), filter(nil), rowset=256, equal_conds([t3.c1 = t4.c1]), other_conds(nil) - 9 - output([t3.c1]), filter(nil), rowset=256, + 6 - output([t3.c1]), filter(nil), rowset=256, access([t3.c1]), partitions(p0) - 10 - output([t4.c1]), filter(nil), rowset=256, + 7 - output([t4.c1]), filter(nil), rowset=256, access([t4.c1]), partitions(p0) + 8 - output([t1.c1], [t2.c1]), filter(nil), rowset=256, + equal_conds([t1.c1 = t2.c1]), other_conds(nil) + 9 - output([t1.c1]), filter(nil), rowset=256, + access([t1.c1]), partitions(p0) + 10 - output([t2.c1]), filter(nil), rowset=256, + access([t2.c1]), partitions(p0) delete from t1 where c2 = (select /*+ NO_REWRITE */t1.c1 from (t1 left join t2 on t1.c1=t2.c1) inner join (t3 left join t4 on t3.c1=t4.c1) on t2.c1=t4.c1 limit 1); EXPLAIN select stddev(c2) from t1; @@ -72115,8 +72101,8 @@ Query Plan ======================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------- -|0 |SCALAR GROUP BY| |1 |46 | -|1 | TABLE SCAN |t1 |8 |46 | +|0 |SCALAR GROUP BY| |1 |1 | +|1 | TABLE SCAN |t1 |8 |1 | ======================================== Outputs & filters: @@ -72130,7 +72116,7 @@ select stddev(c2) from t1; +--------------------+ | stddev(c2) | +--------------------+ -| 2.8722813232690143 | +| 2.8674417556808756 | +--------------------+ rollback; @@ -72139,7 +72125,7 @@ Query Plan ================================================ |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ -|0 |HASH RIGHT OUTER JOIN | |8 |234 | +|0 |HASH RIGHT OUTER JOIN | |8 |235 | |1 | TABLE SCAN |t5 |5 |46 | |2 | NESTED-LOOP OUTER JOIN| |8 |188 | |3 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -72206,7 +72192,7 @@ Query Plan ================================================ |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------ -|0 |HASH RIGHT OUTER JOIN | |8 |234 | +|0 |HASH RIGHT OUTER JOIN | |8 |235 | |1 | TABLE SCAN |t5 |5 |46 | |2 | NESTED-LOOP OUTER JOIN| |8 |188 | |3 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -72273,9 +72259,9 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |8 |291 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |234 | -|2 | HASH RIGHT OUTER JOIN | |8 |234 | +|0 |INSERT | |8 |292 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |235 | +|2 | HASH RIGHT OUTER JOIN | |8 |235 | |3 | TABLE SCAN |t5 |5 |46 | |4 | NESTED-LOOP OUTER JOIN| |8 |188 | |5 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -72322,9 +72308,9 @@ Query Plan ============================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------- -|0 |INSERT | |8 |291 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |234 | -|2 | HASH RIGHT OUTER JOIN | |8 |234 | +|0 |INSERT | |8 |292 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |235 | +|2 | HASH RIGHT OUTER JOIN | |8 |235 | |3 | TABLE SCAN |t5 |5 |46 | |4 | NESTED-LOOP OUTER JOIN| |8 |188 | |5 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -72371,7 +72357,7 @@ Query Plan ==================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------- -|0 |UPDATE | |8 |359 | +|0 |UPDATE | |8 |360 | |1 | SUBPLAN FILTER | |8 |275 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |230 | @@ -72674,7 +72660,7 @@ Query Plan ========================================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------------------- -|0 |HASH RIGHT OUTER JOIN | |8 |229 | +|0 |HASH RIGHT OUTER JOIN | |8 |230 | |1 | TABLE SCAN |t5 |5 |46 | |2 | NESTED-LOOP OUTER JOIN CARTESIAN| |8 |183 | |3 | TABLE SCAN |t4 |8 |46 | @@ -72795,8 +72781,8 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------------------- |0 |INSERT | |8 |287 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |229 | -|2 | HASH RIGHT OUTER JOIN | |8 |229 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |230 | +|2 | HASH RIGHT OUTER JOIN | |8 |230 | |3 | TABLE SCAN |t5 |5 |46 | |4 | NESTED-LOOP OUTER JOIN CARTESIAN| |8 |183 | |5 | TABLE SCAN |t4 |8 |46 | @@ -73280,7 +73266,7 @@ Query Plan ====================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ -|0 |INSERT | |5 |223 | +|0 |INSERT | |5 |224 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|5 |185 | |2 | SUBPLAN FILTER | |5 |185 | |3 | HASH OUTER JOIN| |5 |140 | @@ -73322,7 +73308,7 @@ Query Plan ======================================================= |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------- -|0 |INSERT | |5 |223 | +|0 |INSERT | |5 |224 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|5 |185 | |2 | SUBPLAN FILTER | |5 |185 | |3 | HASH OUTER JOIN | |5 |140 | @@ -73364,13 +73350,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------- |0 |UPDATE | |8 |314 | -|1 | SUBPLAN FILTER | |8 |229 | +|1 | SUBPLAN FILTER | |8 |230 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |184 | |4 | SUBPLAN FILTER | |1 |184 | |5 | HASH OUTER JOIN| |1 |139 | |6 | TABLE SCAN |t5 |5 |46 | -|7 | HASH JOIN | |2 |92 | +|7 | HASH JOIN | |2 |93 | |8 | TABLE SCAN |t1 |8 |46 | |9 | TABLE SCAN |t2 |2 |46 | |10| TABLE SCAN |t3 |1 |46 | @@ -73431,13 +73417,13 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| --------------------------------------------- |0 |UPDATE | |8 |314 | -|1 | SUBPLAN FILTER | |8 |229 | +|1 | SUBPLAN FILTER | |8 |230 | |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |184 | |4 | SUBPLAN FILTER | |1 |184 | |5 | HASH OUTER JOIN | |1 |139 | |6 | TABLE SCAN |t5 |5 |46 | -|7 | HASH OUTER JOIN| |2 |92 | +|7 | HASH OUTER JOIN| |2 |93 | |8 | TABLE SCAN |t1 |8 |46 | |9 | TABLE SCAN |t2 |2 |46 | |10| TABLE SCAN |t3 |1 |46 | @@ -73503,7 +73489,7 @@ Query Plan |4 | SUBPLAN FILTER | |1 |184 | |5 | HASH OUTER JOIN| |1 |139 | |6 | TABLE SCAN |t5 |5 |46 | -|7 | HASH JOIN | |2 |92 | +|7 | HASH JOIN | |2 |93 | |8 | TABLE SCAN |t1 |8 |46 | |9 | TABLE SCAN |t2 |2 |46 | |10| TABLE SCAN |t3 |1 |46 | @@ -73569,7 +73555,7 @@ Query Plan |4 | SUBPLAN FILTER | |1 |184 | |5 | HASH OUTER JOIN | |1 |139 | |6 | TABLE SCAN |t5 |5 |46 | -|7 | HASH OUTER JOIN| |2 |92 | +|7 | HASH OUTER JOIN| |2 |93 | |8 | TABLE SCAN |t1 |8 |46 | |9 | TABLE SCAN |t2 |2 |46 | |10| TABLE SCAN |t3 |1 |46 | @@ -73719,7 +73705,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |8 |242 | +|0 |INSERT | |8 |243 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |185 | |2 | SUBPLAN FILTER | |8 |185 | |3 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -73761,7 +73747,7 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------ -|0 |INSERT | |8 |242 | +|0 |INSERT | |8 |243 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|8 |185 | |2 | SUBPLAN FILTER | |8 |185 | |3 | HASH RIGHT OUTER JOIN| |8 |140 | @@ -73936,7 +73922,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |DELETE | |1 |241 | -|1 | SUBPLAN FILTER | |1 |229 | +|1 | SUBPLAN FILTER | |1 |230 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | SUBPLAN FILTER | |1 |184 | @@ -74002,7 +73988,7 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| -------------------------------------------------- |0 |DELETE | |1 |241 | -|1 | SUBPLAN FILTER | |1 |229 | +|1 | SUBPLAN FILTER | |1 |230 | |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |184 | |4 | SUBPLAN FILTER | |1 |184 | @@ -74069,8 +74055,8 @@ Query Plan ----------------------------------------------- |0 |HASH OUTER JOIN | |5 |186 | |1 | HASH RIGHT SEMI JOIN| |5 |139 | -|2 | SUBPLAN SCAN |VIEW1|5 |92 | -|3 | HASH JOIN | |5 |92 | +|2 | SUBPLAN SCAN |VIEW1|5 |93 | +|3 | HASH JOIN | |5 |93 | |4 | TABLE SCAN |t5 |5 |46 | |5 | TABLE SCAN |t3 |8 |46 | |6 | TABLE SCAN |t1 |8 |46 | @@ -74112,8 +74098,8 @@ Query Plan ----------------------------------------------- |0 |HASH OUTER JOIN | |5 |186 | |1 | HASH RIGHT SEMI JOIN| |5 |139 | -|2 | SUBPLAN SCAN |VIEW1|5 |92 | -|3 | HASH JOIN | |5 |92 | +|2 | SUBPLAN SCAN |VIEW1|5 |93 | +|3 | HASH JOIN | |5 |93 | |4 | TABLE SCAN |t5 |5 |46 | |5 | TABLE SCAN |t3 |8 |46 | |6 | TABLE SCAN |t1 |8 |46 | @@ -74157,8 +74143,8 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|5 |186 | |2 | HASH OUTER JOIN | |5 |186 | |3 | HASH RIGHT SEMI JOIN| |5 |139 | -|4 | SUBPLAN SCAN |VIEW1 |5 |92 | -|5 | HASH JOIN | |5 |92 | +|4 | SUBPLAN SCAN |VIEW1 |5 |93 | +|5 | HASH JOIN | |5 |93 | |6 | TABLE SCAN |t5 |5 |46 | |7 | TABLE SCAN |t3 |8 |46 | |8 | TABLE SCAN |t1 |8 |46 | @@ -74201,8 +74187,8 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|5 |186 | |2 | HASH OUTER JOIN | |5 |186 | |3 | HASH RIGHT SEMI JOIN| |5 |139 | -|4 | SUBPLAN SCAN |VIEW1 |5 |92 | -|5 | HASH JOIN | |5 |92 | +|4 | SUBPLAN SCAN |VIEW1 |5 |93 | +|5 | HASH JOIN | |5 |93 | |6 | TABLE SCAN |t5 |5 |46 | |7 | TABLE SCAN |t3 |8 |46 | |8 | TABLE SCAN |t1 |8 |46 | @@ -74249,8 +74235,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT SEMI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |2 |46 | @@ -74323,8 +74309,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT SEMI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |2 |46 | @@ -74397,8 +74383,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT SEMI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |2 |46 | @@ -74470,8 +74456,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT SEMI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |2 |46 | @@ -74820,7 +74806,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |8 |46 | @@ -74970,7 +74956,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |183 | |4 | SUBPLAN FILTER | |1 |183 | -|5 | HASH OUTER JOIN| |2 |92 | +|5 | HASH OUTER JOIN| |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | TABLE SCAN |t3 |8 |46 | @@ -75027,8 +75013,8 @@ Query Plan ----------------------------------------------- |0 |HASH OUTER JOIN | |3 |186 | |1 | HASH RIGHT ANTI JOIN| |3 |139 | -|2 | SUBPLAN SCAN |VIEW1|5 |92 | -|3 | HASH JOIN | |5 |92 | +|2 | SUBPLAN SCAN |VIEW1|5 |93 | +|3 | HASH JOIN | |5 |93 | |4 | TABLE SCAN |t5 |5 |46 | |5 | TABLE SCAN |t3 |8 |46 | |6 | TABLE SCAN |t1 |8 |46 | @@ -75116,8 +75102,8 @@ Query Plan |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|3 |186 | |2 | HASH OUTER JOIN | |3 |186 | |3 | HASH RIGHT ANTI JOIN| |3 |139 | -|4 | SUBPLAN SCAN |VIEW1 |5 |92 | -|5 | HASH JOIN | |5 |92 | +|4 | SUBPLAN SCAN |VIEW1 |5 |93 | +|5 | HASH JOIN | |5 |93 | |6 | TABLE SCAN |t5 |5 |46 | |7 | TABLE SCAN |t3 |8 |46 | |8 | TABLE SCAN |t1 |8 |46 | @@ -75207,8 +75193,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT ANTI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |3 |46 | @@ -75278,7 +75264,7 @@ Query Plan |2 | TABLE SCAN |t1 |8 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -75349,8 +75335,8 @@ Query Plan |5 | SUBPLAN SCAN |VIEW2|1 |139 | |6 | LIMIT | |1 |139 | |7 | HASH RIGHT ANTI JOIN| |1 |139 | -|8 | SUBPLAN SCAN |VIEW1|5 |92 | -|9 | HASH JOIN | |5 |92 | +|8 | SUBPLAN SCAN |VIEW1|5 |93 | +|9 | HASH JOIN | |5 |93 | |10| TABLE SCAN |t5 |5 |46 | |11| TABLE SCAN |t3 |8 |46 | |12| TABLE SCAN |t1 |3 |46 | @@ -75419,7 +75405,7 @@ Query Plan |2 | TABLE SCAN |t1 |1 |46 | |3 | LIMIT | |1 |274 | |4 | SUBPLAN FILTER | |1 |274 | -|5 | HASH OUTER JOIN | |2 |92 | +|5 | HASH OUTER JOIN | |2 |93 | |6 | TABLE SCAN |t1 |8 |46 | |7 | TABLE SCAN |t2 |3 |46 | |8 | NESTED-LOOP JOIN CARTESIAN| |1 |91 | @@ -76214,9 +76200,9 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |MERGE OUTER JOIN| |6 |92 | +|0 |MERGE OUTER JOIN| |6 |93 | |1 | TABLE SCAN |b |6 |46 | -|2 | SORT | |6 |46 | +|2 | SORT | |6 |47 | |3 | TABLE SCAN |a |6 |46 | ========================================= @@ -77117,11 +77103,11 @@ Query Plan ========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |PX COORDINATOR | |1 |64 | -|1 | EXCHANGE OUT DISTR |:EX10001|1 |63 | -|2 | NESTED-LOOP JOIN | |1 |62 | -|3 | EXCHANGE IN DISTR | |2 |47 | -|4 | EXCHANGE OUT DISTR (PKEY)|:EX10000|2 |47 | +|0 |PX COORDINATOR | |1 |68 | +|1 | EXCHANGE OUT DISTR |:EX10001|1 |67 | +|2 | NESTED-LOOP JOIN | |1 |64 | +|3 | EXCHANGE IN DISTR | |2 |50 | +|4 | EXCHANGE OUT DISTR (PKEY)|:EX10000|2 |48 | |5 | TABLE SCAN |a |2 |46 | |6 | PX PARTITION ITERATOR | |1 |32 | |7 | TABLE GET |b |1 |32 | @@ -77153,11 +77139,11 @@ Query Plan ========================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------------- -|0 |PX COORDINATOR | |2 |65 | -|1 | EXCHANGE OUT DISTR |:EX10001|2 |64 | -|2 | NESTED-LOOP OUTER JOIN | |2 |62 | -|3 | EXCHANGE IN DISTR | |2 |47 | -|4 | EXCHANGE OUT DISTR (PKEY)|:EX10000|2 |47 | +|0 |PX COORDINATOR | |2 |72 | +|1 | EXCHANGE OUT DISTR |:EX10001|2 |69 | +|2 | NESTED-LOOP OUTER JOIN | |2 |64 | +|3 | EXCHANGE IN DISTR | |2 |50 | +|4 | EXCHANGE OUT DISTR (PKEY)|:EX10000|2 |48 | |5 | TABLE SCAN |a |2 |46 | |6 | PX PARTITION ITERATOR | |1 |32 | |7 | TABLE GET |b |1 |32 | @@ -77189,13 +77175,13 @@ Query Plan =================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------- -|0 |INSERT | |1 |77 | -|1 | PX COORDINATOR | |1 |64 | -|2 | EXCHANGE OUT DISTR |:EX10001 |1 |63 | -|3 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |62 | -|4 | NESTED-LOOP JOIN | |1 |62 | -|5 | EXCHANGE IN DISTR | |2 |47 | -|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000 |2 |47 | +|0 |INSERT | |1 |81 | +|1 | PX COORDINATOR | |1 |68 | +|2 | EXCHANGE OUT DISTR |:EX10001 |1 |67 | +|3 | SUBPLAN SCAN |ANONYMOUS_VIEW1|1 |64 | +|4 | NESTED-LOOP JOIN | |1 |64 | +|5 | EXCHANGE IN DISTR | |2 |50 | +|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000 |2 |48 | |7 | TABLE SCAN |a |2 |46 | |8 | PX PARTITION ITERATOR | |1 |32 | |9 | TABLE GET |b |1 |32 | @@ -77227,13 +77213,13 @@ Query Plan =================================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------------------- -|0 |INSERT | |2 |84 | -|1 | PX COORDINATOR | |2 |65 | -|2 | EXCHANGE OUT DISTR |:EX10001 |2 |64 | -|3 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |62 | -|4 | NESTED-LOOP OUTER JOIN | |2 |62 | -|5 | EXCHANGE IN DISTR | |2 |47 | -|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000 |2 |47 | +|0 |INSERT | |2 |91 | +|1 | PX COORDINATOR | |2 |72 | +|2 | EXCHANGE OUT DISTR |:EX10001 |2 |69 | +|3 | SUBPLAN SCAN |ANONYMOUS_VIEW1|2 |64 | +|4 | NESTED-LOOP OUTER JOIN | |2 |64 | +|5 | EXCHANGE IN DISTR | |2 |50 | +|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000 |2 |48 | |7 | TABLE SCAN |a |2 |46 | |8 | PX PARTITION ITERATOR | |1 |32 | |9 | TABLE GET |b |1 |32 | @@ -77312,14 +77298,14 @@ Query Plan ============================================================== |ID|OPERATOR |NAME |EST. ROWS|COST| -------------------------------------------------------------- -|0 |DISTRIBUTED UPDATE | |6 |200 | +|0 |DISTRIBUTED UPDATE | |6 |201 | |1 | SUBPLAN FILTER | |6 |131 | |2 | TABLE SCAN |t5 |6 |46 | -|3 | LIMIT | |1 |85 | -|4 | PX COORDINATOR | |1 |85 | -|5 | EXCHANGE OUT DISTR |:EX10001|1 |85 | -|6 | LIMIT | |1 |85 | -|7 | NESTED-LOOP OUTER JOIN | |1 |85 | +|3 | LIMIT | |1 |86 | +|4 | PX COORDINATOR | |1 |86 | +|5 | EXCHANGE OUT DISTR |:EX10001|1 |86 | +|6 | LIMIT | |1 |86 | +|7 | NESTED-LOOP OUTER JOIN | |1 |86 | |8 | EXCHANGE IN DISTR | |1 |46 | |9 | EXCHANGE OUT DISTR (PKEY)|:EX10000|1 |46 | |10| TABLE SCAN |a |1 |46 | @@ -77379,9 +77365,9 @@ Query Plan ========================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ----------------------------------------- -|0 |MERGE OUTER JOIN| |6 |92 | +|0 |MERGE OUTER JOIN| |6 |93 | |1 | TABLE SCAN |b |6 |46 | -|2 | SORT | |6 |46 | +|2 | SORT | |6 |47 | |3 | TABLE SCAN |a |6 |46 | ========================================= @@ -77413,21 +77399,21 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |MERGE FULL OUTER JOIN| |6 |92 | -|1 | SORT | |6 |46 | -|2 | TABLE SCAN |a |6 |46 | -|3 | TABLE SCAN |b |6 |46 | +|0 |MERGE FULL OUTER JOIN| |6 |93 | +|1 | TABLE SCAN |b |6 |46 | +|2 | SORT | |6 |47 | +|3 | TABLE SCAN |a |6 |46 | ============================================== Outputs & filters: ------------------------------------- 0 - output([a.c1], [a.c2], [a.c3], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, equal_conds([a.c2 = b.c1]), other_conds(nil) - 1 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) - 2 - output([a.c2], [a.c1], [a.c3]), filter(nil), rowset=256, - access([a.c2], [a.c1], [a.c3]), partitions(p0) - 3 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, + 1 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, access([b.c1], [b.c2], [b.c3]), partitions(p0) + 2 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) + 3 - output([a.c2], [a.c1], [a.c3]), filter(nil), rowset=256, + access([a.c2], [a.c1], [a.c3]), partitions(p0) select /*+NO_REWRITE*/* from t8 a full join t5 b on a.c2=b.c1; +------+----+------+----+------+------+ @@ -77448,10 +77434,10 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ------------------------------------------------------ |0 |INSERT | |6 |137 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |92 | -|2 | MERGE OUTER JOIN| |6 |92 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |93 | +|2 | MERGE OUTER JOIN| |6 |93 | |3 | TABLE SCAN |b |6 |46 | -|4 | SORT | |6 |46 | +|4 | SORT | |6 |47 | |5 | TABLE SCAN |a |6 |46 | ====================================================== @@ -77478,9 +77464,9 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- |0 |INSERT | |6 |137 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |92 | -|2 | MERGE FULL OUTER JOIN| |6 |92 | -|3 | SORT | |6 |46 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |93 | +|2 | MERGE FULL OUTER JOIN| |6 |93 | +|3 | SORT | |6 |47 | |4 | TABLE SCAN |a |6 |46 | |5 | TABLE SCAN |b |6 |46 | =========================================================== @@ -77504,19 +77490,18 @@ insert into t16_temp (select /*+NO_REWRITE*/ * from t8 a full join t5 b on a.c2= rollback; EXPLAIN update t5 set c2 = (select a.c1 from t8 a full join t5 b on a.c2=b.c1 limit 1); Query Plan -=================================================== -|ID|OPERATOR |NAME |EST. ROWS|COST| ---------------------------------------------------- -|0 |DISTRIBUTED UPDATE | |6 |206 | -|1 | SUBPLAN FILTER | |6 |137 | -|2 | TABLE SCAN |t5 |6 |46 | -|3 | LIMIT | |1 |92 | -|4 | MERGE RIGHT OUTER JOIN| |1 |92 | -|5 | SORT | |6 |46 | -|6 | TABLE SCAN |a |6 |46 | -|7 | SUBPLAN SCAN |VIEW1|1 |46 | -|8 | TABLE SCAN |b |1 |46 | -=================================================== +============================================ +|ID|OPERATOR |NAME |EST. ROWS|COST| +-------------------------------------------- +|0 |DISTRIBUTED UPDATE| |6 |207 | +|1 | SUBPLAN FILTER | |6 |137 | +|2 | TABLE SCAN |t5 |6 |46 | +|3 | LIMIT | |1 |92 | +|4 | HASH OUTER JOIN| |1 |92 | +|5 | SUBPLAN SCAN |VIEW1|1 |46 | +|6 | TABLE SCAN |b |1 |46 | +|7 | TABLE SCAN |a |6 |46 | +============================================ Outputs & filters: ------------------------------------- @@ -77529,14 +77514,13 @@ Outputs & filters: 3 - output([a.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([a.c1]), filter(nil), rowset=256, equal_conds([a.c2 = VIEW1.b.c1]), other_conds(nil) - 5 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) - 6 - output([a.c2], [a.c1]), filter(nil), rowset=256, - access([a.c2], [a.c1]), partitions(p0) - 7 - output([VIEW1.b.c1]), filter(nil), rowset=256, + 5 - output([VIEW1.b.c1]), filter(nil), rowset=256, access([VIEW1.b.c1]) - 8 - output([b.c1]), filter(nil), rowset=256, + 6 - output([b.c1]), filter(nil), rowset=256, access([b.c1]), partitions(p0), limit(1), offset(nil) + 7 - output([a.c2], [a.c1]), filter(nil), rowset=256, + access([a.c2], [a.c1]), partitions(p0) update t5 set c2 = (select a.c1 from t8 a full join t5 b on a.c2=b.c1 limit 1); EXPLAIN select stddev(c2) from t5; @@ -77567,14 +77551,14 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |DISTRIBUTED UPDATE | |6 |206 | +|0 |DISTRIBUTED UPDATE | |6 |207 | |1 | SUBPLAN FILTER | |6 |137 | |2 | TABLE SCAN |t5 |6 |46 | |3 | LIMIT | |1 |92 | |4 | MERGE FULL OUTER JOIN| |1 |92 | -|5 | SORT | |3 |46 | -|6 | TABLE SCAN |a |6 |46 | -|7 | TABLE SCAN |b |3 |46 | +|5 | TABLE SCAN |b |3 |46 | +|6 | SORT | |3 |46 | +|7 | TABLE SCAN |a |6 |46 | ================================================= Outputs & filters: @@ -77588,11 +77572,11 @@ Outputs & filters: 3 - output([a.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([a.c1]), filter(nil), rowset=256, equal_conds([a.c2 = b.c1]), other_conds(nil) - 5 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) - 6 - output([a.c2], [a.c1]), filter(nil), rowset=256, - access([a.c2], [a.c1]), partitions(p0) - 7 - output([b.c1]), filter(nil), rowset=256, + 5 - output([b.c1]), filter(nil), rowset=256, access([b.c1]), partitions(p0) + 6 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) + 7 - output([a.c2], [a.c1]), filter(nil), rowset=256, + access([a.c2], [a.c1]), partitions(p0) update t5 set c2 = (select /*+NO_REWRITE*/ a.c1 from t8 a full join t5 b on a.c2=b.c1 limit 1); EXPLAIN select stddev(c2) from t5; @@ -77871,21 +77855,21 @@ Query Plan ============================================== |ID|OPERATOR |NAME|EST. ROWS|COST| ---------------------------------------------- -|0 |MERGE FULL OUTER JOIN| |6 |92 | -|1 | SORT | |6 |46 | -|2 | TABLE SCAN |a |6 |46 | -|3 | TABLE SCAN |b |6 |46 | +|0 |MERGE FULL OUTER JOIN| |6 |93 | +|1 | TABLE SCAN |b |6 |46 | +|2 | SORT | |6 |47 | +|3 | TABLE SCAN |a |6 |46 | ============================================== Outputs & filters: ------------------------------------- 0 - output([a.c1], [a.c2], [a.c3], [b.c1], [b.c2], [b.c3]), filter([(T_OP_IS_NOT, a.c1, NULL, 0)]), rowset=256, equal_conds([a.c2 = b.c1]), other_conds(nil) - 1 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) - 2 - output([a.c2], [a.c1], [a.c3]), filter(nil), rowset=256, - access([a.c2], [a.c1], [a.c3]), partitions(p0) - 3 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, + 1 - output([b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, access([b.c1], [b.c2], [b.c3]), partitions(p0) + 2 - output([a.c1], [a.c2], [a.c3]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) + 3 - output([a.c2], [a.c1], [a.c3]), filter(nil), rowset=256, + access([a.c2], [a.c1], [a.c3]), partitions(p0) select /*+NO_REWRITE*/* from t8 a full join t5 b on a.c2=b.c1 where a.c1 is not null; +------+----+------+----+------+------+ @@ -77931,9 +77915,9 @@ Query Plan |ID|OPERATOR |NAME |EST. ROWS|COST| ----------------------------------------------------------- |0 |INSERT | |6 |137 | -|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |92 | -|2 | MERGE FULL OUTER JOIN| |6 |92 | -|3 | SORT | |6 |46 | +|1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |93 | +|2 | MERGE FULL OUTER JOIN| |6 |93 | +|3 | SORT | |6 |47 | |4 | TABLE SCAN |a |6 |46 | |5 | TABLE SCAN |b |6 |46 | =========================================================== @@ -78007,14 +77991,14 @@ Query Plan ================================================= |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- -|0 |DISTRIBUTED UPDATE | |6 |206 | +|0 |DISTRIBUTED UPDATE | |6 |207 | |1 | SUBPLAN FILTER | |6 |137 | |2 | TABLE SCAN |t5 |6 |46 | |3 | LIMIT | |1 |92 | |4 | MERGE FULL OUTER JOIN| |1 |92 | -|5 | SORT | |3 |46 | -|6 | TABLE SCAN |a |6 |46 | -|7 | TABLE SCAN |b |3 |46 | +|5 | TABLE SCAN |b |3 |46 | +|6 | SORT | |3 |46 | +|7 | TABLE SCAN |a |6 |46 | ================================================= Outputs & filters: @@ -78028,11 +78012,11 @@ Outputs & filters: 3 - output([a.c1]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([a.c1]), filter([(T_OP_IS_NOT, a.c1, NULL, 0)]), rowset=256, equal_conds([a.c2 = b.c1]), other_conds(nil) - 5 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) - 6 - output([a.c2], [a.c1]), filter(nil), rowset=256, - access([a.c2], [a.c1]), partitions(p0) - 7 - output([b.c1]), filter(nil), rowset=256, + 5 - output([b.c1]), filter(nil), rowset=256, access([b.c1]), partitions(p0) + 6 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2, ASC]) + 7 - output([a.c2], [a.c1]), filter(nil), rowset=256, + access([a.c2], [a.c1]), partitions(p0) update t5 set c2 = (select /*+NO_REWRITE*/ a.c1 from t8 a full join t5 b on a.c2=b.c1 where a.c1 is not null limit 1); EXPLAIN select stddev(c2) from t5; @@ -78065,32 +78049,32 @@ Query Plan |ID|OPERATOR |NAME|EST. ROWS|COST| ------------------------------------------------- |0 |HASH FULL OUTER JOIN | |6 |180 | -|1 | SUBPLAN SCAN |b |6 |89 | -|2 | NESTED-LOOP JOIN | |6 |89 | -|3 | TABLE SCAN |t8 |6 |46 | -|4 | DISTRIBUTED TABLE GET|t5 |1 |7 | -|5 | NESTED-LOOP JOIN | |6 |89 | -|6 | TABLE SCAN |t8 |6 |46 | -|7 | DISTRIBUTED TABLE GET |t5 |1 |7 | +|1 | NESTED-LOOP JOIN | |6 |89 | +|2 | TABLE SCAN |t8 |6 |46 | +|3 | DISTRIBUTED TABLE GET |t5 |1 |7 | +|4 | SUBPLAN SCAN |b |6 |89 | +|5 | NESTED-LOOP JOIN | |6 |89 | +|6 | TABLE SCAN |t8 |6 |46 | +|7 | DISTRIBUTED TABLE GET|t5 |1 |7 | ================================================= Outputs & filters: ------------------------------------- 0 - output([t5.c2], [b.c2]), filter(nil), rowset=256, equal_conds([t5.c2 = b.c2]), other_conds(nil) - 1 - output([b.c2]), filter(nil), rowset=256, - access([b.c2]) - 2 - output([t8.c2]), filter(nil), rowset=256, - conds(nil), nl_params_([t8.c1]) - 3 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, - access([t8.c1], [t8.c2]), partitions(p0) - 4 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, - access([GROUP_ID], [t5.c2]), partitions(p0) - 5 - output([t5.c2]), filter(nil), rowset=256, + 1 - output([t5.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t8.c2]) - 6 - output([t8.c2]), filter(nil), rowset=256, + 2 - output([t8.c2]), filter(nil), rowset=256, access([t8.c2]), partitions(p0) - 7 - output([t5.c2]), filter(nil), rowset=256, + 3 - output([t5.c2]), filter(nil), rowset=256, + access([GROUP_ID], [t5.c2]), partitions(p0) + 4 - output([b.c2]), filter(nil), rowset=256, + access([b.c2]) + 5 - output([t8.c2]), filter(nil), rowset=256, + conds(nil), nl_params_([t8.c1]) + 6 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, + access([t8.c1], [t8.c2]), partitions(p0) + 7 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, access([GROUP_ID], [t5.c2]), partitions(p0) select * from (select t5.c2 from t8 left join t5 on t5.c1=t8.c2) a full join (select t8.c2 from t8 left join t5 on t8.c1=t5.c1 where t5.c2 is not null) b on a.c2 = b.c2; @@ -78166,13 +78150,13 @@ Query Plan |0 |INSERT | |6 |224 | |1 | SUBPLAN SCAN |ANONYMOUS_VIEW1|6 |180 | |2 | HASH FULL OUTER JOIN | |6 |180 | -|3 | SUBPLAN SCAN |b |6 |89 | -|4 | NESTED-LOOP JOIN | |6 |89 | -|5 | TABLE SCAN |t8 |6 |46 | -|6 | DISTRIBUTED TABLE GET|t5 |1 |7 | -|7 | NESTED-LOOP JOIN | |6 |89 | -|8 | TABLE SCAN |t8 |6 |46 | -|9 | DISTRIBUTED TABLE GET |t5 |1 |7 | +|3 | NESTED-LOOP JOIN | |6 |89 | +|4 | TABLE SCAN |t8 |6 |46 | +|5 | DISTRIBUTED TABLE GET |t5 |1 |7 | +|6 | SUBPLAN SCAN |b |6 |89 | +|7 | NESTED-LOOP JOIN | |6 |89 | +|8 | TABLE SCAN |t8 |6 |46 | +|9 | DISTRIBUTED TABLE GET|t5 |1 |7 | ============================================================== Outputs & filters: @@ -78184,19 +78168,19 @@ Outputs & filters: access([ANONYMOUS_VIEW1.c2], [ANONYMOUS_VIEW1.c2]) 2 - output([t5.c2], [b.c2]), filter(nil), rowset=256, equal_conds([t5.c2 = b.c2]), other_conds(nil) - 3 - output([b.c2]), filter(nil), rowset=256, - access([b.c2]) - 4 - output([t8.c2]), filter(nil), rowset=256, - conds(nil), nl_params_([t8.c1]) - 5 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, - access([t8.c1], [t8.c2]), partitions(p0) - 6 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, - access([GROUP_ID], [t5.c2]), partitions(p0) - 7 - output([t5.c2]), filter(nil), rowset=256, + 3 - output([t5.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t8.c2]) - 8 - output([t8.c2]), filter(nil), rowset=256, + 4 - output([t8.c2]), filter(nil), rowset=256, access([t8.c2]), partitions(p0) - 9 - output([t5.c2]), filter(nil), rowset=256, + 5 - output([t5.c2]), filter(nil), rowset=256, + access([GROUP_ID], [t5.c2]), partitions(p0) + 6 - output([b.c2]), filter(nil), rowset=256, + access([b.c2]) + 7 - output([t8.c2]), filter(nil), rowset=256, + conds(nil), nl_params_([t8.c1]) + 8 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, + access([t8.c1], [t8.c2]), partitions(p0) + 9 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, access([GROUP_ID], [t5.c2]), partitions(p0) insert into t11_temp (select * from (select t5.c2 from t8 left join t5 on t5.c1=t8.c2) a full join (select t8.c2 from t8 left join t5 on t8.c1=t5.c1 where t5.c2 is not null) b on a.c2 = b.c2); @@ -78257,13 +78241,13 @@ Query Plan |2 | TABLE SCAN |t5 |6 |46 | |3 | LIMIT | |1 |155 | |4 | HASH FULL OUTER JOIN | |1 |155 | -|5 | SUBPLAN SCAN |b |6 |96 | -|6 | NESTED-LOOP JOIN | |6 |96 | -|7 | TABLE SCAN |t8 |6 |46 | -|8 | DISTRIBUTED TABLE GET|t5 |1 |7 | -|9 | NESTED-LOOP JOIN | |1 |59 | -|10| TABLE SCAN |t8 |1 |46 | -|11| DISTRIBUTED TABLE GET |t5 |1 |7 | +|5 | NESTED-LOOP JOIN | |6 |96 | +|6 | TABLE SCAN |t8 |6 |46 | +|7 | DISTRIBUTED TABLE GET |t5 |1 |7 | +|8 | SUBPLAN SCAN |b |1 |59 | +|9 | NESTED-LOOP JOIN | |1 |59 | +|10| TABLE SCAN |t8 |1 |46 | +|11| DISTRIBUTED TABLE GET|t5 |1 |7 | ==================================================== Outputs & filters: @@ -78277,19 +78261,19 @@ Outputs & filters: 3 - output([t5.c2]), filter(nil), rowset=256, limit(1), offset(nil) 4 - output([t5.c2]), filter(nil), rowset=256, equal_conds([t5.c2 = b.c2]), other_conds(nil) - 5 - output([b.c2]), filter(nil), rowset=256, - access([b.c2]) - 6 - output([t8.c2]), filter(nil), rowset=256, - conds(nil), nl_params_([t8.c1]) - 7 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, - access([t8.c1], [t8.c2]), partitions(p0) - 8 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, - access([GROUP_ID], [t5.c2]), partitions(p0) - 9 - output([t5.c2]), filter(nil), rowset=256, + 5 - output([t5.c2]), filter(nil), rowset=256, conds(nil), nl_params_([t8.c2]) - 10 - output([t8.c2]), filter(nil), rowset=256, + 6 - output([t8.c2]), filter(nil), rowset=256, access([t8.c2]), partitions(p0) - 11 - output([t5.c2]), filter(nil), rowset=256, + 7 - output([t5.c2]), filter(nil), rowset=256, + access([GROUP_ID], [t5.c2]), partitions(p0) + 8 - output([b.c2]), filter(nil), rowset=256, + access([b.c2]) + 9 - output([t8.c2]), filter(nil), rowset=256, + conds(nil), nl_params_([t8.c1]) + 10 - output([t8.c1], [t8.c2]), filter(nil), rowset=256, + access([t8.c1], [t8.c2]), partitions(p0) + 11 - output(nil), filter([(T_OP_IS_NOT, t5.c2, NULL, 0)]), rowset=256, access([GROUP_ID], [t5.c2]), partitions(p0) update t5 set c2 = (select a.c2 from (select t5.c2 from t8 left join t5 on t5.c1=t8.c2) a full join (select t8.c2 from t8 left join t5 on t8.c1=t5.c1 where t5.c2 is not null) b on a.c2 = b.c2 limit 1); diff --git a/tools/deploy/obd.sh b/tools/deploy/obd.sh index 0842b7d91..777080d6d 100755 --- a/tools/deploy/obd.sh +++ b/tools/deploy/obd.sh @@ -96,8 +96,6 @@ function mirror_create { ## generate config function generate_config { app_name=$task.$USER.$HOST - ocp_config_server='http://ocp-cfg.alibaba.net:8080/services?User_ID=alibaba&UID=test' - proxy_cfg_url=${ocp_config_server}\&Action=GetObProxyConfig\&ObRegionGroup=$app_name port_num=$port_gen mysql_port=$port_num && port_num=$((port_num+1)) @@ -118,7 +116,6 @@ function generate_config { proxy_conf=${proxy_conf//'{{%% LISTEN_PORT %%}}'/$listen_port} proxy_conf=${proxy_conf//'{{%% PROMETHEUS_LISTEN_PORT %%}}'/$prometheus_listen_port} proxy_conf=${proxy_conf//'{{%% OBPORXY_HOME_PATH %%}}'/"$DATA_PATH"/obproxy} - proxy_conf=${proxy_conf//'{{%% OBPROXY_CONFIG_SERVER_URL %%}}'/$proxy_cfg_url} base_template=${base_template//"{{%% COMPONENT %%}}"/$COMPONENT} @@ -126,7 +123,6 @@ function generate_config { base_template=${base_template//"{{%% DEPLOY_PATH %%}}"/$DEPLOY_PATH} base_template=${base_template//"{{%% TOOLS_PATH %%}}"/$BASE_DIR/tools} base_template=${base_template//"{{%% MINI_SIZE %%}}"/$mem} - base_template=${base_template//"{{%% OBCONFIG_URL %%}}"/$ocp_config_server} base_template=${base_template//"{{%% APPNAME %%}}"/$app_name} base_template=${base_template//"{{%% EXTRA_PARAM %%}}"/} diff --git a/tools/deploy/obd/obdtest.config.yaml.template b/tools/deploy/obd/obdtest.config.yaml.template index 0eabb2618..9184aa1b6 100644 --- a/tools/deploy/obd/obdtest.config.yaml.template +++ b/tools/deploy/obd/obdtest.config.yaml.template @@ -29,7 +29,6 @@ workers_per_cpu_quota: '10' schema_history_expire_time: '1d' net_thread_count: '4' - _enable_static_typing_engine: True enable_async_syslog: False {{%% EXTRA_PARAM %%}} diff --git a/tools/deploy/obd/observer.include.yaml b/tools/deploy/obd/observer.include.yaml index 63ac47d98..c86d3e4d8 100644 --- a/tools/deploy/obd/observer.include.yaml +++ b/tools/deploy/obd/observer.include.yaml @@ -29,6 +29,5 @@ config: workers_per_cpu_quota: '10' schema_history_expire_time: '1d' net_thread_count: '4' - enable_merge_by_turn: 'FALSE' syslog_io_bandwidth_limit: '10G' enable_async_syslog: 'FALSE' diff --git a/tools/docker/standalone/boot/boot-mini-tmp.yaml b/tools/docker/standalone/boot/boot-mini-tmp.yaml index b462fa0fd..09b85a3e8 100644 --- a/tools/docker/standalone/boot/boot-mini-tmp.yaml +++ b/tools/docker/standalone/boot/boot-mini-tmp.yaml @@ -20,7 +20,6 @@ oceanbase-ce: sys_bkgd_migration_retry_num: 3 minor_freeze_times: 100 enable_separate_sys_clog: 0 - enable_merge_by_turn: FALSE enable_auto_leader_switch: FALSE enable_one_phase_commit: FALSE weak_read_version_refresh_interval: 5s diff --git a/tools/ob_admin/README.md b/tools/ob_admin/README.md index 555d51d55..6c9f998c0 100644 --- a/tools/ob_admin/README.md +++ b/tools/ob_admin/README.md @@ -16,24 +16,6 @@ "kms_host":"http://bkmi.stable.alipay.net/bkmi/api", "root_cert": "-----BEGIN CERTIFICATE----- -MIIDLjCCAhYCBwV0G8gh75EwDQYJKoZIhvcNAQELBQAwWjEsMCoGA1UEAwwjQW50 -IEZpbmFuYWNpYWwgSW50cmFuZXQgQ0EgUm9vdCBSU0ExFzAVBgNVBAoMDkFudCBG -aW5hbmFjaWFsMREwDwYDVQQLDAhJbnRyYW5ldDAeFw0xODA4MjMxNTE5MTRaFw00 -ODA4MjMxNTE5MTRaMFoxLDAqBgNVBAMMI0FudCBGaW5hbmFjaWFsIEludHJhbmV0 -IENBIFJvb3QgUlNBMRcwFQYDVQQKDA5BbnQgRmluYW5hY2lhbDERMA8GA1UECwwI -SW50cmFuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmxsqRHFuF -D+0HNTgjJM5ijRwur1XAa77/wG/SWfpYNy3Bhith49Nc9Rc/rtelyxWDZHUoDHUS -4wEkeUSGmMNb8NPNPbwaTcoOGvqSFMzvvvLywGJw3hvaCpse2iknvj+1XMTmgxOe -GpkyAhPSLzYeyzTHdEKed5pwemdLi5ULWO7HODaq93kGKZjNpx8fXn1h2H0cYrvR -QqDER5DIrN1AJ295ywmOJ6sRUQZO5wd0LYYNfSiM+g9k1vyH/kTnf7an1musI6kY -7GksYJt/wvpBO2elmjD/vrHZYZ2fqH1epV2hjoYNq10KpyTq4g9iP0wtcvZUGRgG -FJ7MBMSwxs9RAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGSjYHg1Sbu1j5P3etq5 -vu9elMKH4t3FztEkVf4uXIUUPDkJsWcyzdhCzeLXR6a7CUWR7LpEEK+GJDwv6ARB -xPDD5KlS2gv82Yq48uEs/Zn5U5VvsOyPCLJ0UKvJIALeLAztko96NB9MS9DL0MYE -hbE84Cbk6MGu6uLwXb68y5pLKXURqr0xVkdIKEBAj63xiMI7Xcr9HmJ8890m2nh2 -M1Wp9a5tCeZPXOmSTVic0sFWDGJwWia06S51sy1bu2aBCLJhWWJz4/jJlODaax5B -eNn3S+W9DzYGh2FMb8RBg0hAZkFW1pIhXqglB2Q2tClLMeBtZILvW0HJDBMwrK2t -b7E= -----END CERTIFICATE----- ", "private_key": @@ -41,31 +23,6 @@ b7E= Proc-Type: 4,ENCRYPTED DEK-Info: AES-128-CBC,0E89B082F30023211058CEA54450408C -BBbOWMC196O3mIHHQnYZG4ZYvMICnftbFTPsvCT39453t+SKn3Z6uvyrm5wg6Ih0 -wKrCq1+Ym8bn1ypQImZnNycWFph6kt28yAd6JoOEAddR23x6JW13g2HmP720rQaZ -iUoiuNRRab0UQOCql7PC7GDC/0zxsOOux4Vqf0kJVUdo7TiE4gyp5xdDS1/gkARp -BsRSlb7vwt6X/S6d0CcUurNI5WUhIiD62yfFkLzb0Rebpk8EOKQLzfMPRhVHxjTG -1aCXL6y2+yMtSJC5Smggj/llxtIplIgWWW4oRjizYnb5PWTJY1BUZAGYtAez5WhX -neBjZ4xv24S1PoVMv9sId5oObffbnrr3i+dXBeYG2onJfCbn06X9qZLH6zvJ/hMl -j7H3gopckmvBmClz62TM4hcF/YUPqnLol7s7zlra4u7HwdNoDhRhSZL2lckk+8zK -o527j6KOP6Y0cpTnU8Qx70vifkwoNUx3GFioyg6FDVLbAz1dGW4+fhgXHe9ZgVqi -7jKxohMZBH7g6kiqVDoFuDhaWgC1bkG0ioV0AXR5GSaqkdnSRcm1gqFmtUbsHGLL -OIgkZOt09IhqrfNmr3LW227ypOneHJ8SXj2RDcFbvR6s4CZxw8RMW7j4CKpwZb3Z -upI2JpjVMh/aYe+PGzEV444wOYXYZ+BJBkGAg1ZGikBXuXhJX5sziI42/Gu7c8HR -mIasmKgTLIAYerz94aEMjp2DmkYmLRzxe+dm/oSQvG/up14KT2o5ylAMA8mjqPYM -YgPw7Gi1Rbk/8oCj9SuukWvOW0IKiYi0QaSr3NWSsDypZP2oOf11NHnkSR8mSjLC -Wf7Q8saxaJVL6LJqgOaxKDzoTISvRM/kowbPP3iNpbCCJFZkwmKl+iHz9ienJVAS -uW6+QHuajwmxB0i6r+dUeLURyYaYEzM0SOrH/qY1CZKhEh9SeWJsifeUcgrZt7sk -ZKco0DavJDYyPdidBXIeETT6Xp7kGN8MHMXrUGR4TGWSRrJtxv4YU0k6v+biER+H -SsVV/m9mI2r0cUPTQUjMbETxITYOtOmRo2GAB7XPaRsxlfNv1Z0KA/JXcbfH/akW -AFLrS5sMGJMPIzxju49MQbztydMEuEh8vsEIVB5hHK5ygx6pzHndOForkdEYMk0W -y56MaqrDNeCuvM0Lnwi9UeeLl6HI8InJw1B+3en8XvB+rEOURxqjzDVgw2qUCAm3 -O4UArwxE97GZS/s1sgtJElikgXWspgJgqULPzlJTcrw1tD19ZL0ShG1XZpwPpbZp -g5enxKoCjZ3M4fhQkp6isiidk3gaJ02LScvBO5bxqnxSvllaHqm7QozUQ/ObHWcf -ZohJmcxY9wSIjJUvkKjKmnhOoIBAtdS6t8HC5z+3GNv0543ubRz16mQSNFX0nk0U -8GRJGZOvO4ofh8d/kvxpIRN+Jgr4hdvUnWMJSIHGq9xMC5pID3mQOWuOJEsCp6xQ -wWX54yRa0jFSWH7SFhr5wtgq54kUkE6/q8mN4Kk5N/NcXxg++c7etMWFSZh0ZvzQ -b7Ke4gUHzK4ulDaIVIAw64ljfNutOh0quRmUfv5I0obTsqi7XhH+gv+M+etwmTOW -----END RSA PRIVATE KEY----- ", "PRIVATE_KEY_PHRASE":"123456", diff --git a/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.cpp b/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.cpp index 599bf2cc6..6d7b22c42 100644 --- a/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.cpp +++ b/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.cpp @@ -872,9 +872,9 @@ int ObAdminDumpBackupDataExecutor::print_usage_() printf("\tob_admin dump_backup -f/home/admin/macro_block_1.0 -o1024 -l2048\n"); printf(" dump data with -s: \n"); printf("\tob_admin dump_backup -d'oss://home/admin/backup_info' " - "-s'host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&access_key=222'\n"); + "-s'host=xxx.com&access_id=111&access_key=222'\n"); printf("\tob_admin dump_backup -d'cos://home/admin/backup_info' " - "-s'host=http://cos.ap-nanjing.myqcloud.com&access_id=111&access_key=222&appid=333'\n"); + "-s'host=xxx.com&access_id=111&access_key=222&appid=333'\n"); return ret; } diff --git a/unittest/share/backup/test_backup_struct.cpp b/unittest/share/backup/test_backup_struct.cpp index f487dfcd6..e848fc469 100644 --- a/unittest/share/backup/test_backup_struct.cpp +++ b/unittest/share/backup/test_backup_struct.cpp @@ -76,7 +76,7 @@ TEST(ObBackupDest, nfs) TEST(ObBackupDest, oss) { - const char *backup_test = "oss://backup_dir/?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&access_key=222&delete_mode=tagging"; + const char *backup_test = "oss://backup_dir/?host=xxx.com&access_id=111&access_key=222&delete_mode=tagging"; ObBackupDest dest; ObBackupDest dest1; char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = { 0 }; @@ -88,9 +88,9 @@ TEST(ObBackupDest, oss) ASSERT_TRUE(dest.storage_info_->device_type_ == 0); ASSERT_EQ(OB_SUCCESS, dest.get_backup_dest_str(backup_dest_str, sizeof(backup_dest_str))); - ASSERT_EQ(0, strcmp(backup_dest_str, "oss://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&delete_mode=tagging")); + ASSERT_EQ(0, strcmp(backup_dest_str, "oss://backup_dir?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&delete_mode=tagging")); ASSERT_EQ(OB_SUCCESS, dest.get_backup_path_str(backup_path_str, sizeof(backup_path_str))); - ASSERT_EQ(0, strcmp(backup_path_str, "oss://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com")); + ASSERT_EQ(0, strcmp(backup_path_str, "oss://backup_dir?host=xxx.com")); ASSERT_TRUE(dest.is_root_path_equal(dest1)); bool is_equal = false; ASSERT_EQ(OB_SUCCESS, dest.is_backup_path_equal(dest1, is_equal)); @@ -103,14 +103,14 @@ TEST(ObBackupDest, oss) TEST(ObBackupDest, oss_encrypt) { - const char *backup_test = "oss://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F"; + const char *backup_test = "oss://backup_dir?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F"; ObBackupDest dest; ASSERT_EQ(OB_SUCCESS, dest.set(backup_test)); LOG_INFO("dump backup dest", K(dest.get_root_path()), K(*(dest.get_storage_info()))); ASSERT_EQ(0, strcmp(dest.root_path_, "oss://backup_dir")); ASSERT_TRUE(dest.storage_info_->device_type_ == 0); const char *path = "oss://backup_dir/"; - const char *endpoint = "host=http://oss-cn-hangzhou-zmf.aliyuncs.com"; + const char *endpoint = "host=xxx.com"; const char *authorization = "access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F"; const char *extension = ""; ObBackupDest dest1; @@ -120,9 +120,9 @@ TEST(ObBackupDest, oss_encrypt) char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = { 0 }; char backup_path_str[OB_MAX_BACKUP_DEST_LENGTH] = { 0 }; ASSERT_EQ(OB_SUCCESS, dest.get_backup_dest_str(backup_dest_str, sizeof(backup_dest_str))); - ASSERT_EQ(0, strcmp(backup_dest_str, "oss://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F")); + ASSERT_EQ(0, strcmp(backup_dest_str, "oss://backup_dir?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F")); ASSERT_EQ(OB_SUCCESS, dest.get_backup_path_str(backup_path_str, sizeof(backup_path_str))); - ASSERT_EQ(0, strcmp(backup_path_str, "oss://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com")); + ASSERT_EQ(0, strcmp(backup_path_str, "oss://backup_dir?host=xxx.com")); dest1.reset(); ASSERT_EQ(OB_SUCCESS, dest1.set(path, endpoint, authorization, extension)); @@ -131,13 +131,13 @@ TEST(ObBackupDest, oss_encrypt) TEST(ObBackupDest, cos_encrypt) { - const char *backup_test = "cos://backup_dir/?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333"; + const char *backup_test = "cos://backup_dir/?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333"; ObBackupDest dest; ASSERT_EQ(OB_SUCCESS, dest.set(backup_test)); ASSERT_EQ(0, strcmp(dest.root_path_, "cos://backup_dir")); ASSERT_TRUE(dest.storage_info_->device_type_ == 2); const char *path = "cos://backup_dir/"; - const char *endpoint = "host=http://oss-cn-hangzhou-zmf.aliyuncs.com"; + const char *endpoint = "host=xxx.com"; const char *authorization = "access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F"; const char *extension = "appid=333"; @@ -147,14 +147,14 @@ TEST(ObBackupDest, cos_encrypt) char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = { 0 }; char backup_path_str[OB_MAX_BACKUP_DEST_LENGTH] = { 0 }; ASSERT_EQ(OB_SUCCESS, dest.get_backup_dest_str(backup_dest_str, sizeof(backup_dest_str))); - ASSERT_EQ(0, strcmp(backup_dest_str, "cos://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333")); + ASSERT_EQ(0, strcmp(backup_dest_str, "cos://backup_dir?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333")); ASSERT_EQ(OB_SUCCESS, dest.get_backup_path_str(backup_path_str, sizeof(backup_path_str))); - ASSERT_EQ(0, strcmp(backup_path_str, "cos://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com")); + ASSERT_EQ(0, strcmp(backup_path_str, "cos://backup_dir?host=xxx.com")); ASSERT_EQ(OB_SUCCESS, dest1.get_backup_dest_str(backup_dest_str, sizeof(backup_dest_str))); - ASSERT_EQ(0, strcmp(backup_dest_str, "cos://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333")); + ASSERT_EQ(0, strcmp(backup_dest_str, "cos://backup_dir?host=xxx.com&access_id=111&encrypt_key=9B6FDE7E1E54CD292CDE5494CEB86B6F&appid=333")); ASSERT_EQ(OB_SUCCESS, dest1.get_backup_path_str(backup_path_str, sizeof(backup_path_str))); - ASSERT_EQ(0, strcmp(backup_path_str, "cos://backup_dir?host=http://oss-cn-hangzhou-zmf.aliyuncs.com")); + ASSERT_EQ(0, strcmp(backup_path_str, "cos://backup_dir?host=xxx.com")); } int main(int argc, char **argv) diff --git a/unittest/share/mock_kms.pem b/unittest/share/mock_kms.pem deleted file mode 100644 index 182841f7b..000000000 --- a/unittest/share/mock_kms.pem +++ /dev/null @@ -1,50 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDqTCCApECAgDMMA0GCSqGSIb3DQEBCwUAMIGYMQswCQYDVQQGEwJDTjEQMA4G -A1UECAwHQmVpamluZzEQMA4GA1UEBwwHQmVpamluZzEWMBQGA1UECgwNQ2lwaGVy -R2F0ZXdheTEUMBIGA1UECwwLRGV2ZWxvcG1lbnQxEjAQBgNVBAMMCUNBU0JNVU5F -VzEjMCEGCSqGSIb3DQEJARYUZ3lAY2lwaGVyZ2F0ZXdheS5jb20wIBcNMjEwODIy -MDMwMTU2WhgPMjEyMTA3MjkwMzAxNTZaMIGYMQswCQYDVQQGEwJDTjEQMA4GA1UE -CAwHQmVpamluZzEWMBQGA1UECgwNQ2lwaGVyR2F0ZXdheTEUMBIGA1UECwwLRGV2 -ZWxvcG1lbnQxEDAOBgNVBAcMB0JlaWppbmcxEjAQBgNVBAMMCUNBU0JNVU5FVzEj -MCEGCSqGSIb3DQEJARYUZ3lAY2lwaGVyZ2F0ZXdheS5jb20wggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC4dR5v+LyNYFo8fb4v0Wz1bZEmbWLmAjbqfPqk -VZLT7cmARpc5O92OHNsNQkMSagvxoDRgddPFH9H2XQ4jOf4n0WMZ8hm9zlS/yP8D -cRNyWqhVE1G1dfGl4TbxbbEC9dDmv7+ZZsq9GLmS8+59eOEm08b4ZfMLTwYRYgr4 -SUimtbb1UajWKhBMCxXl3+xgnoNgFnX8LiIVoCEoUncyng3bfBK93vxZNCkzA1OO -ubG8vV+evnOhqDxjKRpOMArrYCFcWYvq+kj16qI4vYUxJ63rMP2LE13ZRhlFnEoF -HSYu0GVL/z02luAHwZKCv7g8UaCVHdzP6Xm70eTnXmVhSPjvAgMBAAEwDQYJKoZI -hvcNAQELBQADggEBADqK2F1OLMawmFrWy/3IUaT6lPj+o8faHpLrQc5aC+xNzArv -KBUnj4BBUIFuPlicJtmTSZtn0yM/HVcTqfOnYzIv2ATI8/RWTwLjCfZLviWiQcu0 -EZECjVIecZuAT5O5JBdIrk7BEqaARazeY+X9S5e9oe99x4DmAOqWfMb79FCznJAi -snEDuf5eftvZOCsnZdjWlq5Z/fruSr5JIyPX0wi4T2ktjkPWNeXWI8R2Gzum/hLM -L0NXnDrbdvGxFAK15H8FDR2665GFfSLJ63R7ahb8KDzrd1fUPcP+Sqqd/PyQTVdn -BzOIEpU0wTVhr7fcxs8H0mYzJuVZ++Cov3jGNNc= ------END CERTIFICATE----- ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4dR5v+LyNYFo8 -fb4v0Wz1bZEmbWLmAjbqfPqkVZLT7cmARpc5O92OHNsNQkMSagvxoDRgddPFH9H2 -XQ4jOf4n0WMZ8hm9zlS/yP8DcRNyWqhVE1G1dfGl4TbxbbEC9dDmv7+ZZsq9GLmS -8+59eOEm08b4ZfMLTwYRYgr4SUimtbb1UajWKhBMCxXl3+xgnoNgFnX8LiIVoCEo -Uncyng3bfBK93vxZNCkzA1OOubG8vV+evnOhqDxjKRpOMArrYCFcWYvq+kj16qI4 -vYUxJ63rMP2LE13ZRhlFnEoFHSYu0GVL/z02luAHwZKCv7g8UaCVHdzP6Xm70eTn -XmVhSPjvAgMBAAECggEAVbyqfyVAjv4gM0nHIvbXDGT3OMNTWtHgsLGS1tunubYn -GOa217WJz8p9zvXjsyVzk8YBUmyyGEgoEblDHwCPr/ZVd/PeHylOny5Pyku+3EJj -R9gI/K1rusyp+yIfSt7zUK4D4suypJ5fc3zKd6u+C4wYSdEpXTJIAcBulOWLTWET -FbIYhIOPdceMpUUL7YatUMkZ+Qea48kBwb9CvVeAmfYwQ8XSbcQtom67goJquvG6 -rTzjTStA+2b0jVGf016QiNRl2cuh55mDbroUDtVu5pLHzRKgNndZ3tPk5uIgtrVW -1pxzxdb6G+J2Rk6XNvBKScD33A5T48pYEJVIcubfYQKBgQDh48eWYepGUjRZjLNT -fRs6q5OGvqNxSroEiOhotSSWhPfG00kv6QPaeUu38LRE7t2vbtNpMWaJasla3dJo -0jppMkUnwwH/WbJZQ3WSkkFutuCECwsMwxiW5WNVNlAIMrrsH4lQ+334GnAOYRdl -p9C6nAnmjESayY4NhDJytcZxZwKBgQDRC4Mg7/RBO6ZXqZ56G9j647ABulfqMkjg -4aDpyyiA2w6BYeLpRGHlSOq0Q4/k72J9a17+UdAgmiZdxC9VtxIFfEdls2l1CANq -a6VXnHu86PexSVpg6RG5HhGg1FKGM/guXMoCVKfbYZLHkydK/KYiWKdNeLAdo3fL -qh98EoffOQKBgQCleaA3CMl+9C9HPmwLiAVPaGss9TB0CMLWGZjvQ2tnHEcKjrL5 -duAMxnhyadEVAkrBfhU+5SJxHhodB4xgn0iM0XeZliA7d/DPtTxGv/9Q5IT6FcDl -e3Hi8G1g+eWM6+TEnqGQAnuYKX3W+scR/+pHGZGjIzQKlAYM3r+6CnExlwKBgEWV -dm2lUgHQ0DsH7Aerc1t4JOM+WvtLB7VLhZutE2to/3gT1EtfhtKipfWhM6m6AWfM -MM+o/gWMKk81+aeni6klyEJTKTxakYCAGoaCQTINvj1WNG5jxpF/L9EAPAQOEoOk -QV3rPgCphwlFs2Ojm819Axunm8AR5NN3aomLRY0JAoGBAKhD1G6xsnmQyTGQfbCN -zzXdb5VhK69LmjK9SgfWbY6g6wLJgceQhwjy6sMPBvppJMXKi0F849B2lZscoaqu -+NmVRbdbD+vSREfvvN0TIr2Gm7dw9n+efEDlyVUGM4DYYee/qM+5bA0AIQkCMJVw -U48l+8AlqzXL7c7f8Ol9gVFu ------END PRIVATE KEY----- diff --git a/unittest/share/mock_kms_server.py b/unittest/share/mock_kms_server.py deleted file mode 100644 index 24472d07f..000000000 --- a/unittest/share/mock_kms_server.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -import BaseHTTPServer -from SimpleHTTPServer import SimpleHTTPRequestHandler -import os -import socket -import ssl -import json -import random - -script_home = os.path.dirname(os.path.abspath(__file__)) -ip = "127.0.0.1" -port = 8888 -response_data = """{ - "token": "ob_test1", - "key": "5D6A57468605ADB17C065B3423E7112D", - "hash": "E185FFAD6642A467BF8E4311086E80A9B9F6B55D6BF2FE6A13F935E0479FC558", - "keyversion": "1", - "success": true, - "msg": "" -} -""" - -class MyHandler(SimpleHTTPRequestHandler): - def do_POST(self): - self.data_string = self.rfile.read(int(self.headers['Content-Length'])) - - self.end_headers() - print self.data_string - self.wfile.write(response_data) - return - -def main(): - print ("simple https server, address:%s:%d" % (ip, port)) - - httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', port), MyHandler) - httpd.socket = ssl.wrap_socket(httpd.socket, certfile='./mock_kms.pem', server_side=True) - httpd.serve_forever() - -if __name__ == '__main__': - main() diff --git a/unittest/share/test_encryption_util.cpp b/unittest/share/test_encryption_util.cpp index d351c4bcd..8e088edc7 100644 --- a/unittest/share/test_encryption_util.cpp +++ b/unittest/share/test_encryption_util.cpp @@ -197,7 +197,7 @@ TEST(TestEncryptionUtil, encrypt_master_key) // ObServerConfig &config = ObServerConfig::get_instance(); // ASSERT_EQ(OB_SUCCESS, config.init(sys_config)); // ws.init(config); -// config.obconfig_url.set_value("http://api.test.ocp.oceanbase.alibaba.net/services?Action=ObRootServiceInfo&User_ID=ocptest&UID=rongwei.drw&ObRegion=xr.admin"); +// config.obconfig_url.set_value(""); // config.cluster_id.set_value("1"); // config.cluster.set_value("xr.admin"); // ObArray rs_list; diff --git a/unittest/share/test_ob_config.cpp b/unittest/share/test_ob_config.cpp index 21e7c9d2b..a2a5a0da4 100644 --- a/unittest/share/test_ob_config.cpp +++ b/unittest/share/test_ob_config.cpp @@ -134,7 +134,7 @@ public: DEF_INT_LIST(test_int_list_2, "1;2;3", "test list"); DEF_STR_LIST(test_str_list, "str1;str2;str3", "test list"); DEF_STR_LIST(test_str_list_2, "str1;str2;str3", "test list"); - DEF_STR(url, "http://a.cc/?name=fufeng&pass=fufeng_pass", "test url"); + DEF_STR(url, "test url", "test url"); DEF_DBL(dbl1, "1.234", "some info"); DEF_DBL(dbl2, "1.234", "[1.234,5.321]", "some info"); @@ -374,7 +374,7 @@ TEST_F(TestServerConfig, ALL) test_str_list = "123x"; EXPECT_TRUE(test_int_list.valid()); - EXPECT_STREQ("http://a.cc/?name=fufeng&pass=fufeng_pass", url.str()); + EXPECT_STREQ("test url", url.str()); EXPECT_EQ(1.234, dbl1); EXPECT_EQ(1.234, dbl2); diff --git a/unittest/share/test_restore_reader.cpp b/unittest/share/test_restore_reader.cpp deleted file mode 100644 index a327fa9e3..000000000 --- a/unittest/share/test_restore_reader.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#define USING_LOG_PREFIX SHARE -#include -#include "lib/restore/oss/include/oss_c_sdk/aos_http_io.h" -#include "lib/restore/oss/include/oss_c_sdk/aos_define.h" -#include "vsclient.h" -#include "lib/utility/ob_test_util.h" -#include "share/restore/ob_restore_uri_parser.h" -#include "share/restore/ob_restore_base_reader.h" -#include "lib/restore/ob_storage.h" -#include "share/restore/ob_oss_resource_reader.h" - -using namespace oceanbase::common; -using namespace oceanbase::share; -using namespace oceanbase::share::restore; -class TestRestoreReader: public ::testing::Test -{ -public: - TestRestoreReader(); - virtual ~TestRestoreReader(); - virtual void SetUp(); - virtual void TearDown(); -private: - // disallow copy - DISALLOW_COPY_AND_ASSIGN(TestRestoreReader); -protected: - // function members -protected: - // data members -}; - -TestRestoreReader::TestRestoreReader() -{ - int ret = OB_SUCCESS; - int aos_ret = AOSE_OK; - if(AOSE_OK != (aos_ret = aos_http_io_initialize(NULL, 0))) { - OB_LOG(WARN, "fail to init aos", K(aos_ret)); - } - VIPSrv_Result *result = NULL; - VIPSrv_Config config; - config.jmenv_dom = "jmenv.tbsite.net"; - config.cache_dir = getenv("HOME"); - if(NULL == (result = vipsrv_global_init(&config))) { - ret = OB_OSS_ERROR; - OB_LOG(WARN, "fail to init vipserver", K(ret)); - } else if(!result->is_success) { - ret = OB_OSS_ERROR; - OB_LOG(WARN, "fail to init vipserver", K(ret)); - } - - if(NULL != result) { - vipsrv_result_deref(result); - } -} - -TestRestoreReader::~TestRestoreReader() -{ - vipsrv_global_cleanup(); - aos_http_io_deinitialize(); -} - -void TestRestoreReader::SetUp() -{ - const int64_t MAX_BUF_SIZE = 2048; - char write_buf[MAX_BUF_SIZE]; - char uri[OB_MAX_URI_LENGTH]; - int n = 0; - ObBackupIoAdapter util; - const char *storage_info = "host=oss-cn-hangzhou-zmf.aliyuncs.com&access_id=LTAIwCjHu9OYhWyx&access_key=RHyQfn2TnnOyY9wsedthx1nx9EVkH3"; - - //resource unit - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE RESOURCE UNIT small_unit MAX_CPU 18.000000, MEMORY_SIZE 21474836480;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/resource_unit_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //resource pool - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE RESOURCE POOL pool1 UNIT small_unit, UNIT_NUM 1, ZONE_LIST ('zone1');"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/resource_pool_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //create tenant - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE TENANT tt1 charset=utf8mb4, replica_num=5, zone_list('zone1'), primary_zone='zone1', " - "locality='FULL{1}@zone1', resource_pool_list('pool1');"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/create_tenant_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //create database - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE DATABASE IF NOT EXISTS `obtrade` DEFAULT CHARACTER SET = utf8mb4 REPLICA_NUM = 5;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/create_database_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //system variable - n = snprintf(write_buf, MAX_BUF_SIZE, "set global wait_timeout = 28800;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/system_variable_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //create_user_definition - n = snprintf(write_buf, MAX_BUF_SIZE, "create user monitor IDENTIFIED BY PASSWORD '*1975d095ac033caf4e1bf94f7202a9bbfeeb66f1';"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/create_user_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //user_privilege_definition - n = snprintf(write_buf, MAX_BUF_SIZE, "GRANT ALL PRIVILEGES ON *.* TO 'admin' WITH GRANT OPTION;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/user_privilege_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //crate table - n = snprintf(write_buf, MAX_BUF_SIZE, " CREATE TABLE obtrade.business_activity_000 (" - "`TX_ID` varchar(256) NOT NULL id 16," - "`STATE` varchar(2) NOT NULL id 17," - "`ACCOUNT_TRANS_STATE` varchar(2) NOT NULL id 18," - "`GMT_CREATE` datetime NOT NULL id 19," - "`GMT_MODIFIED` datetime NOT NULL id 20," - "`PROPAGATION` varchar(2) DEFAULT NULL id 21," - "`CONTEXT` varchar(4096) DEFAULT NULL id 22," - "PRIMARY KEY (`TX_ID`)," - "KEY `BUSINESS_ACTIVITY_GMT_IND` (`GMT_MODIFIED`) STORING (`STATE`) BLOCK_SIZE 16384 index_table_id = 1101710651081555" - ") DEFAULT CHARSET = utf8mb4 COMPRESSION = 'lz4_1.0' REPLICA_NUM = 5 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE " - " TABLEGROUP = 'obtrade_tablegroup' table_id = 1101710651081554 ;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/435656765867/ob_trade_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //create_tablegroup_definition - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE TABLEGROUP tg1;"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/create_tablegroup_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //backup_info - n = snprintf(write_buf, MAX_BUF_SIZE, "0_127_1496650316422256_0"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/tenant_id/1001/backup_info"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //data_table_ids - n = snprintf(write_buf, MAX_BUF_SIZE, "435656765867:ob_trade"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/data_table_ids_list"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //create index - n = snprintf(write_buf, MAX_BUF_SIZE, "CREATE UNIQUE INDEX __idx_1099511677787_haipeng_unique_index on oceanbase.haipeng (" - "`c1` int(11) NOT NULL id 16," - "`c2` int(11) DEFAULT NULL id 17," - "`c3` int(11) DEFAULT NULL id 18" - ") BLOCK_SIZE 16384 index_table_id = 1099511677791 data_table_id = 1099511677787 STORING (`c2`);"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/435656765867/__idx_1099511677787_haipeng_unique_index_definition"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); - //index_table_ids - n = snprintf(write_buf, MAX_BUF_SIZE, "435656765867:1099511677787:__idx_1099511677787_haipeng_unique_index"); - snprintf(uri, OB_MAX_URI_LENGTH, "oss://071092/unittest/127/1001/index_table_ids_list"); - EXPECT_EQ(OB_SUCCESS, util.write_single_file(uri, storage_info, write_buf, n)); -} - -void TestRestoreReader::TearDown() -{ -} - -TEST_F(TestRestoreReader, test_basic) -{ - // The following only applies to offline testing. Regression testing on farm will always report errors and there is no runtime environment. - - ObRestoreArgs arg; - const char *uri_001 = "oss://071092/unittest/1001?timestamp=1496650316422256&host=oss-cn-hangzhou-zmf.aliyuncs.com&access_id=LTAIwCjHu9OYhWyx&access_key=RHyQfn2TnnOyY9wsedthx1nx9EVkH3&restore_user=a&restore_pass=b"; - EXPECT_EQ(OB_SUCCESS, ObRestoreURIParser::parse(ObString(uri_001), arg)); - LOG_INFO("arg info", K(arg)); - - ObRestoreBaseReader reader(arg); - ObArray stmts; - ASSERT_EQ(OB_SUCCESS, reader.init(ObString(uri_001))); - ASSERT_EQ(OB_SUCCESS, reader.get_create_unit_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - - ASSERT_EQ(OB_SUCCESS, reader.get_create_pool_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - - ObString stmt; - ASSERT_EQ(OB_SUCCESS, reader.get_create_tenant_stmt(stmt)); - LOG_INFO("restore test", K(arg), K(stmt)); - - ASSERT_EQ(OB_SUCCESS, reader.get_create_tablegroup_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - - ASSERT_EQ(OB_SUCCESS, reader.get_create_database_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - - ASSERT_EQ(OB_SUCCESS, reader.get_create_data_table_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - - ASSERT_EQ(OB_SUCCESS, reader.get_create_index_table_stmts(stmts)); - LOG_INFO("restore test", K(arg), K(stmts)); - ASSERT_TRUE(stmts.count() > 0); - -} - -int main(int argc, char **argv) -{ - oceanbase::common::ObLogger::get_logger().set_log_level("INFO"); - OB_LOGGER.set_mod_log_levels("ALL.*:INFO,LIB.MYSQLC:ERROR"); - ::testing::InitGoogleTest(&argc,argv); - return RUN_ALL_TESTS(); -} diff --git a/unittest/storage/test_compaction_policy.cpp b/unittest/storage/test_compaction_policy.cpp index f69ad8acd..6322e2388 100644 --- a/unittest/storage/test_compaction_policy.cpp +++ b/unittest/storage/test_compaction_policy.cpp @@ -880,4 +880,4 @@ int main(int argc, char **argv) CLOG_LOG(INFO, "begin unittest: test_compaction_policy"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/unittest/storage/test_dml_common.h b/unittest/storage/test_dml_common.h index ac77663c3..cc4051961 100644 --- a/unittest/storage/test_dml_common.h +++ b/unittest/storage/test_dml_common.h @@ -451,7 +451,7 @@ int TestDmlCommon::build_table_scan_param_base_( scan_param.limit_param_.offset_ = 0; scan_param.need_scn_ = false; scan_param.pd_storage_flag_ = false; - scan_param.fb_snapshot_ = transaction::ObTransVersion::INVALID_TRANS_VERSION; + scan_param.fb_snapshot_.reset(); ObNewRange range; range.table_id_ = table_id; diff --git a/unittest/storage/test_lob_common.h b/unittest/storage/test_lob_common.h index a6cc207f2..7503074c5 100644 --- a/unittest/storage/test_lob_common.h +++ b/unittest/storage/test_lob_common.h @@ -410,7 +410,7 @@ int TestLobCommon::build_lob_meta_table_scan_param( scan_param.limit_param_.offset_ = 0; scan_param.need_scn_ = false; scan_param.pd_storage_flag_ = false; - scan_param.fb_snapshot_ = transaction::ObTransVersion::INVALID_TRANS_VERSION; + scan_param.fb_snapshot_.reset(); ObNewRange range; range.table_id_ = table_id;