diff --git a/concourse/scripts/builds/GpBuild.py b/concourse/scripts/builds/GpBuild.py index 0eb041bface..2ed28467d54 100755 --- a/concourse/scripts/builds/GpBuild.py +++ b/concourse/scripts/builds/GpBuild.py @@ -52,7 +52,7 @@ def _run_gpdb_command(self, command, stdout=None, stderr=None, source_env_cmd='' cmd = source_env_cmd runcmd = "runuser gpadmin -c \"{0} && {1} \"".format(cmd, command) if print_command: - print "Executing {}".format(runcmd) + print("Executing {}".format(runcmd)) return subprocess.call([runcmd], shell=True, stdout=stdout, stderr=stderr) def run_explain_test_suite(self, dbexists): @@ -74,7 +74,7 @@ def run_explain_test_suite(self, dbexists): status = self._run_gpdb_command("psql -q -f stats.sql", stdout=f) if status: with open("load_stats.txt", "r") as f: - print f.read() + print(f.read()) fail_on_error(status) # set gucs if any were specified @@ -95,10 +95,10 @@ def run_explain_test_suite(self, dbexists): if fsql.endswith('.sql') and fsql not in ['stats.sql', 'schema.sql']: output_fname = 'out/{}'.format(fsql.replace('.sql', '.out')) with open(output_fname, 'w') as fout: - print "Running query: " + fsql + print("Running query: " + fsql) current_status = self._run_gpdb_command("psql -a -f sql/{}".format(fsql), stdout=fout, stderr=fout, source_env_cmd=source_env_cmd, print_command=False) if current_status != 0: - print "ERROR: {0}".format(current_status) + print("ERROR: {0}".format(current_status)) status = status if status != 0 else current_status return status diff --git a/concourse/scripts/perfsummary.py b/concourse/scripts/perfsummary.py index 0a8bfae0db3..cab68c14088 100755 --- a/concourse/scripts/perfsummary.py +++ b/concourse/scripts/perfsummary.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Extracts summary info from a log file that compiles and executes test suite # queries. Creates a CSV (comma-separated values) summary. @@ -209,20 +209,20 @@ def comparePlans(self, base, queryId): # print header for CSV file def printHeader(self, numFiles): if (numFiles == 1): - print 'Query id, planning time, execution time, comment' + print('Query id, planning time, execution time, comment') else: - print 'Query id, base planning time, planning time, base execution time, execution time, plan changes, base comment, comment' + print('Query id, base planning time, planning time, base execution time, execution time, plan changes, base comment, comment') # print result for all recorded queries in CSV format for a single log file def printme(self): for q in self.query_id_list: - print "%s, %s, %s, %s" % (q, self.query_explain_time_map[q], self.query_exe_time_map[q], self.query_comment_map[q]) + print("%s, %s, %s, %s" % (q, self.query_explain_time_map[q], self.query_exe_time_map[q], self.query_comment_map[q])) # print a CSV file with a comparison between a base file and a test file def printComparison(self, base, diffDir, diffThreshold, diffLevel): for q in self.query_id_list: planDiffs = self.comparePlans(base, q) - print "%s, %s, %s, %s, %s, %s, %s, %s" % (q, base.query_explain_time_map[q], self.query_explain_time_map[q], base.query_exe_time_map[q], self.query_exe_time_map[q], planDiffText[planDiffs], base.query_comment_map[q], self.query_comment_map[q]) + print("%s, %s, %s, %s, %s, %s, %s, %s" % (q, base.query_explain_time_map[q], self.query_explain_time_map[q], base.query_exe_time_map[q], self.query_exe_time_map[q], planDiffText[planDiffs], base.query_comment_map[q], self.query_comment_map[q])) if int(diffLevel) <= int(planDiffs): baseTime = float(base.query_exe_time_map[q]) testTime = float(self.query_exe_time_map[q]) @@ -267,7 +267,7 @@ def main(): os.mkdir(diffDir + "/base") os.mkdir(diffDir + "/test") except: - print "Unable to create diff directory %s" % diffDir + print("Unable to create diff directory %s" % diffDir) exit(1) if args.diffThreshold is not None: diffThreshold = args.diffThreshold @@ -278,11 +278,11 @@ def main(): diffLevel = args.diffLevel else: if (args.diffThreshold is not None or args.diffLevel is not None): - print "Please specify the --diffDir option with a directory name to request diff files\n" + print("Please specify the --diffDir option with a directory name to request diff files\n") exit(1) if inputfile is None: - print "Expected the name of a log file with test suite queries\n" + print("Expected the name of a log file with test suite queries\n") exit(1) if basefile is not None: diff --git a/concourse/scripts/regression_tests_gpcloud.bash b/concourse/scripts/regression_tests_gpcloud.bash index 5fdc9a1c08f..7d3011ad6d7 100755 --- a/concourse/scripts/regression_tests_gpcloud.bash +++ b/concourse/scripts/regression_tests_gpcloud.bash @@ -37,11 +37,11 @@ function setup_gpadmin_user() { } function make_cluster() { - PYTHONPATH=${SCRIPT_DIR}:${PYTHONPATH} python2 -c "from builds.GpBuild import GpBuild; GpBuild(\"planner\").create_demo_cluster(install_dir='$GPDB_INSTALL_DIR')" + PYTHONPATH=${SCRIPT_DIR}:${PYTHONPATH} python3 -c "from builds.GpBuild import GpBuild; GpBuild(\"planner\").create_demo_cluster(install_dir='$GPDB_INSTALL_DIR')" } function configure_with_planner() { - PYTHONPATH=${SCRIPT_DIR}:${PYTHONPATH} python2 -c "from builds.GpBuild import GpBuild; GpBuild(\"planner\").configure()" + PYTHONPATH=${SCRIPT_DIR}:${PYTHONPATH} python3 -c "from builds.GpBuild import GpBuild; GpBuild(\"planner\").configure()" } function copy_gpdb_bits_to_gphome() { diff --git a/concourse/scripts/unit_tests_gporca.bash b/concourse/scripts/unit_tests_gporca.bash index 458185e5be0..c7b6956cdd4 100755 --- a/concourse/scripts/unit_tests_gporca.bash +++ b/concourse/scripts/unit_tests_gporca.bash @@ -8,7 +8,7 @@ function build_xerces OUTPUT_DIR="gpdb_src/gpAux/ext/${BLD_ARCH}" mkdir -p xerces_patch/concourse cp -r gpdb_src/src/backend/gporca/concourse/xerces-c xerces_patch/concourse - /usr/bin/python xerces_patch/concourse/xerces-c/build_xerces.py --output_dir=${OUTPUT_DIR} + /usr/bin/python3 xerces_patch/concourse/xerces-c/build_xerces.py --output_dir=${OUTPUT_DIR} rm -rf build } diff --git a/contrib/file_fdw/output/file_fdw_optimizer.source b/contrib/file_fdw/output/file_fdw_optimizer.source index 63a625f2018..0bdcd888d87 100644 --- a/contrib/file_fdw/output/file_fdw_optimizer.source +++ b/contrib/file_fdw/output/file_fdw_optimizer.source @@ -216,6 +216,8 @@ DETAIL: Feature not supported: Deletes with foreign tables ERROR: cannot delete from foreign table "agg_csv" -- but this should be allowed SELECT * FROM agg_csv FOR UPDATE; +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: Locking clause on foreign table a | b -----+--------- 100 | 99.097 diff --git a/gpMgmt/bin/gppylib/test/unit/test_unit_gpcheckcat.py b/gpMgmt/bin/gppylib/test/unit/test_unit_gpcheckcat.py index 63f2d88fe89..ccdfb03a7ad 100755 --- a/gpMgmt/bin/gppylib/test/unit/test_unit_gpcheckcat.py +++ b/gpMgmt/bin/gppylib/test/unit/test_unit_gpcheckcat.py @@ -320,7 +320,7 @@ def test_skip_one_test(self, mock_ver, mock_run, mock1, mock2): testargs = ['gpcheckcat', '-port 1', '-s test2'] with patch.object(sys, 'argv', testargs): self.subject.main() - mock_run.assert_has_calls(call(['test1', 'test3'])) + mock_run.assert_has_calls([call(['test1', 'test3'])]) @patch('gpcheckcat.GPCatalog', return_value=Mock()) @patch('sys.exit') @@ -336,7 +336,7 @@ def test_skip_multiple_test(self, mock_ver, mock_run, mock1, mock2): testargs = ['gpcheckcat', '-port 1', '-s', "test1, test2"] with patch.object(sys, 'argv', testargs): self.subject.main() - mock_run.assert_has_calls(call(['test3'])) + mock_run.assert_has_calls([call(['test3'])]) @patch('gpcheckcat.GPCatalog', return_value=Mock()) @patch('sys.exit') @@ -352,7 +352,7 @@ def test_skip_test_warning(self, mock_ver, mock_run, mock1, mock2): testargs = ['gpcheckcat', '-port 1', '-s', "test_invalid, test2"] with patch.object(sys, 'argv', testargs): self.subject.main() - mock_run.assert_has_calls(call(['test1', 'test3'])) + mock_run.assert_has_calls([call(['test1', 'test3'])]) expected_message = "'test_invalid' is not a valid test" log_messages = [args[0][1] for args in self.subject.logger.log.call_args_list] self.assertIn(expected_message, log_messages) diff --git a/gpMgmt/requirements-dev.txt b/gpMgmt/requirements-dev.txt index c7f3ee5ebe5..384167ab49a 100644 --- a/gpMgmt/requirements-dev.txt +++ b/gpMgmt/requirements-dev.txt @@ -1,4 +1,4 @@ -gsutil<=4.47 +gsutil behave~=1.2.6 coverage~=4.5 more-itertools<8.1 @@ -37,3 +37,4 @@ pathlib2<=2.3.5 cffi<=1.13.2 scandir<=1.10.0 pycparser<=2.19 +mock<=5.0.0 diff --git a/gpcontrib/gpcloud/Makefile b/gpcontrib/gpcloud/Makefile index fff38e7c567..6061cef07ba 100644 --- a/gpcontrib/gpcloud/Makefile +++ b/gpcontrib/gpcloud/Makefile @@ -16,6 +16,9 @@ endif MODULE_big = gpcloud OBJS = src/gpcloud.o lib/http_parser.o lib/ini.o $(addprefix src/,$(COMMON_OBJS)) +# Avoid building LLVM Bitcode for gpcloud module. +with_llvm = no + # Launch ifdef USE_PGXS PGXS := $(shell pg_config --pgxs) diff --git a/gpcontrib/gpcloud/bin/dummyHTTPServer.py b/gpcontrib/gpcloud/bin/dummyHTTPServer.py index e0c55887fff..8c288e173c8 100755 --- a/gpcontrib/gpcloud/bin/dummyHTTPServer.py +++ b/gpcontrib/gpcloud/bin/dummyHTTPServer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Very simple HTTP server in python. @@ -12,8 +12,8 @@ curl -d "foo=bar&bin=baz" http://localhost """ -from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer -import SocketServer +from http.server import BaseHTTPRequestHandler, HTTPServer +import socketserver import getopt import sys import os @@ -46,8 +46,8 @@ def do_HEAD(self): def do_PUT(self): # Just bounce the request back - print "----- SOMETHING WAS PUT ------" - print self.headers + print("----- SOMETHING WAS PUT ------") + print(self.headers) length = int(self.headers['Content-Length']) content = self.rfile.read(length) self._set_headers(length) @@ -55,8 +55,8 @@ def do_PUT(self): def do_POST(self): # Just bounce the request back - print "----- SOMETHING WAS POST ------" - print self.headers + print("----- SOMETHING WAS POST ------") + print(self.headers) length = int(self.headers['Content-Length']) content = self.rfile.read(length) self._set_headers(length) @@ -64,8 +64,8 @@ def do_POST(self): def do_DELETE(self): # Just bounce the request back - print "----- SOMETHING WAS DELETED ------" - print self.headers + print("----- SOMETHING WAS DELETED ------") + print(self.headers) length = int(self.headers['Content-Length']) # content = self.rfile.read(length) self._set_headers(length) @@ -85,8 +85,8 @@ def _getcontent(self): with open(filename, 'r') as f: content = f.read() except Exception: - print "Can not open file:%s" % filename - return content + print("Can not open file:%s" % filename) + return content.encode('utf8') def do_GET(self): try: @@ -97,7 +97,7 @@ def do_GET(self): else: self._set_headers(0) except KeyError: - print "Header missing S3_Param_Req" + print("Header missing S3_Param_Req") self._set_headers(0) def run(server_class=HTTPServer, handler_class=S, port=8553, https=False): @@ -117,7 +117,7 @@ def run(server_class=HTTPServer, handler_class=S, port=8553, https=False): httpd.socket = ssl.wrap_socket (httpd.socket, keyfile=keyfile, certfile=certfile, server_side=True) - print 'Starting http server...' + print('Starting http server...') httpd.serve_forever() if __name__ == "__main__": @@ -128,11 +128,11 @@ def run(server_class=HTTPServer, handler_class=S, port=8553, https=False): try: opts, args = getopt.getopt(argv[1:],"hsp:f:t:",["--port=","--filename=", "--type="]) except getopt.GetoptError: - print help_msg + print(help_msg) sys.exit(2) for opt, arg in opts: if opt == '-h': - print help_msg + print(help_msg) sys.exit(0) elif opt == '-s': use_ssl = True diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 0f8f84cdb6d..bb821417cf3 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -203,7 +203,7 @@ with_krb_srvnam = @with_krb_srvnam@ with_ldap = @with_ldap@ with_libxml = @with_libxml@ with_libxslt = @with_libxslt@ -with_llvm = @with_llvm@ +with_llvm ?= @with_llvm@ with_system_tzdata = @with_system_tzdata@ with_uuid = @with_uuid@ with_zlib = @with_zlib@ diff --git a/src/backend/Makefile b/src/backend/Makefile index e5cfaf08681..0b2857c3f34 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -258,8 +258,14 @@ endif ifeq ($(with_llvm), yes) install-bin: install-postgres-bitcode +# GPDB: Bitcode generation in certain subdir can be avoid when `with_llvm = no` +# set there. But the install step is not aware of the setting and would fail if +# we don't tell it the absence of *.bc files under those directory manually. +# As we set ORCA to generate no bitcodes, ORCA directories is excluded here. +bitcode_ignored_subdirs = $(top_builddir)/src/timezone gporca gpopt + install-postgres-bitcode: $(OBJS) all - $(call install_llvm_module,postgres,$(call expand_subsys, $(filter-out $(top_builddir)/src/timezone/objfiles.txt, $(SUBDIROBJS)))) + $(call install_llvm_module,postgres,$(call expand_subsys, $(filter-out $(bitcode_ignored_subdirs:%=%/objfiles.txt), $(SUBDIROBJS)))) endif install-bin: postgres $(POSTGRES_IMP) installdirs diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index e0f20f94d45..0fe1478635c 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -3012,10 +3012,7 @@ show_sort_keys(SortState *sortstate, List *ancestors, ExplainState *es) Sort *plan = (Sort *) sortstate->ss.ps.plan; const char *SortKeystr; - if (sortstate->noduplicates) - SortKeystr = "Sort Key (Distinct)"; - else - SortKeystr = "Sort Key"; + SortKeystr = "Sort Key"; show_sort_group_keys((PlanState *) sortstate, SortKeystr, plan->numCols, 0, plan->sortColIdx, diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c index b8c7c47fd15..dcb4ccf4e20 100644 --- a/src/backend/executor/nodeSort.c +++ b/src/backend/executor/nodeSort.c @@ -248,11 +248,6 @@ ExecInitSort(Sort *node, EState *estate, int eflags) */ ExecAssignExprContext(estate, &sortstate->ss.ps); - /* CDB */ /* evaluate a limit as part of the sort */ - { - sortstate->noduplicates = node->noduplicates; - } - /* * Miscellaneous initialization * diff --git a/src/backend/gpopt/config/CConfigParamMapping.cpp b/src/backend/gpopt/config/CConfigParamMapping.cpp index 48061c9e56b..f0364f29b5f 100644 --- a/src/backend/gpopt/config/CConfigParamMapping.cpp +++ b/src/backend/gpopt/config/CConfigParamMapping.cpp @@ -211,6 +211,12 @@ CConfigParamMapping::SConfigMappingElem CConfigParamMapping::m_elements[] = { GPOS_WSZ_LIT( "Enable plan alternatives where NLJ's outer child is replicated")}, + {EopttraceDiscardRedistributeHashJoin, + &optimizer_discard_redistribute_hashjoin, + false, // m_negate_param + GPOS_WSZ_LIT( + "Discard plan alternatives where hash join has a redistribute motion child")}, + {EopttraceMotionHazardHandling, &optimizer_enable_streaming_material, false, // m_fNegate GPOS_WSZ_LIT( diff --git a/src/backend/gpopt/gpdbwrappers.cpp b/src/backend/gpopt/gpdbwrappers.cpp index 90fd927d162..61c5f73b331 100644 --- a/src/backend/gpopt/gpdbwrappers.cpp +++ b/src/backend/gpopt/gpdbwrappers.cpp @@ -23,6 +23,8 @@ #include "gpopt/gpdbwrappers.h" +#include // std::numeric_limits + #include "gpos/base.h" #include "gpos/error/CAutoExceptionStack.h" #include "gpos/error/CException.h" @@ -747,6 +749,40 @@ gpdb::GetAttStats(Oid relid, AttrNumber attnum) return nullptr; } +List * +gpdb::GetExtStats(Relation rel) +{ + GP_WRAP_START; + { + /* catalog tables: pg_statistic_ext */ + return GetRelationExtStatistics(rel); + } + GP_WRAP_END; + return nullptr; +} + +char * +gpdb::GetExtStatsName(Oid statOid) +{ + GP_WRAP_START; + { + return GetExtStatisticsName(statOid); + } + GP_WRAP_END; + return nullptr; +} + +List * +gpdb::GetExtStatsKinds(Oid statOid) +{ + GP_WRAP_START; + { + return GetExtStatisticsKinds(statOid); + } + GP_WRAP_END; + return nullptr; +} + Oid gpdb::GetCommutatorOp(Oid opno) { @@ -834,6 +870,17 @@ gpdb::GetRelationPartitionKey(Relation rel) return nullptr; } +PartitionDesc +gpdb::RelationGetPartitionDesc(Relation rel, bool omit_detached) +{ + GP_WRAP_START; + { + return ::RelationGetPartitionDesc(rel, omit_detached); + } + GP_WRAP_END; + return nullptr; +} + bool gpdb::GetCastFunc(Oid src_oid, Oid dest_oid, bool *is_binary_coercible, Oid *cast_fn_oid, CoercionPathType *pathtype) @@ -1831,20 +1878,6 @@ gpdb::IsChildPartDistributionMismatched(Relation rel) return false; } -void -gpdb::CdbEstimateRelationSize(RelOptInfo *relOptInfo, Relation rel, - int32 *attr_widths, BlockNumber *pages, - double *tuples, double *allvisfrac) -{ - GP_WRAP_START; - { - cdb_estimate_rel_size(relOptInfo, rel, attr_widths, pages, tuples, - allvisfrac); - return; - } - GP_WRAP_END; -} - double gpdb::CdbEstimatePartitionedNumTuples(Relation rel) { @@ -1881,6 +1914,26 @@ gpdb::GetRelationIndexes(Relation relation) return NIL; } +MVNDistinct * +gpdb::GetMVNDistinct(Oid stat_oid) +{ + GP_WRAP_START; + { + return statext_ndistinct_load(stat_oid); + } + GP_WRAP_END; +} + +MVDependencies * +gpdb::GetMVDependencies(Oid stat_oid) +{ + GP_WRAP_START; + { + return statext_dependencies_load(stat_oid, true); + } + GP_WRAP_END; +} + gpdb::RelationWrapper gpdb::GetRelation(Oid rel_oid) { @@ -1967,63 +2020,6 @@ gpdb::IsTextRelatedType(Oid typid) return false; } - -int -gpdb::GetIntFromValue(Node *node) -{ - GP_WRAP_START; - { - return intVal(node); - } - GP_WRAP_END; - return 0; -} - -Uri * -gpdb::ParseExternalTableUri(const char *uri) -{ - GP_WRAP_START; - { - return ::ParseExternalTableUri(uri); - } - GP_WRAP_END; - return nullptr; -} - -CdbComponentDatabases * -gpdb::GetComponentDatabases(void) -{ - GP_WRAP_START; - { - /* catalog tables: gp_segment_config */ - return cdbcomponent_getCdbComponents(); - } - GP_WRAP_END; - return nullptr; -} - -int -gpdb::StrCmpIgnoreCase(const char *s1, const char *s2) -{ - GP_WRAP_START; - { - return pg_strcasecmp(s1, s2); - } - GP_WRAP_END; - return 0; -} - -bool * -gpdb::ConstructRandomSegMap(int total_primaries, int total_to_skip) -{ - GP_WRAP_START; - { - return makeRandomSegMap(total_primaries, total_to_skip); - } - GP_WRAP_END; - return nullptr; -} - StringInfo gpdb::MakeStringInfo(void) { @@ -2145,7 +2141,8 @@ gpdb::HasUpdateTriggers(Oid relid) // get index op family properties void -gpdb::IndexOpProperties(Oid opno, Oid opfamily, int *strategy, Oid *righttype) +gpdb::IndexOpProperties(Oid opno, Oid opfamily, StrategyNumber *strategynumber, + Oid *righttype) { GP_WRAP_START; { @@ -2154,9 +2151,15 @@ gpdb::IndexOpProperties(Oid opno, Oid opfamily, int *strategy, Oid *righttype) // Only the right type is returned to the caller, the left // type is simply ignored. Oid lefttype; + INT strategy; - get_op_opfamily_properties(opno, opfamily, false, strategy, &lefttype, + get_op_opfamily_properties(opno, opfamily, false, &strategy, &lefttype, righttype); + + // Ensure the value of strategy doesn't get truncated when converted to StrategyNumber + GPOS_ASSERT(strategy >= 0 && + strategy <= std::numeric_limits::max()); + *strategynumber = static_cast(strategy); return; } GP_WRAP_END; @@ -2575,26 +2578,6 @@ gpdb::ExpressionReturnsSet(Node *clause) GP_WRAP_END; } -bool -gpdb::RelIsPartitioned(Oid relid) -{ - GP_WRAP_START; - { - return relation_is_partitioned(relid); - } - GP_WRAP_END; -} - -bool -gpdb::IndexIsPartitioned(Oid relid) -{ - GP_WRAP_START; - { - return index_is_partitioned(relid); - } - GP_WRAP_END; -} - List * gpdb::GetRelChildIndexes(Oid reloid) { diff --git a/src/backend/gpopt/gpopt.mk b/src/backend/gpopt/gpopt.mk index 76a45e41920..5f7134eb572 100644 --- a/src/backend/gpopt/gpopt.mk +++ b/src/backend/gpopt/gpopt.mk @@ -2,3 +2,8 @@ override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libgpos/include $(CPPFLA override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libgpopt/include $(CPPFLAGS) override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libnaucrates/include $(CPPFLAGS) override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libgpdbcost/include $(CPPFLAGS) + +# orca is not accessed in JIT (executor stage), avoid the generation of .bc here +# NOTE: accordingly we MUST avoid them in install step (install-postgres-bitcode +# in src/backend/Makefile) +with_llvm = no diff --git a/src/backend/gpopt/relcache/CMDProviderRelcache.cpp b/src/backend/gpopt/relcache/CMDProviderRelcache.cpp index ef187092bf5..5c27f886ba1 100644 --- a/src/backend/gpopt/relcache/CMDProviderRelcache.cpp +++ b/src/backend/gpopt/relcache/CMDProviderRelcache.cpp @@ -27,11 +27,6 @@ using namespace gpos; using namespace gpdxl; using namespace gpmd; -CMDProviderRelcache::CMDProviderRelcache(CMemoryPool *mp) : m_mp(mp) -{ - GPOS_ASSERT(nullptr != m_mp); -} - CWStringBase * CMDProviderRelcache::GetMDObjDXLStr(CMemoryPool *mp, CMDAccessor *md_accessor, IMDId *md_id) const diff --git a/src/backend/gpopt/translate/CContextDXLToPlStmt.cpp b/src/backend/gpopt/translate/CContextDXLToPlStmt.cpp index 21bfc3f6c37..e9ebbf16fc8 100644 --- a/src/backend/gpopt/translate/CContextDXLToPlStmt.cpp +++ b/src/backend/gpopt/translate/CContextDXLToPlStmt.cpp @@ -51,8 +51,6 @@ CContextDXLToPlStmt::CContextDXLToPlStmt( m_param_types_list(NIL), m_distribution_hashops(distribution_hashops), m_rtable_entries_list(nullptr), - m_partitioned_tables_list(nullptr), - m_num_partition_selectors_array(nullptr), m_subplan_entries_list(nullptr), m_subplan_sliceids_list(nullptr), m_slices_list(nullptr), @@ -62,8 +60,8 @@ CContextDXLToPlStmt::CContextDXLToPlStmt( m_part_selector_to_param_map(nullptr) { m_cte_consumer_info = GPOS_NEW(m_mp) HMUlCTEConsumerInfo(m_mp); - m_num_partition_selectors_array = GPOS_NEW(m_mp) ULongPtrArray(m_mp); m_part_selector_to_param_map = GPOS_NEW(m_mp) UlongToUlongMap(m_mp); + m_used_rte_indexes = GPOS_NEW(m_mp) HMUlIndex(m_mp); } //--------------------------------------------------------------------------- @@ -77,8 +75,8 @@ CContextDXLToPlStmt::CContextDXLToPlStmt( CContextDXLToPlStmt::~CContextDXLToPlStmt() { m_cte_consumer_info->Release(); - m_num_partition_selectors_array->Release(); m_part_selector_to_param_map->Release(); + m_used_rte_indexes->Release(); } //--------------------------------------------------------------------------- @@ -227,70 +225,6 @@ CContextDXLToPlStmt::AddRTE(RangeTblEntry *rte, BOOL is_result_relation) } } -//--------------------------------------------------------------------------- -// @function: -// CContextDXLToPlStmt::AddPartitionedTable -// -// @doc: -// Add a partitioned table oid -// -//--------------------------------------------------------------------------- -void -CContextDXLToPlStmt::AddPartitionedTable(OID oid) -{ - if (!gpdb::ListMemberOid(m_partitioned_tables_list, oid)) - { - m_partitioned_tables_list = - gpdb::LAppendOid(m_partitioned_tables_list, oid); - } -} - -//--------------------------------------------------------------------------- -// @function: -// CContextDXLToPlStmt::IncrementPartitionSelectors -// -// @doc: -// Increment the number of partition selectors for the given scan id -// -//--------------------------------------------------------------------------- -void -CContextDXLToPlStmt::IncrementPartitionSelectors(ULONG scan_id) -{ - // add extra elements to the array if necessary - const ULONG len = m_num_partition_selectors_array->Size(); - for (ULONG ul = len; ul <= scan_id; ul++) - { - ULONG *pul = GPOS_NEW(m_mp) ULONG(0); - m_num_partition_selectors_array->Append(pul); - } - - ULONG *ul = (*m_num_partition_selectors_array)[scan_id]; - (*ul)++; -} - -//--------------------------------------------------------------------------- -// @function: -// CContextDXLToPlStmt::GetNumPartitionSelectorsList -// -// @doc: -// Return list containing number of partition selectors for every scan id -// -//--------------------------------------------------------------------------- -List * -CContextDXLToPlStmt::GetNumPartitionSelectorsList() const -{ - List *partition_selectors_list = NIL; - const ULONG len = m_num_partition_selectors_array->Size(); - for (ULONG ul = 0; ul < len; ul++) - { - ULONG *num_partition_selectors = (*m_num_partition_selectors_array)[ul]; - partition_selectors_list = gpdb::LAppendInt(partition_selectors_list, - *num_partition_selectors); - } - - return partition_selectors_list; -} - //--------------------------------------------------------------------------- // @function: // CContextDXLToPlStmt::GetSubplanSliceIdArray @@ -547,4 +481,80 @@ CContextDXLToPlStmt::FindRTE(Oid reloid) } return -1; } + +RangeTblEntry * +CContextDXLToPlStmt::GetRTEByIndex(Index index) +{ + return (RangeTblEntry *) gpdb::ListNth(m_rtable_entries_list, + int(index - 1)); +} + +//--------------------------------------------------------------------------- +// @function: of associated +// CContextDXLToPlStmt::GetRTEIndexByTableDescr +// +// @doc: +// +// For given table descriptor this function returns index of rte in +// m_rtable_entries_list for furhter processing and set a flag that +// rte was processed. +// In case of DML operations there is more than one table descr pointing +// to the result relation and to detect position of already processed rte +// `assigned_query_id_for_target_rel` of table descriptor is used. +//--------------------------------------------------------------------------- +Index +CContextDXLToPlStmt::GetRTEIndexByTableDescr(const CDXLTableDescr *table_descr, + BOOL *is_rte_exists) +{ + *is_rte_exists = false; + + // `assigned_query_id_for_target_rel` is a "tag" of table descriptors, it + // shows id of query structure which contains result relation. If table + // descriptors have the same `assigned_query_id_for_target_rel` - these + // table descriptors point to the same result relation in `ModifyTable` + // operation. It's not zero (0) value (which equal to `UNASSIGNED_QUERYID` + // define) if: user query is a INSERT/UPDATE/DELETE (`ModifyTable` + // operation) and this table descriptor points to the result relation of + // operation, for ex.: + // ```sql + // create table b (i int, j int); + // create table c (i int); + // insert into b(i,j) values (1,2), (2,3), (3,4); + // insert into c(i) values (1), (2); + // delete from b where i in (select i from c); + // ``` + // where `b` is a result relation (table descriptors pointing to it + // will have the same `assigned_query_id_for_target_rel` > 0), and + // `c` is not (all table descriptors which points to `c` will have + // `assigned_query_id_for_target_rel`=0 (equal to `UNASSIGNED_QUERYID`) + ULONG assigned_query_id_for_target_rel = + table_descr->GetAssignedQueryIdForTargetRel(); + if (assigned_query_id_for_target_rel == UNASSIGNED_QUERYID) + { + return gpdb::ListLength(m_rtable_entries_list) + 1; + } + + Index *usedIndex = + m_used_rte_indexes->Find(&assigned_query_id_for_target_rel); + + // `usedIndex` is a non NULL value in next case: table descriptor with + // the same `assigned_query_id_for_target_rel` was processed previously + // (so no need to create a new index for result relation like the relation + // itself) + if (usedIndex) + { + *is_rte_exists = true; + return *usedIndex; + } + + // `assigned_query_id_for_target_rel` of table descriptor which points to + // result relation wasn't previously processed - create a new index. + Index new_index = gpdb::ListLength(m_rtable_entries_list) + 1; + m_used_rte_indexes->Insert(GPOS_NEW(m_mp) + ULONG(assigned_query_id_for_target_rel), + GPOS_NEW(m_mp) Index(new_index)); + + return new_index; +} + // EOF diff --git a/src/backend/gpopt/translate/CContextQueryToDXL.cpp b/src/backend/gpopt/translate/CContextQueryToDXL.cpp index 10a8733917b..ceeabf6ece3 100644 --- a/src/backend/gpopt/translate/CContextQueryToDXL.cpp +++ b/src/backend/gpopt/translate/CContextQueryToDXL.cpp @@ -29,11 +29,19 @@ CContextQueryToDXL::CContextQueryToDXL(CMemoryPool *mp) { // map that stores gpdb att to optimizer col mapping m_colid_counter = GPOS_NEW(mp) CIdGenerator(GPDXL_COL_ID_START); + m_queryid_counter = GPOS_NEW(mp) CIdGenerator(GPDXL_QUERY_ID_START); m_cte_id_counter = GPOS_NEW(mp) CIdGenerator(GPDXL_CTE_ID_START); } CContextQueryToDXL::~CContextQueryToDXL() { + GPOS_DELETE(m_queryid_counter); GPOS_DELETE(m_colid_counter); GPOS_DELETE(m_cte_id_counter); } + +ULONG +CContextQueryToDXL::GetNextQueryId() +{ + return m_queryid_counter->next_id(); +} diff --git a/src/backend/gpopt/translate/CPartPruneStepsBuilder.cpp b/src/backend/gpopt/translate/CPartPruneStepsBuilder.cpp index dd7a40b653c..0508d305fbf 100644 --- a/src/backend/gpopt/translate/CPartPruneStepsBuilder.cpp +++ b/src/backend/gpopt/translate/CPartPruneStepsBuilder.cpp @@ -72,7 +72,7 @@ CPartPruneStepsBuilder::CreatePartPruneInfoForOneLevel(CDXLNode *filterNode) PartitionedRelPruneInfo *pinfo = MakeNode(PartitionedRelPruneInfo); pinfo->rtindex = m_rtindex; - pinfo->nparts = RelationGetPartitionDesc(m_relation, true)->nparts; + pinfo->nparts = gpdb::RelationGetPartitionDesc(m_relation, true)->nparts; pinfo->subpart_map = (int *) palloc(sizeof(int) * pinfo->nparts); pinfo->subplan_map = (int *) palloc(sizeof(int) * pinfo->nparts); @@ -90,7 +90,7 @@ CPartPruneStepsBuilder::CreatePartPruneInfoForOneLevel(CDXLNode *filterNode) { // partition did survive pruning pinfo->subplan_map[i] = part_ptr; - pinfo->relid_map[i] = RelationGetPartitionDesc(m_relation, true)->oids[i]; + pinfo->relid_map[i] = gpdb::RelationGetPartitionDesc(m_relation, true)->oids[i]; pinfo->present_parts = bms_add_member(pinfo->present_parts, i); ++part_ptr; } @@ -118,13 +118,12 @@ CPartPruneStepsBuilder::PartPruneStepFromScalarCmp(CDXLNode *node, int *step_id, Oid opno = CMDIdGPDB::CastMdid(dxlop->MDId())->Oid(); Oid opfamily = RelationGetPartitionKey(m_relation)->partopfamily[0 /* col */]; - // GPDB_12_MERGE_FIXME: This *should* be StrategyNumber, but IndexOpProperties takes an INT - INT strategy; + StrategyNumber strategy_num; Oid righttype = InvalidOid; // extract the strategy (<, >, = etc) of the operator in the scalar cmp // and confirm that it's usable given the partition column's opfamily - gpdb::IndexOpProperties(opno, opfamily, &strategy, &righttype); + gpdb::IndexOpProperties(opno, opfamily, &strategy_num, &righttype); if (InvalidOid == righttype) { @@ -140,7 +139,7 @@ CPartPruneStepsBuilder::PartPruneStepFromScalarCmp(CDXLNode *node, int *step_id, PartitionPruneStepOp *step = MakeNode(PartitionPruneStepOp); step->step.step_id = (*step_id)++; - step->opstrategy = strategy; + step->opstrategy = strategy_num; // Use cmpfns from the partitioned table, since the op was confirmed // to be part of partitioning column opfamily above. diff --git a/src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp b/src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp index 6d9fcbc411d..539a02bf18d 100644 --- a/src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp +++ b/src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp @@ -29,12 +29,9 @@ extern "C" { #include "nodes/primnodes.h" #include "partitioning/partdesc.h" #include "storage/lmgr.h" -#include "utils/partcache.h" -#if 0 -#include "cdb/partitionselection.h" -#endif #include "utils/guc.h" #include "utils/lsyscache.h" +#include "utils/partcache.h" #include "utils/rel.h" #include "utils/typcache.h" #include "utils/uri.h" @@ -197,8 +194,13 @@ CTranslatorDXLToPlStmt::GetPlannedStmtFromDXL(const CDXLNode *dxlnode, // collect oids from rtable List *oids_list = NIL; + // collect unique RTE in FROM Clause + List *oids_list_unique = NIL; + ListCell *lc_rte = nullptr; + RangeTblEntry *pRTEHashFuncCal = nullptr; + ForEach(lc_rte, m_dxl_to_plstmt_context->GetRTableEntriesList()) { RangeTblEntry *pRTE = (RangeTblEntry *) lfirst(lc_rte); @@ -206,9 +208,32 @@ CTranslatorDXLToPlStmt::GetPlannedStmtFromDXL(const CDXLNode *dxlnode, if (pRTE->rtekind == RTE_RELATION) { oids_list = gpdb::LAppendOid(oids_list, pRTE->relid); + if (pRTE->inFromCl || (CMD_INSERT == m_cmd_type)) + { + // If we have only one RTE in the FROM clause, + // then we use it to extract information + // about the distribution policy, which gives info about the + // typeOid used for direct dispatch. This helps to perform + // direct dispatch based on the distribution column type + // inplace of the constant in the filter. + pRTEHashFuncCal = (RangeTblEntry *) lfirst(lc_rte); + + // collecting only unique RTE in FROM clause + oids_list_unique = + list_append_unique_oid(oids_list_unique, pRTE->relid); + } } } + if (gpdb::ListLength(oids_list_unique) > 1) + { + // If we have a scenario with multiple unique RTE + // in "from" clause, then the hash function selection + // based on distribution policy of relation will not work + // and we switch back to selection based on constant type + pRTEHashFuncCal = nullptr; + } + // assemble planned stmt PlannedStmt *planned_stmt = MakeNode(PlannedStmt); planned_stmt->planGen = PLANGEN_OPTIMIZER; @@ -217,11 +242,6 @@ CTranslatorDXLToPlStmt::GetPlannedStmtFromDXL(const CDXLNode *dxlnode, planned_stmt->subplans = m_dxl_to_plstmt_context->GetSubplanEntriesList(); planned_stmt->planTree = plan; -#if 0 - // store partitioned table indexes in planned stmt - planned_stmt->queryPartOids = m_dxl_to_plstmt_context->GetPartitionedTablesList(); - planned_stmt->numSelectorsPerScanId = m_dxl_to_plstmt_context->GetNumPartitionSelectorsList(); -#endif planned_stmt->canSetTag = can_set_tag; planned_stmt->relationOids = oids_list; @@ -246,8 +266,8 @@ CTranslatorDXLToPlStmt::GetPlannedStmtFromDXL(const CDXLNode *dxlnode, if (CMD_SELECT == m_cmd_type && nullptr != dxlnode->GetDXLDirectDispatchInfo()) { - List *direct_dispatch_segids = - TranslateDXLDirectDispatchInfo(dxlnode->GetDXLDirectDispatchInfo()); + List *direct_dispatch_segids = TranslateDXLDirectDispatchInfo( + dxlnode->GetDXLDirectDispatchInfo(), pRTEHashFuncCal); if (direct_dispatch_segids != NIL) { @@ -269,7 +289,7 @@ CTranslatorDXLToPlStmt::GetPlannedStmtFromDXL(const CDXLNode *dxlnode, CDXLPhysicalDML::Cast(dxlnode->GetOperator()); List *direct_dispatch_segids = TranslateDXLDirectDispatchInfo( - phy_dml_dxlop->GetDXLDirectDispatchInfo()); + phy_dml_dxlop->GetDXLDirectDispatchInfo(), pRTEHashFuncCal); if (direct_dispatch_segids != NIL) { topslice->directDispatch.isDirectDispatch = true; @@ -558,10 +578,6 @@ CTranslatorDXLToPlStmt::TranslateDXLTblScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - // we will add the new range table entry as the last element of the range table - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; - const CDXLTableDescr *dxl_table_descr = phy_tbl_scan_dxlop->GetDXLTableDescr(); const IMDRelation *md_rel = @@ -573,11 +589,8 @@ CTranslatorDXLToPlStmt::TranslateDXLTblScan( GPOS_RTL_ASSERT(dxl_table_descr->LockMode() != -1); gpdb::GPDBLockRelationOid(mdid->Oid(), dxl_table_descr->LockMode()); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - dxl_table_descr, index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = + ProcessDXLTblDescr(dxl_table_descr, &base_table_context, ACL_SELECT); // a table scan node must have 2 children: projection list and filter GPOS_ASSERT(2 == tbl_scan_dxlnode->Arity()); @@ -601,6 +614,7 @@ CTranslatorDXLToPlStmt::TranslateDXLTblScan( if (IMDRelation::ErelstorageForeign == md_rel->RetrieveRelStorageType()) { OID oidRel = CMDIdGPDB::CastMdid(md_rel->MDId())->Oid(); + RangeTblEntry *rte = m_dxl_to_plstmt_context->GetRTEByIndex(index); ForeignScan *foreign_scan = gpdb::CreateForeignScan(oidRel, index, qual, targetlist, @@ -728,9 +742,6 @@ CTranslatorDXLToPlStmt::TranslateDXLIndexScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; - const CDXLTableDescr *dxl_table_descr = physical_idx_scan_dxlop->GetDXLTableDescr(); const IMDRelation *md_rel = @@ -742,12 +753,8 @@ CTranslatorDXLToPlStmt::TranslateDXLIndexScan( GPOS_RTL_ASSERT(dxl_table_descr->LockMode() != -1); gpdb::GPDBLockRelationOid(mdid->Oid(), dxl_table_descr->LockMode()); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - physical_idx_scan_dxlop->GetDXLTableDescr(), index, - &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = + ProcessDXLTblDescr(dxl_table_descr, &base_table_context, ACL_SELECT); IndexScan *index_scan = nullptr; index_scan = MakeNode(IndexScan); @@ -881,18 +888,11 @@ CTranslatorDXLToPlStmt::TranslateDXLIndexOnlyScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; - const IMDRelation *md_rel = m_md_accessor->RetrieveRel( physical_idx_scan_dxlop->GetDXLTableDescr()->MDId()); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - physical_idx_scan_dxlop->GetDXLTableDescr(), index, - &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = + ProcessDXLTblDescr(table_desc, &base_table_context, ACL_SELECT); IndexOnlyScan *index_scan = MakeNode(IndexOnlyScan); index_scan->scan.scanrelid = index; @@ -1114,7 +1114,7 @@ CTranslatorDXLToPlStmt::TranslateIndexConditions( } // retrieve index strategy and subtype - INT strategy_num = 0; + StrategyNumber strategy_num; OID index_subtype_oid = InvalidOid; OID cmp_operator_oid = @@ -1128,8 +1128,8 @@ CTranslatorDXLToPlStmt::TranslateIndexConditions( // create index qual index_qual_info_array->Append(GPOS_NEW(m_mp) CIndexQualInfo( - attno, index_cond_expr, original_index_cond_expr, - (StrategyNumber) strategy_num, index_subtype_oid)); + attno, index_cond_expr, original_index_cond_expr, strategy_num, + index_subtype_oid)); } // the index quals much be ordered by attribute number @@ -3116,15 +3116,17 @@ CTranslatorDXLToPlStmt::TranslateDXLSort( const CDXLNode *sort_dxlnode, CDXLTranslateContext *output_context, CDXLTranslationContextArray *ctxt_translation_prev_siblings) { + // Ensure operator of sort_dxlnode exists and is EdxlopPhysicalSort + GPOS_ASSERT(nullptr != sort_dxlnode->GetOperator()); + GPOS_ASSERT(EdxlopPhysicalSort == + sort_dxlnode->GetOperator()->GetDXLOperator()); + // create sort plan node Sort *sort = MakeNode(Sort); Plan *plan = &(sort->plan); plan->plan_node_id = m_dxl_to_plstmt_context->GetNextPlanId(); - CDXLPhysicalSort *sort_dxlop = - CDXLPhysicalSort::Cast(sort_dxlnode->GetOperator()); - // translate operator costs TranslatePlanCosts(sort_dxlnode, plan); @@ -3151,9 +3153,6 @@ CTranslatorDXLToPlStmt::TranslateDXLSort( plan->lefttree = child_plan; - // set sorting info - sort->noduplicates = sort_dxlop->FDiscardDuplicates(); - // translate sorting columns const CDXLNode *sort_col_list_dxl = @@ -3695,16 +3694,9 @@ CTranslatorDXLToPlStmt::TranslateDXLAppend( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - // we will add the new range table entry as the last element of the range table - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + - 1; - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - phy_append_dxlop->GetDXLTableDesc(), index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - m_dxl_to_plstmt_context->AddRTE(rte); + (void) ProcessDXLTblDescr(phy_append_dxlop->GetDXLTableDesc(), + &base_table_context, ACL_SELECT); append->join_prune_paramids = NIL; const ULongPtrArray *selector_ids = phy_append_dxlop->GetSelectorIds(); @@ -4069,16 +4061,8 @@ CTranslatorDXLToPlStmt::TranslateDXLDynTblScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - // add the new range table entry as the last element of the range table - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; - - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - dyn_tbl_scan_dxlop->GetDXLTableDescr(), index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = ProcessDXLTblDescr(dyn_tbl_scan_dxlop->GetDXLTableDescr(), + &base_table_context, ACL_SELECT); // create dynamic scan node DynamicSeqScan *dyn_seq_scan = MakeNode(DynamicSeqScan); @@ -4159,16 +4143,11 @@ CTranslatorDXLToPlStmt::TranslateDXLDynIdxScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; + const CDXLTableDescr *table_desc = dyn_index_scan_dxlop->GetDXLTableDescr(); + const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_desc->MDId()); - const IMDRelation *md_rel = m_md_accessor->RetrieveRel( - dyn_index_scan_dxlop->GetDXLTableDescr()->MDId()); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - dyn_index_scan_dxlop->GetDXLTableDescr(), index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = + ProcessDXLTblDescr(table_desc, &base_table_context, ACL_SELECT); DynamicIndexScan *dyn_idx_scan = MakeNode(DynamicIndexScan); @@ -4347,19 +4326,13 @@ CTranslatorDXLToPlStmt::TranslateDXLDml( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - // add the new range table entry as the last element of the range table + CDXLTableDescr *table_descr = phy_dml_dxlop->GetDXLTableDescr(); + Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; + ProcessDXLTblDescr(table_descr, &base_table_context, acl_mode); m_result_rel_list = gpdb::LAppendInt(m_result_rel_list, index); - CDXLTableDescr *table_descr = phy_dml_dxlop->GetDXLTableDescr(); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - table_descr, index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= acl_mode; - m_dxl_to_plstmt_context->AddRTE(rte, true); - CDXLNode *project_list_dxlnode = (*dml_dxlnode)[0]; CDXLNode *child_dxlnode = (*dml_dxlnode)[1]; @@ -4495,7 +4468,8 @@ CTranslatorDXLToPlStmt::TranslateDXLDml( //--------------------------------------------------------------------------- List * CTranslatorDXLToPlStmt::TranslateDXLDirectDispatchInfo( - CDXLDirectDispatchInfo *dxl_direct_dispatch_info) + CDXLDirectDispatchInfo *dxl_direct_dispatch_info, + RangeTblEntry *pRTEHashFuncCal) { if (!optimizer_enable_direct_dispatch || nullptr == dxl_direct_dispatch_info) @@ -4550,14 +4524,14 @@ CTranslatorDXLToPlStmt::TranslateDXLDirectDispatchInfo( return segids_list; } - ULONG hash_code = GetDXLDatumGPDBHash(dxl_datum_array); + ULONG hash_code = GetDXLDatumGPDBHash(dxl_datum_array, pRTEHashFuncCal); for (ULONG ul = 0; ul < length; ul++) { CDXLDatumArray *dispatch_identifier_datum_array = (*dispatch_identifier_datum_arrays)[ul]; GPOS_ASSERT(0 < dispatch_identifier_datum_array->Size()); - ULONG hash_code_new = - GetDXLDatumGPDBHash(dispatch_identifier_datum_array); + ULONG hash_code_new = GetDXLDatumGPDBHash( + dispatch_identifier_datum_array, pRTEHashFuncCal); if (hash_code != hash_code_new) { @@ -4579,25 +4553,63 @@ CTranslatorDXLToPlStmt::TranslateDXLDirectDispatchInfo( // //--------------------------------------------------------------------------- ULONG -CTranslatorDXLToPlStmt::GetDXLDatumGPDBHash(CDXLDatumArray *dxl_datum_array) +CTranslatorDXLToPlStmt::GetDXLDatumGPDBHash(CDXLDatumArray *dxl_datum_array, + RangeTblEntry *pRTEHashFuncCal) { List *consts_list = NIL; Oid *hashfuncs; const ULONG length = dxl_datum_array->Size(); - hashfuncs = (Oid *) gpdb::GPDBAlloc(length * sizeof(Oid)); + if (pRTEHashFuncCal != nullptr) + { + // If we have one unique RTE in FROM clause, + // then we do direct dispatch based on the distribution policy - for (ULONG ul = 0; ul < length; ul++) + gpdb::RelationWrapper rel = gpdb::GetRelation(pRTEHashFuncCal->relid); + GPOS_ASSERT(rel); + GpPolicy *policy = rel->rd_cdbpolicy; + int policy_nattrs = policy->nattrs; + TupleDesc desc = rel->rd_att; + Oid *opclasses = policy->opclasses; + hashfuncs = (Oid *) gpdb::GPDBAlloc(policy_nattrs * sizeof(Oid)); + + for (int i = 0; i < policy_nattrs; i++) + { + AttrNumber attnum = policy->attrs[i]; + Oid typeoid = desc->attrs[attnum - 1].atttypid; + Oid opfamily; + + opfamily = gpdb::GetOpclassFamily(opclasses[i]); + hashfuncs[i] = gpdb::GetHashProcInOpfamily(opfamily, typeoid); + } + for (ULONG ul = 0; ul < length; ul++) + { + CDXLDatum *datum_dxl = (*dxl_datum_array)[ul]; + Const *const_expr = + (Const *) m_translator_dxl_to_scalar->TranslateDXLDatumToScalar( + datum_dxl); + consts_list = gpdb::LAppend(consts_list, const_expr); + } + } + else { - CDXLDatum *datum_dxl = (*dxl_datum_array)[ul]; + // If we have multiple tables in the "from" clause, + // we calculate hashfunction based on the consttype + + hashfuncs = (Oid *) gpdb::GPDBAlloc(length * sizeof(Oid)); + for (ULONG ul = 0; ul < length; ul++) + { + CDXLDatum *datum_dxl = (*dxl_datum_array)[ul]; - Const *const_expr = - (Const *) m_translator_dxl_to_scalar->TranslateDXLDatumToScalar( - datum_dxl); - consts_list = gpdb::LAppend(consts_list, const_expr); - hashfuncs[ul] = m_dxl_to_plstmt_context->GetDistributionHashFuncForType( - const_expr->consttype); + Const *const_expr = + (Const *) m_translator_dxl_to_scalar->TranslateDXLDatumToScalar( + datum_dxl); + consts_list = gpdb::LAppend(consts_list, const_expr); + hashfuncs[ul] = + m_dxl_to_plstmt_context->GetDistributionHashFuncForType( + const_expr->consttype); + } } ULONG hash = @@ -4766,41 +4778,75 @@ CTranslatorDXLToPlStmt::TranslateDXLAssert( //--------------------------------------------------------------------------- // @function: -// CTranslatorDXLToPlStmt::TranslateDXLTblDescrToRangeTblEntry +// CTranslatorDXLToPlStmt::ProcessDXLTblDescr // // @doc: -// Translates a DXL table descriptor into a range table entry. If an index -// descriptor is provided, we use the mapping from colids to index attnos -// instead of table attnos -// -//--------------------------------------------------------------------------- -RangeTblEntry * -CTranslatorDXLToPlStmt::TranslateDXLTblDescrToRangeTblEntry( - const CDXLTableDescr *table_descr, Index index, - CDXLTranslateContextBaseTable *base_table_context) +// Translates a DXL table descriptor into a range table entry and stores +// it in m_dxl_to_plstmt_context if it's needed (in case of DML operations +// there is more than one table descriptors which point to the result +// relation, so if rte was alredy translated, this rte will be updated and +// index of this rte at m_dxl_to_plstmt_context->m_rtable_entries_list +// (shortened as "rte_list"), will be returned, if the rte wasn't +// translated, the newly created rte will be appended to rte_list and it's +// index returned). Also this function fills base_table_context for the +// mapping from colids to index attnos instead of table attnos. +// Returns index of translated range table entry at the rte_list. +// +//--------------------------------------------------------------------------- +Index +CTranslatorDXLToPlStmt::ProcessDXLTblDescr( + const CDXLTableDescr *table_descr, + CDXLTranslateContextBaseTable *base_table_context, AclMode acl_mode) { GPOS_ASSERT(nullptr != table_descr); + BOOL rte_was_translated = false; + Index index = m_dxl_to_plstmt_context->GetRTEIndexByTableDescr( + table_descr, &rte_was_translated); + const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_descr->MDId()); const ULONG num_of_non_sys_cols = CTranslatorUtils::GetNumNonSystemColumns(md_rel); - RangeTblEntry *rte = MakeNode(RangeTblEntry); - rte->rtekind = RTE_RELATION; - // get oid for table Oid oid = CMDIdGPDB::CastMdid(table_descr->MDId())->Oid(); GPOS_ASSERT(InvalidOid != oid); - rte->relid = oid; - rte->checkAsUser = table_descr->GetExecuteAsUserId(); - rte->requiredPerms |= ACL_NO_RIGHTS; - rte->rellockmode = table_descr->LockMode(); - // save oid and range index in translation context base_table_context->SetOID(oid); base_table_context->SetRelIndex(index); + // save mapping col id -> index in translate context + const ULONG arity = table_descr->Arity(); + for (ULONG ul = 0; ul < arity; ++ul) + { + const CDXLColDescr *dxl_col_descr = table_descr->GetColumnDescrAt(ul); + GPOS_ASSERT(nullptr != dxl_col_descr); + + INT attno = dxl_col_descr->AttrNum(); + GPOS_ASSERT(0 != attno); + + (void) base_table_context->InsertMapping(dxl_col_descr->Id(), attno); + } + + // descriptor was already processed, and translated RTE is stored at + // context rtable list (only update required perms of this rte is needed) + if (rte_was_translated) + { + RangeTblEntry *rte = m_dxl_to_plstmt_context->GetRTEByIndex(index); + GPOS_ASSERT(nullptr != rte); + rte->requiredPerms |= acl_mode; + return index; + } + + // create a new RTE (and it's alias) and store it at context rtable list + RangeTblEntry *rte = MakeNode(RangeTblEntry); + rte->rtekind = RTE_RELATION; + rte->relid = oid; + rte->checkAsUser = table_descr->GetExecuteAsUserId(); + rte->requiredPerms |= acl_mode; + rte->rellockmode = table_descr->LockMode(); + Alias *alias = MakeNode(Alias); alias->colnames = NIL; @@ -4809,19 +4855,12 @@ CTranslatorDXLToPlStmt::TranslateDXLTblDescrToRangeTblEntry( table_descr->MdName()->GetMDName()->GetBuffer()); // get column names - const ULONG arity = table_descr->Arity(); - INT last_attno = 0; - for (ULONG ul = 0; ul < arity; ++ul) { const CDXLColDescr *dxl_col_descr = table_descr->GetColumnDescrAt(ul); - GPOS_ASSERT(nullptr != dxl_col_descr); - INT attno = dxl_col_descr->AttrNum(); - GPOS_ASSERT(0 != attno); - if (0 < attno) { // if attno > last_attno + 1, there were dropped attributes @@ -4843,9 +4882,6 @@ CTranslatorDXLToPlStmt::TranslateDXLTblDescrToRangeTblEntry( alias->colnames = gpdb::LAppend(alias->colnames, val_colname); last_attno = attno; } - - // save mapping col id -> index in translate context - (void) base_table_context->InsertMapping(dxl_col_descr->Id(), attno); } // if there are any dropped columns at the end, add those too to the RangeTblEntry @@ -4857,7 +4893,9 @@ CTranslatorDXLToPlStmt::TranslateDXLTblDescrToRangeTblEntry( rte->eref = alias; - return rte; + m_dxl_to_plstmt_context->AddRTE(rte); + + return index; } //--------------------------------------------------------------------------- @@ -5803,10 +5841,6 @@ CTranslatorDXLToPlStmt::TranslateDXLBitmapTblScan( // translation context for column mappings in the base relation CDXLTranslateContextBaseTable base_table_context(m_mp); - // add the new range table entry as the last element of the range table - Index index = - gpdb::ListLength(m_dxl_to_plstmt_context->GetRTableEntriesList()) + 1; - const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_descr->MDId()); // Lock any table we are to scan, since it may not have been properly locked @@ -5815,12 +5849,8 @@ CTranslatorDXLToPlStmt::TranslateDXLBitmapTblScan( GPOS_RTL_ASSERT(table_descr->LockMode() != -1); gpdb::GPDBLockRelationOid(mdid->Oid(), table_descr->LockMode()); - RangeTblEntry *rte = TranslateDXLTblDescrToRangeTblEntry( - table_descr, index, &base_table_context); - GPOS_ASSERT(nullptr != rte); - rte->requiredPerms |= ACL_SELECT; - - m_dxl_to_plstmt_context->AddRTE(rte); + Index index = + ProcessDXLTblDescr(table_descr, &base_table_context, ACL_SELECT); DynamicBitmapHeapScan *dscan; BitmapHeapScan *bitmap_tbl_scan; diff --git a/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp b/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp index 9720525e517..a51b6df33cf 100644 --- a/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp +++ b/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp @@ -229,16 +229,6 @@ CTranslatorDXLToScalar::TranslateDXLToScalar(const CDXLNode *dxlnode, return TranslateDXLScalarSortGroupClauseToScalar(dxlnode, colid_var); } -#if 0 - // GPDB_12_MERGE_FIXME: These were removed from the server with the v12 merge - // of upstream partitioning. Need something to replace? Need to rip out from GPORCA? - case EdxlopScalarPartDefault: { return TranslateDXLScalarPartDefaultToScalar(dxlnode, colid_var); } - case EdxlopScalarPartBound: { return TranslateDXLScalarPartBoundToScalar(dxlnode, colid_var); } - case EdxlopScalarPartBoundInclusion: { return TranslateDXLScalarPartBoundInclusionToScalar(dxlnode, colid_var); } - case EdxlopScalarPartBoundOpen: { return TranslateDXLScalarPartBoundOpenToScalar(dxlnode, colid_var); } - case EdxlopScalarPartListValues: { return TranslateDXLScalarPartListValuesToScalar(dxlnode, colid_var); } - case EdxlopScalarPartListNullTest: { return TranslateDXLScalarPartListNullTestToScalar(dxlnode, colid_var); } -#endif } } @@ -1551,8 +1541,9 @@ CTranslatorDXLToScalar::TranslateDXLScalarArrayCoerceExprToScalar( FuncExpr *func_expr = MakeNode(FuncExpr); func_expr->funcid = elemfuncid; func_expr->funcformat = COERCE_EXPLICIT_CAST; - // GPDB_12_MERGE_FIXME: shouldn't this come from the DXL as well? - func_expr->funcresulttype = gpdb::GetFuncRetType(elemfuncid); + func_expr->funcresulttype = + CMDIdGPDB::CastMdid(dxlop->GetResultTypeMdId())->Oid(); + // FIXME: this is a giant hack. We really should know the arity of the // function we're calling. Instead, we're jamming three arguments, // _always_ @@ -2110,10 +2101,6 @@ CTranslatorDXLToScalar::TranslateDXLScalarValuesListToScalar( return (Expr *) values; } -// -// GPDB_12_MERGE_FIXME: ArrayRef was renamed in commit 558d77f20e4e9. -// I've fixed the renamed type and fields but the wording "ArrayRef" is -// still everywhere. Do we plan to rename them? //--------------------------------------------------------------------------- // @function: diff --git a/src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp b/src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp index 3b57174e2ee..cc006fd15ea 100644 --- a/src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp +++ b/src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp @@ -144,6 +144,8 @@ CTranslatorQueryToDXL::CTranslatorQueryToDXL( GPOS_ASSERT(nullptr != query); CheckSupportedCmdType(query); + m_query_id = m_context->GetNextQueryId(); + CheckRangeTable(query); // GPDB_94_MERGE_FIXME: WITH CHECK OPTION views are not supported yet. @@ -529,6 +531,23 @@ CTranslatorQueryToDXL::TranslateSelectQueryToDXL() // We therefore need to check permissions before we go into optimization for all RTEs, including the ones not explicitly referred in the query, e.g. views. CTranslatorUtils::CheckRTEPermissions(m_query->rtable); + if (m_query->hasForUpdate) + { + int rt_len = gpdb::ListLength(m_query->rtable); + for (int i = 0; i < rt_len; i++) + { + const RangeTblEntry *rte = + (RangeTblEntry *) gpdb::ListNth(m_query->rtable, i); + + if (rte->relkind == 'f' && rte->rellockmode == ExclusiveLock) + { + GPOS_RAISE(gpdxl::ExmaDXL, + gpdxl::ExmiQuery2DXLUnsupportedFeature, + GPOS_WSZ_LIT("Locking clause on foreign table")); + } + } + } + // RETURNING is not supported yet. if (m_query->returningList) { @@ -764,8 +783,9 @@ CTranslatorQueryToDXL::TranslateInsertQueryToDXL() GPOS_WSZ_LIT("Inserts with foreign tables")); } CDXLTableDescr *table_descr = CTranslatorUtils::GetTableDescr( - m_mp, m_md_accessor, m_context->m_colid_counter, rte, + m_mp, m_md_accessor, m_context->m_colid_counter, rte, m_query_id, &m_context->m_has_distributed_tables); + const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_descr->MDId()); BOOL rel_has_constraints = CTranslatorUtils::RelHasConstraints(md_rel); @@ -1195,8 +1215,9 @@ CTranslatorQueryToDXL::TranslateDeleteQueryToDXL() GPOS_WSZ_LIT("Deletes with foreign tables")); } CDXLTableDescr *table_descr = CTranslatorUtils::GetTableDescr( - m_mp, m_md_accessor, m_context->m_colid_counter, rte, + m_mp, m_md_accessor, m_context->m_colid_counter, rte, m_query_id, &m_context->m_has_distributed_tables); + const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_descr->MDId()); // CBDB_MERGE_FIXME: Support DML operations on partitioned tables @@ -1268,8 +1289,9 @@ CTranslatorQueryToDXL::TranslateUpdateQueryToDXL() GPOS_WSZ_LIT("Updates with foreign tables")); } CDXLTableDescr *table_descr = CTranslatorUtils::GetTableDescr( - m_mp, m_md_accessor, m_context->m_colid_counter, rte, + m_mp, m_md_accessor, m_context->m_colid_counter, rte, m_query_id, &m_context->m_has_distributed_tables); + const IMDRelation *md_rel = m_md_accessor->RetrieveRel(table_descr->MDId()); if (!optimizer_enable_dml_constraints && @@ -3320,6 +3342,7 @@ CTranslatorQueryToDXL::UnsupportedRTEKind(RTEKind rtekind) GPOS_WSZ_LIT("RangeTableEntry of type Void")); } case RTE_TABLEFUNCTION: + case RTE_TABLEFUNC: { GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiQuery2DXLUnsupportedFeature, GPOS_WSZ_LIT("RangeTableEntry of type Table Function")); @@ -3350,10 +3373,20 @@ CTranslatorQueryToDXL::TranslateRTEToDXLLogicalGet(const RangeTblEntry *rte, GPOS_WSZ_LIT("ONLY in the FROM clause")); } + // query_id_for_target_rel is used to tag table descriptors assigned to target + // (result) relations one. In case of possible nested DML subqueries it's + // field points to target relation of corresponding Query structure of subquery. + ULONG query_id_for_target_rel = UNASSIGNED_QUERYID; + if (m_query->resultRelation > 0 && + ULONG(m_query->resultRelation) == rt_index) + { + query_id_for_target_rel = m_query_id; + } + // construct table descriptor for the scan node from the range table entry CDXLTableDescr *dxl_table_descr = CTranslatorUtils::GetTableDescr( m_mp, m_md_accessor, m_context->m_colid_counter, rte, - &m_context->m_has_distributed_tables); + query_id_for_target_rel, &m_context->m_has_distributed_tables); CDXLLogicalGet *dxl_op = nullptr; const IMDRelation *md_rel = @@ -4194,17 +4227,19 @@ CTranslatorQueryToDXL::TranslateTargetListToDXLProject( GPOS_WSZ_LIT("Grouping function with outer references")); } } - else if (!is_groupby || (is_groupby && is_grouping_col)) + else if (!is_groupby || is_grouping_col) { // Insist projection for any outer refs to ensure any decorelation of a // subquery results in a correct plan using the projected reference, // instead of the outer ref directly. // TODO: Remove is_grouping_col from this check once const projections in // subqueries no longer prevent decorrelation + BOOL is_orderby_col = CTranslatorUtils::IsSortingColumn( + target_entry, m_query->sortClause); BOOL insist_proj = - (IsA(target_entry->expr, Var) && - ((Var *) (target_entry->expr))->varlevelsup > 0 && - !is_grouping_col); + IsA(target_entry->expr, Var) && + ((Var *) (target_entry->expr))->varlevelsup > 0 && + !is_orderby_col && !is_grouping_col; CDXLNode *project_elem_dxlnode = TranslateExprToDXLProject( target_entry->expr, target_entry->resname, insist_proj /* insist_new_colids */); diff --git a/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp b/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp index 4c4c42ecf70..4eecea5cea6 100644 --- a/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp +++ b/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp @@ -24,6 +24,7 @@ extern "C" { #include "catalog/pg_am.h" #include "catalog/pg_proc.h" #include "catalog/pg_statistic.h" +#include "catalog/pg_statistic_ext.h" #include "cdb/cdbhash.h" #include "partitioning/partdesc.h" #include "utils/array.h" @@ -54,6 +55,8 @@ extern "C" { #include "naucrates/dxl/xml/dxltokens.h" #include "naucrates/exception.h" #include "naucrates/md/CDXLColStats.h" +#include "naucrates/md/CDXLExtStats.h" +#include "naucrates/md/CDXLExtStatsInfo.h" #include "naucrates/md/CDXLRelStats.h" #include "naucrates/md/CMDArrayCoerceCastGPDB.h" #include "naucrates/md/CMDCastGPDB.h" @@ -134,6 +137,14 @@ CTranslatorRelcacheToDXL::RetrieveObject(CMemoryPool *mp, md_obj = RetrieveCheckConstraints(mp, md_accessor, mdid); break; + case IMDId::EmdidExtStats: + md_obj = RetrieveExtStats(mp, mdid); + break; + + case IMDId::EmdidExtStatsInfo: + md_obj = RetrieveExtStatsInfo(mp, mdid); + break; + default: break; } @@ -307,15 +318,163 @@ CTranslatorRelcacheToDXL::RetrieveRelCheckConstraints(CMemoryPool *mp, OID oid) // //--------------------------------------------------------------------------- void -CTranslatorRelcacheToDXL::CheckUnsupportedRelation(OID rel_oid) +CTranslatorRelcacheToDXL::CheckUnsupportedRelation(Relation rel) { - if (!gpdb::RelIsPartitioned(rel_oid) && gpdb::HasSubclassSlow(rel_oid)) + if (!gpdb::RelationGetPartitionDesc(rel, true) && gpdb::HasSubclassSlow(rel->rd_id)) { GPOS_RAISE(gpdxl::ExmaMD, gpdxl::ExmiMDObjUnsupported, GPOS_WSZ_LIT("Inherited tables")); } } +//--------------------------------------------------------------------------- +// @function: +// CTranslatorRelcacheToDXL::RetrieveExtStats +// +// @doc: +// Retrieve extended statistics from relcache +// +//--------------------------------------------------------------------------- +IMDCacheObject * +CTranslatorRelcacheToDXL::RetrieveExtStats(CMemoryPool *mp, IMDId *mdid) +{ + OID stat_oid = CMDIdGPDB::CastMdid(mdid)->Oid(); + List *kinds = gpdb::GetExtStatsKinds(stat_oid); + + CMDDependencyArray *deps = GPOS_NEW(mp) CMDDependencyArray(mp); + if (list_member_int(kinds, STATS_EXT_DEPENDENCIES)) + { + MVDependencies *dependencies = gpdb::GetMVDependencies(stat_oid); + // dependencies can be null after analyzed. + if (dependencies) { + + for (ULONG i = 0; i < dependencies->ndeps; i++) + { + MVDependency *dep = dependencies->deps[i]; + + // Note: MVDependency->attributes's last index is the dependent "to" + // column. + IntPtrArray *from_attnos = GPOS_NEW(mp) IntPtrArray(mp); + for (INT j = 0; j < dep->nattributes - 1; j++) + { + from_attnos->Append(GPOS_NEW(mp) INT(dep->attributes[j])); + } + deps->Append(GPOS_NEW(mp) CMDDependency( + mp, dep->degree, from_attnos, + dep->attributes[dep->nattributes - 1])); + } + } + } + + CMDNDistinctArray *md_ndistincts = GPOS_NEW(mp) CMDNDistinctArray(mp); + if (list_member_int(kinds, STATS_EXT_NDISTINCT)) + { + MVNDistinct *ndistinct = gpdb::GetMVNDistinct(stat_oid); + + for (ULONG i = 0; i < ndistinct->nitems; i++) + { + MVNDistinctItem item = ndistinct->items[i]; + + CBitSet *attnos = GPOS_NEW(mp) CBitSet(mp); + + for (int item_idx = 0; item_idx < item.nattributes; item_idx++) { + attnos->ExchangeSet(item.attributes[item_idx]); + } + + md_ndistincts->Append(GPOS_NEW(mp) + CMDNDistinct(mp, item.ndistinct, attnos)); + } + } + + const CWStringConst *statname = + GPOS_NEW(mp) CWStringConst(CDXLUtils::CreateDynamicStringFromCharArray( + mp, gpdb::GetExtStatsName(stat_oid)) + ->GetBuffer()); + CMDName *mdname = GPOS_NEW(mp) CMDName(mp, statname); + + return GPOS_NEW(mp) CDXLExtStats(mp, mdid, mdname, deps, md_ndistincts); +} + +//--------------------------------------------------------------------------- +// @function: +// CTranslatorRelcacheToDXL::RetrieveExtStats +// +// @doc: +// Retrieve extended statistics metadata from relcache +// +//--------------------------------------------------------------------------- +IMDCacheObject * +CTranslatorRelcacheToDXL::RetrieveExtStatsInfo(CMemoryPool *mp, IMDId *mdid) +{ + OID rel_oid = CMDIdGPDB::CastMdid(mdid)->Oid(); + + CMDExtStatsInfoArray *extstats_info_array = + GPOS_NEW(mp) CMDExtStatsInfoArray(mp); + + gpdb::RelationWrapper rel = gpdb::GetRelation(rel_oid); + List *extstats = gpdb::GetExtStats(rel.get()); + + ListCell *lc = nullptr; + ForEach(lc, extstats) + { + StatisticExtInfo *info = (StatisticExtInfo *) lfirst(lc); + + CBitSet *keys = GPOS_NEW(mp) CBitSet(mp); + + int attno = -1; + while ((attno = bms_next_member(info->keys, attno)) >= 0) + { + keys->ExchangeSet(attno); + } + + CMDExtStatsInfo::Estattype statkind = CMDExtStatsInfo::EstatSentinel; + switch (info->kind) + { + case STATS_EXT_DEPENDENCIES: + { + statkind = CMDExtStatsInfo::EstatDependencies; + break; + } + case STATS_EXT_NDISTINCT: + { + statkind = CMDExtStatsInfo::EstatNDistinct; + break; + } + case STATS_EXT_MCV: + { + statkind = CMDExtStatsInfo::EstatMCV; + break; + } + case STATS_EXT_EXPRESSIONS: + { + statkind = CMDExtStatsInfo::EstatExpr; + break; + } + default: + { + GPOS_ASSERT(false && "Unknown extended stat type"); + } + } + + // CBDB_MERGE_FIXME: support expr ext stats in the feature + if (statkind == CMDExtStatsInfo::EstatExpr) { + continue; + } + + const CWStringConst *statname = GPOS_NEW(mp) + CWStringConst(CDXLUtils::CreateDynamicStringFromCharArray( + mp, gpdb::GetExtStatsName(info->statOid)) + ->GetBuffer()); + CMDName *mdname = GPOS_NEW(mp) CMDName(mp, statname); + + extstats_info_array->Append(GPOS_NEW(mp) CMDExtStatsInfo( + mp, info->statOid, mdname, statkind, keys)); + } + + return GPOS_NEW(mp) CDXLExtStatsInfo(mp, mdid, GetRelName(mp, rel.get()), + extstats_info_array); +} + //--------------------------------------------------------------------------- // @function: // CTranslatorRelcacheToDXL::RetrieveRel @@ -331,8 +490,6 @@ CTranslatorRelcacheToDXL::RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, OID oid = CMDIdGPDB::CastMdid(mdid)->Oid(); GPOS_ASSERT(InvalidOid != oid); - CheckUnsupportedRelation(oid); - gpdb::RelationWrapper rel = gpdb::GetRelation(oid); if (!rel) @@ -341,6 +498,8 @@ CTranslatorRelcacheToDXL::RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, mdid->GetBuffer()); } + CheckUnsupportedRelation(rel.get()); + if (nullptr != rel->rd_cdbpolicy && POLICYTYPE_ENTRY != rel->rd_cdbpolicy->ptype && gpdb::GetGPSegmentCount() != rel->rd_cdbpolicy->numsegments) @@ -360,7 +519,6 @@ CTranslatorRelcacheToDXL::RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, CMDIndexInfoArray *md_index_info_array = nullptr; ULongPtrArray *part_keys = nullptr; CharPtrArray *part_types = nullptr; - ULONG num_leaf_partitions = 0; BOOL convert_hash_to_random = false; ULongPtr2dArray *keyset_array = nullptr; IMdIdArray *check_constraint_mdids = nullptr; @@ -406,19 +564,18 @@ CTranslatorRelcacheToDXL::RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, is_partitioned = (nullptr != part_keys && 0 < part_keys->Size()); // get number of leaf partitions - if (gpdb::RelIsPartitioned(oid)) + PartitionDesc part_desc = gpdb::RelationGetPartitionDesc(rel.get(), true); + if (part_desc) { - // FIXME_GPDB_12_MERGE_FIXME: misestimate (most likely underestimate) the number of leaf partitions - // ORCA doesn't really care, except to determine whether to sort before inserting - num_leaf_partitions = RelationGetPartitionDesc(rel.get(), true)->nparts; partition_oids = GPOS_NEW(mp) IMdIdArray(mp); - for (int i = 0; i < RelationGetPartitionDesc(rel.get(), true)->nparts; ++i) + for (int i = 0; i < part_desc->nparts; ++i) { - Oid oid = RelationGetPartitionDesc(rel.get(), true)->oids[i]; + Oid oid = part_desc->oids[i]; partition_oids->Append(GPOS_NEW(mp) CMDIdGPDB(IMDId::EmdidRel, oid)); - if (gpdb::RelIsPartitioned(oid)) + gpdb::RelationWrapper rel_part = gpdb::GetRelation(oid); + if (gpdb::RelationGetPartitionDesc(rel_part.get(), true)) { // Multi-level partitioned tables are unsupported - fall back GPOS_RAISE(gpdxl::ExmaMD, gpdxl::ExmiMDObjUnsupported, @@ -453,10 +610,9 @@ CTranslatorRelcacheToDXL::RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, md_rel = GPOS_NEW(mp) CMDRelationGPDB( mp, mdid, mdname, is_temporary, rel_storage_type, dist, mdcol_array, - distr_cols, distr_op_families, part_keys, part_types, - num_leaf_partitions, partition_oids, convert_hash_to_random, - keyset_array, md_index_info_array, check_constraint_mdids, - mdpart_constraint); + distr_cols, distr_op_families, part_keys, part_types, partition_oids, + convert_hash_to_random, keyset_array, md_index_info_array, + check_constraint_mdids, mdpart_constraint); return md_rel; } @@ -850,7 +1006,7 @@ CTranslatorRelcacheToDXL::RetrieveIndex(CMemoryPool *mp, // get child indexes IMdIdArray *child_index_oids = nullptr; - if (gpdb::IndexIsPartitioned(index_oid)) + if (index_rel->rd_rel->relkind == RELKIND_PARTITIONED_INDEX) { index_partitioned = true; child_index_oids = RetrieveIndexPartitions(mp, index_oid); @@ -860,51 +1016,15 @@ CTranslatorRelcacheToDXL::RetrieveIndex(CMemoryPool *mp, child_index_oids = GPOS_NEW(mp) IMdIdArray(mp); } - CMDIndexGPDB *index = GPOS_NEW(mp) CMDIndexGPDB( - mp, mdid_index, mdname, index_clustered, index_partitioned, index_type, - mdid_item_type, index_key_cols_array, included_cols, op_families_mdids, - nullptr, // mdpart_constraint - child_index_oids); + CMDIndexGPDB *index = GPOS_NEW(mp) + CMDIndexGPDB(mp, mdid_index, mdname, index_clustered, index_partitioned, + index_type, mdid_item_type, index_key_cols_array, + included_cols, op_families_mdids, child_index_oids); GPOS_DELETE_ARRAY(attno_mapping); return index; } -#if 0 -//--------------------------------------------------------------------------- -// @function: -// CTranslatorRelcacheToDXL::LevelHasDefaultPartition -// -// @doc: -// Check whether the default partition at level one is included -// -//--------------------------------------------------------------------------- -BOOL -CTranslatorRelcacheToDXL::LevelHasDefaultPartition - ( - List *default_levels, - ULONG level - ) -{ - if (NIL == default_levels) - { - return false; - } - - ListCell *lc = NULL; - ForEach (lc, default_levels) - { - ULONG default_level = (ULONG) lfirst_int(lc); - if (level == default_level) - { - return true; - } - } - - return false; -} -#endif - //--------------------------------------------------------------------------- // @function: // CTranslatorRelcacheToDXL::ComputeIncludedCols @@ -1462,13 +1582,17 @@ CTranslatorRelcacheToDXL::RetrieveCheckConstraints(CMemoryPool *mp, for (ULONG ul = 0; ul < length; ul++) { const IMDColumn *md_col = md_rel->GetMdCol(ul); + + if (md_col->IsDropped()) + { + continue; + } + CMDName *md_colname = GPOS_NEW(mp) CMDName(mp, md_col->Mdname().GetMDName()); CMDIdGPDB *mdid_col_type = CMDIdGPDB::CastMdid(md_col->MdidType()); mdid_col_type->AddRef(); - // GPDB_12_MERGE_FIXME: Skip dropped columns similar to RetrievePartConstraintForRel() - // create a column descriptor for the column CDXLColDescr *dxl_col_descr = GPOS_NEW(mp) CDXLColDescr( md_colname, ul + 1 /*colid*/, md_col->AttrNum(), mdid_col_type, @@ -2349,6 +2473,13 @@ CTranslatorRelcacheToDXL::RetrieveRelStorageType(Relation rel) } else if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE) { + if (!optimizer_enable_foreign_table) + { + GPOS_RAISE( + gpdxl::ExmaMD, gpdxl::ExmiMDObjUnsupported, + GPOS_WSZ_LIT( + "Use optimizer_enable_foreign_table to enable Orca with foreign tables")); + } rel_storage_type = IMDRelation::ErelstorageForeign; } else @@ -2383,7 +2514,7 @@ CTranslatorRelcacheToDXL::RetrievePartKeysAndTypes(CMemoryPool *mp, GPOS_ASSERT(nullptr != rel); // FIXME: isn't it faster to check rel.rd_partkey? - if (!gpdb::RelIsPartitioned(oid)) + if (!rel->rd_partdesc) { // not a partitioned table *part_keys = nullptr; @@ -2889,13 +3020,13 @@ CTranslatorRelcacheToDXL::RetrieveStorageTypeForPartitionedTable(Relation rel) // causes gporca generate another query plan. The problem is that the CWorkerPoolManager // holds a static worker pointer, executing gporca nestly is not supported now. // See CWorkerPoolManager::RegisterWorker() - if (RelationGetPartitionDesc(rel, true)->nparts == 0) + if (gpdb::RelationGetPartitionDesc(rel, true)->nparts == 0) { return IMDRelation::ErelstorageHeap; } - for (int i = 0; i < RelationGetPartitionDesc(rel, true)->nparts; ++i) + for (int i = 0; i < gpdb::RelationGetPartitionDesc(rel, true)->nparts; ++i) { - Oid oid = RelationGetPartitionDesc(rel, true)->oids[i]; + Oid oid = gpdb::RelationGetPartitionDesc(rel, true)->oids[i]; gpdb::RelationWrapper child_rel = gpdb::GetRelation(oid); IMDRelation::Erelstoragetype child_storage = RetrieveRelStorageType(child_rel.get()); diff --git a/src/backend/gpopt/translate/CTranslatorUtils.cpp b/src/backend/gpopt/translate/CTranslatorUtils.cpp index de94567aeb7..27390eb5e4b 100644 --- a/src/backend/gpopt/translate/CTranslatorUtils.cpp +++ b/src/backend/gpopt/translate/CTranslatorUtils.cpp @@ -114,21 +114,13 @@ CDXLTableDescr * CTranslatorUtils::GetTableDescr(CMemoryPool *mp, CMDAccessor *md_accessor, CIdGenerator *id_generator, const RangeTblEntry *rte, + ULONG assigned_query_id_for_target_rel, BOOL *is_distributed_table // output ) { // generate an MDId for the table desc. OID rel_oid = rte->relid; -#if 0 - if (gpdb::HasExternalPartition(rel_oid)) - { - // fall back to the planner for queries with partition tables that has an external table in one of its leaf - // partitions. - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiQuery2DXLUnsupportedFeature, GPOS_WSZ_LIT("Query over external partitions")); - } -#endif - CMDIdGPDB *mdid = GPOS_NEW(mp) CMDIdGPDB(IMDId::EmdidRel, rel_oid); const IMDRelation *rel = md_accessor->RetrieveRel(mdid); @@ -137,8 +129,9 @@ CTranslatorUtils::GetTableDescr(CMemoryPool *mp, CMDAccessor *md_accessor, const CWStringConst *tablename = rel->Mdname().GetMDName(); CMDName *table_mdname = GPOS_NEW(mp) CMDName(mp, tablename); - CDXLTableDescr *table_descr = GPOS_NEW(mp) CDXLTableDescr( - mp, mdid, table_mdname, rte->checkAsUser, rte->rellockmode); + CDXLTableDescr *table_descr = GPOS_NEW(mp) + CDXLTableDescr(mp, mdid, table_mdname, rte->checkAsUser, + rte->rellockmode, assigned_query_id_for_target_rel); const ULONG len = rel->ColumnCount(); diff --git a/src/backend/gpopt/utils/COptTasks.cpp b/src/backend/gpopt/utils/COptTasks.cpp index 9d3e8e9e6c4..a0a7a95efc5 100644 --- a/src/backend/gpopt/utils/COptTasks.cpp +++ b/src/backend/gpopt/utils/COptTasks.cpp @@ -526,7 +526,7 @@ COptTasks::OptimizeTask(void *ptr) // set up relcache MD provider CMDProviderRelcache *relcache_provider = - GPOS_NEW(mp) CMDProviderRelcache(mp); + GPOS_NEW(mp) CMDProviderRelcache(); { // scope for MD accessor diff --git a/src/backend/gporca/concourse/xerces-c/build_xerces.py b/src/backend/gporca/concourse/xerces-c/build_xerces.py index 7a4fbd10012..8b49e13ac2a 100644 --- a/src/backend/gporca/concourse/xerces-c/build_xerces.py +++ b/src/backend/gporca/concourse/xerces-c/build_xerces.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import optparse import os @@ -6,7 +6,7 @@ import subprocess import sys import tarfile -import urllib2 +import urllib.request, urllib.error, urllib.parse import hashlib XERCES_SOURCE_URL = "http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.gz" @@ -29,8 +29,8 @@ def num_cpus(): return 2 def get_xerces_source(): - remote_src = urllib2.urlopen(XERCES_SOURCE_URL) - local_src = open("xerces_src.tar.gz", "w") + remote_src = urllib.request.urlopen(XERCES_SOURCE_URL) + local_src = open("xerces_src.tar.gz", "wb") local_src.write(remote_src.read()) local_src.close() file_hash = hashlib.sha256(open('xerces_src.tar.gz','rb').read()).hexdigest() @@ -73,7 +73,7 @@ def main(): parser.add_option("--output_dir", dest="output_dir", default="install") (options, args) = parser.parse_args() if len(args) > 0: - print "Unknown arguments" + print("Unknown arguments") return 1 status = get_xerces_source() if status: diff --git a/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTables.mdp b/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTables.mdp index bdc8283e74c..af3eea3a19e 100644 --- a/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTables.mdp +++ b/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTables.mdp @@ -945,7 +945,7 @@ - + @@ -982,7 +982,7 @@ - + @@ -1019,7 +1019,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTablesNoMotion.mdp b/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTablesNoMotion.mdp index 06002ee143a..c117d1aa314 100644 --- a/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTablesNoMotion.mdp +++ b/src/backend/gporca/data/dxl/minidump/3WayJoinOnMultiDistributionColumnsTablesNoMotion.mdp @@ -941,7 +941,7 @@ t1.a = t2.a and t2.a = t3.a and t1.b = t3.b and t2.b = t3.b; - + @@ -978,7 +978,7 @@ t1.a = t2.a and t2.a = t3.a and t1.b = t3.b and t2.b = t3.b; - + @@ -1015,7 +1015,7 @@ t1.a = t2.a and t2.a = t3.a and t1.b = t3.b and t2.b = t3.b; - + diff --git a/src/backend/gporca/data/dxl/minidump/3WayJoinUsingOperatorsOfNonDefaultOpfamily.mdp b/src/backend/gporca/data/dxl/minidump/3WayJoinUsingOperatorsOfNonDefaultOpfamily.mdp index cf1363b5822..860feb59061 100644 --- a/src/backend/gporca/data/dxl/minidump/3WayJoinUsingOperatorsOfNonDefaultOpfamily.mdp +++ b/src/backend/gporca/data/dxl/minidump/3WayJoinUsingOperatorsOfNonDefaultOpfamily.mdp @@ -118,7 +118,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -287,7 +287,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/4WayJoinInferredPredsRemovedWith2Motion.mdp b/src/backend/gporca/data/dxl/minidump/4WayJoinInferredPredsRemovedWith2Motion.mdp index a48607e6f09..4ea03441315 100644 --- a/src/backend/gporca/data/dxl/minidump/4WayJoinInferredPredsRemovedWith2Motion.mdp +++ b/src/backend/gporca/data/dxl/minidump/4WayJoinInferredPredsRemovedWith2Motion.mdp @@ -55,7 +55,7 @@ explain select * from cs catalog_sales, it item, sr store_returns, ss store_sale - + @@ -92,7 +92,7 @@ explain select * from cs catalog_sales, it item, sr store_returns, ss store_sale - + @@ -129,7 +129,7 @@ explain select * from cs catalog_sales, it item, sr store_returns, ss store_sale - + @@ -163,7 +163,7 @@ explain select * from cs catalog_sales, it item, sr store_returns, ss store_sale - + diff --git a/src/backend/gporca/data/dxl/minidump/AddPredsInSubqueries.mdp b/src/backend/gporca/data/dxl/minidump/AddPredsInSubqueries.mdp index c5eabc235e7..352899de163 100644 --- a/src/backend/gporca/data/dxl/minidump/AddPredsInSubqueries.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddPredsInSubqueries.mdp @@ -32,7 +32,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-1.mdp b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-1.mdp index 444743d8f69..89d3b8fd67d 100644 --- a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-1.mdp @@ -46,7 +46,7 @@ - + @@ -170,7 +170,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-2.mdp b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-2.mdp index 52fa57d0b97..1b003f75b7a 100644 --- a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-2.mdp @@ -59,7 +59,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-3.mdp b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-3.mdp index 3468f9588ad..e0421bf05a8 100644 --- a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-3.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-3.mdp @@ -53,7 +53,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -263,7 +263,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-4.mdp b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-4.mdp index 88666927c85..2408c179603 100644 --- a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-4.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-4.mdp @@ -69,7 +69,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -280,7 +280,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-5.mdp b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-5.mdp index 9e22be3cee6..70fbded2257 100644 --- a/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-5.mdp +++ b/src/backend/gporca/data/dxl/minidump/AddRedistributeBeforeInsert-5.mdp @@ -141,7 +141,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AggSubqCollapseFalseFilter.mdp b/src/backend/gporca/data/dxl/minidump/AggSubqCollapseFalseFilter.mdp index 224c101418b..20b680d2d5d 100644 --- a/src/backend/gporca/data/dxl/minidump/AggSubqCollapseFalseFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/AggSubqCollapseFalseFilter.mdp @@ -130,7 +130,7 @@ - + @@ -177,7 +177,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -381,7 +381,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -534,7 +534,7 @@ - + @@ -585,7 +585,7 @@ - + @@ -636,7 +636,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AggWithVolatileFunc.mdp b/src/backend/gporca/data/dxl/minidump/AggWithVolatileFunc.mdp index 19cc62df3f0..6b7bd231dc6 100644 --- a/src/backend/gporca/data/dxl/minidump/AggWithVolatileFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/AggWithVolatileFunc.mdp @@ -202,7 +202,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AggregateWithSkew.mdp b/src/backend/gporca/data/dxl/minidump/AggregateWithSkew.mdp index 9a444648807..a9a492c9ad5 100644 --- a/src/backend/gporca/data/dxl/minidump/AggregateWithSkew.mdp +++ b/src/backend/gporca/data/dxl/minidump/AggregateWithSkew.mdp @@ -52,7 +52,7 @@ group by b; - + diff --git a/src/backend/gporca/data/dxl/minidump/AggregatesConstraintDeriveNegation.mdp b/src/backend/gporca/data/dxl/minidump/AggregatesConstraintDeriveNegation.mdp index af78091bd3d..58874589f05 100644 --- a/src/backend/gporca/data/dxl/minidump/AggregatesConstraintDeriveNegation.mdp +++ b/src/backend/gporca/data/dxl/minidump/AggregatesConstraintDeriveNegation.mdp @@ -30,7 +30,7 @@ explain select distinct a from t1 where a is not null and not (a = b); - + diff --git a/src/backend/gporca/data/dxl/minidump/AllSubqueryWithSubqueryInScalar.mdp b/src/backend/gporca/data/dxl/minidump/AllSubqueryWithSubqueryInScalar.mdp index 1e7cb73d6b0..ab7e3694597 100644 --- a/src/backend/gporca/data/dxl/minidump/AllSubqueryWithSubqueryInScalar.mdp +++ b/src/backend/gporca/data/dxl/minidump/AllSubqueryWithSubqueryInScalar.mdp @@ -40,7 +40,7 @@ - + @@ -71,7 +71,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnyPredicate-Over-UnionOfConsts.mdp b/src/backend/gporca/data/dxl/minidump/AnyPredicate-Over-UnionOfConsts.mdp index ffcd4f45869..9ab73214f67 100644 --- a/src/backend/gporca/data/dxl/minidump/AnyPredicate-Over-UnionOfConsts.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnyPredicate-Over-UnionOfConsts.mdp @@ -167,10 +167,10 @@ - + - + @@ -195,7 +195,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -299,111 +299,125 @@ - + - + - + - - + - + + + + - + + - + - - - - - - - - - + - + - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + - + - + + + + + + + + - + - - + + + + + + + + + + + + + + - - - + + + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-1.mdp b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-1.mdp index ef5be5f2701..16e16faad65 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-1.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -468,7 +468,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-2.mdp b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-2.mdp index 2ecbd77a0c8..4d380ce87a3 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-2.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -448,7 +448,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-3.mdp b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-3.mdp index ce31c9bcd61..1306f859df0 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-3.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubq-With-NonScalarSubqueryChild-3.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -417,7 +417,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithAllSubqueryInScalar.mdp b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithAllSubqueryInScalar.mdp index fe76044efa2..832648f62fb 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithAllSubqueryInScalar.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithAllSubqueryInScalar.mdp @@ -23,7 +23,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithSubqueryInScalar.mdp b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithSubqueryInScalar.mdp index 71cc6348fc0..1d158678ecd 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithSubqueryInScalar.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithSubqueryInScalar.mdp @@ -21,7 +21,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileComp.mdp b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileComp.mdp index 19a7af2f55a..07c14c69f83 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileComp.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileComp.mdp @@ -96,7 +96,7 @@ Physical plan: - + @@ -127,7 +127,7 @@ Physical plan: - + diff --git a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileFunc.mdp b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileFunc.mdp index 9b0aaed7a61..dead815a808 100644 --- a/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/AnySubqueryWithVolatileFunc.mdp @@ -68,7 +68,7 @@ - + @@ -99,7 +99,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmp-IN-ManyElements.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmp-IN-ManyElements.mdp index 28080ec9c7a..3a1ea35cfb4 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmp-IN-ManyElements.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmp-IN-ManyElements.mdp @@ -76,7 +76,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmpAll-Disjunct.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmpAll-Disjunct.mdp index f4ae584eb92..b6184908dc6 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmpAll-Disjunct.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmpAll-Disjunct.mdp @@ -28,7 +28,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmpAllEmpty.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmpAllEmpty.mdp index 0f2df0c8b53..9c5355ae6e3 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmpAllEmpty.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmpAllEmpty.mdp @@ -131,7 +131,7 @@ explain select 1 from foo where foo.a = all('{}'); - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmpty.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmpty.mdp index b0ccbbf6185..b6c50ce8d50 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmpty.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmpty.mdp @@ -131,7 +131,7 @@ explain select 1 from foo where foo.a=ANY('{}'); - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmptyLessThan.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmptyLessThan.mdp index cd8c89f3fcc..b3b49dfe01b 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmptyLessThan.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmpAnyEmptyLessThan.mdp @@ -129,7 +129,7 @@ explain select 1 from foo where foo.a < any('{}'); - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCmpInList.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCmpInList.mdp index f00c30efc55..d897653dd54 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCmpInList.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCmpInList.mdp @@ -53,7 +53,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCoerceCast.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCoerceCast.mdp index 78b9cc39323..97e974cdac1 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCoerceCast.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCoerceCast.mdp @@ -23,7 +23,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ArrayCoerceExpr.mdp b/src/backend/gporca/data/dxl/minidump/ArrayCoerceExpr.mdp index 04d636e6764..421e507f0e1 100644 --- a/src/backend/gporca/data/dxl/minidump/ArrayCoerceExpr.mdp +++ b/src/backend/gporca/data/dxl/minidump/ArrayCoerceExpr.mdp @@ -20,7 +20,7 @@ explain select * from foo where d in ('a', 'b'); - + diff --git a/src/backend/gporca/data/dxl/minidump/AvoidConstraintDerivationForLike.mdp b/src/backend/gporca/data/dxl/minidump/AvoidConstraintDerivationForLike.mdp index 0e717140e4a..fdcd8eed541 100644 --- a/src/backend/gporca/data/dxl/minidump/AvoidConstraintDerivationForLike.mdp +++ b/src/backend/gporca/data/dxl/minidump/AvoidConstraintDerivationForLike.mdp @@ -20,7 +20,7 @@ select * from like_error where some_text LIKE ANY (ARRAY['%text1%']); - + diff --git a/src/backend/gporca/data/dxl/minidump/BRINScan-Or.mdp b/src/backend/gporca/data/dxl/minidump/BRINScan-Or.mdp index 2f021adb2e4..32ae9ac1e8d 100644 --- a/src/backend/gporca/data/dxl/minidump/BRINScan-Or.mdp +++ b/src/backend/gporca/data/dxl/minidump/BRINScan-Or.mdp @@ -222,7 +222,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InList.mdp b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InList.mdp index 7f448dfaf9e..46dc67075e9 100644 --- a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InList.mdp +++ b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InList.mdp @@ -217,7 +217,7 @@ SELECT * FROM test WHERE a in (1, 47); - + diff --git a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InListLarge.mdp b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InListLarge.mdp index f05329ab96e..bc3052f26e5 100644 --- a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InListLarge.mdp +++ b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-InListLarge.mdp @@ -89,7 +89,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-ScalarSubquery.mdp b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-ScalarSubquery.mdp index 80bc1059fa7..c4f852f1bdc 100644 --- a/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-ScalarSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/BTreeIndex-Against-ScalarSubquery.mdp @@ -237,7 +237,7 @@ SELECT * FROM btree_test WHERE a in (select 1); - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndex-Against-InList.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndex-Against-InList.mdp index 62bd9b86395..133540c8239 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndex-Against-InList.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndex-Against-InList.mdp @@ -236,7 +236,7 @@ SELECT * FROM bitmap_test WHERE a in (1, 47); - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndex-ChooseHashJoin.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndex-ChooseHashJoin.mdp index 1fa05ab0fc2..85ffe984b83 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndex-ChooseHashJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndex-ChooseHashJoin.mdp @@ -3327,7 +3327,7 @@ - + @@ -3363,7 +3363,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-InnerSelect-PartTable.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-InnerSelect-PartTable.mdp index e8e1c9a9ff4..6196a3ff6d8 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-InnerSelect-PartTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-InnerSelect-PartTable.mdp @@ -237,7 +237,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + @@ -293,7 +293,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + @@ -349,7 +349,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + @@ -451,7 +451,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + @@ -507,7 +507,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + @@ -563,7 +563,7 @@ select * from x, y where x.i > y.j and y.k = 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-PartTable.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-PartTable.mdp index f0d6ef0d1c3..93373a81551 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-PartTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexApply-PartTable.mdp @@ -102,7 +102,7 @@ ORDER BY 1 asc ; - + @@ -161,7 +161,7 @@ ORDER BY 1 asc ; - + @@ -220,7 +220,7 @@ ORDER BY 1 asc ; - + @@ -329,7 +329,7 @@ ORDER BY 1 asc ; - + @@ -388,7 +388,7 @@ ORDER BY 1 asc ; - + @@ -447,7 +447,7 @@ ORDER BY 1 asc ; - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProject.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProject.mdp index 4cba548edf5..f5981dfd20c 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProject.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProject.mdp @@ -584,7 +584,7 @@ - + @@ -635,7 +635,7 @@ - + @@ -694,7 +694,7 @@ - + @@ -753,7 +753,7 @@ - + @@ -812,7 +812,7 @@ - + @@ -871,7 +871,7 @@ - + @@ -1758,7 +1758,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProjectNoFilt.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProjectNoFilt.mdp index e8e4ed1e284..620e0b34858 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProjectNoFilt.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLJWithProjectNoFilt.mdp @@ -86,7 +86,7 @@ - + @@ -671,7 +671,7 @@ - + @@ -722,7 +722,7 @@ - + @@ -781,7 +781,7 @@ - + @@ -840,7 +840,7 @@ - + @@ -899,7 +899,7 @@ - + @@ -958,7 +958,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProject.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProject.mdp index e75624240bc..39bedc76c8f 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProject.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProject.mdp @@ -580,7 +580,7 @@ - + @@ -631,7 +631,7 @@ - + @@ -690,7 +690,7 @@ - + @@ -749,7 +749,7 @@ - + @@ -808,7 +808,7 @@ - + @@ -867,7 +867,7 @@ - + @@ -927,7 +927,7 @@ - + @@ -1882,7 +1882,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProjectNonPart.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProjectNonPart.mdp index 29392b41bd2..f0f1fe43b5f 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProjectNonPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexNLOJWithProjectNonPart.mdp @@ -183,7 +183,7 @@ - + @@ -265,7 +265,7 @@ - + @@ -1272,7 +1272,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexProbeMergeFilters.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexProbeMergeFilters.mdp index 2f4aba5646f..6686f1d9161 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexProbeMergeFilters.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexProbeMergeFilters.mdp @@ -115,7 +115,7 @@ EXPLAIN SELECT * FROM table_with_two_indices_ao WHERE b = 15 AND c BETWEEN 10000 - + @@ -146,7 +146,7 @@ EXPLAIN SELECT * FROM table_with_two_indices_ao WHERE b = 15 AND c BETWEEN 10000 - + @@ -188,7 +188,7 @@ EXPLAIN SELECT * FROM table_with_two_indices_ao WHERE b = 15 AND c BETWEEN 10000 - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexScan.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexScan.mdp index 1d5fe46b827..18fb2b4dfaf 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexScan.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexScan.mdp @@ -144,7 +144,7 @@ see sql/BitmapIndexScan.sql - + @@ -221,7 +221,7 @@ see sql/BitmapIndexScan.sql - + @@ -289,7 +289,7 @@ see sql/BitmapIndexScan.sql - + @@ -422,7 +422,7 @@ see sql/BitmapIndexScan.sql - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexScanChooseIndex.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexScanChooseIndex.mdp index 9ba12a8623b..9a4efc66a42 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexScanChooseIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexScanChooseIndex.mdp @@ -125,7 +125,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexScanCost.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexScanCost.mdp index 7026c7468f7..3ddf90c5eba 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexScanCost.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexScanCost.mdp @@ -211,7 +211,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapIndexUnsupportedOperator.mdp b/src/backend/gporca/data/dxl/minidump/BitmapIndexUnsupportedOperator.mdp index d7cdae602ce..5b2303be691 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapIndexUnsupportedOperator.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapIndexUnsupportedOperator.mdp @@ -37,7 +37,7 @@ undefined for Bitmap Index Scan. ORCA should find a plan transforming - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapScan-Hetrogeneous-Partitioned.mdp b/src/backend/gporca/data/dxl/minidump/BitmapScan-Hetrogeneous-Partitioned.mdp index fc64db25afb..4dac0e6eb07 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapScan-Hetrogeneous-Partitioned.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapScan-Hetrogeneous-Partitioned.mdp @@ -148,7 +148,7 @@ explain select * from t where b=3; - + @@ -198,7 +198,7 @@ explain select * from t where b=3; - + @@ -241,7 +241,7 @@ explain select * from t where b=3; - + @@ -300,7 +300,7 @@ explain select * from t where b=3; - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickIndexWithNoGap.mdp b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickIndexWithNoGap.mdp index 95794183057..f7b67e1da8b 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickIndexWithNoGap.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickIndexWithNoGap.mdp @@ -502,7 +502,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickOnlyHighNDV.mdp b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickOnlyHighNDV.mdp index 0a88b11a829..b072e8abc8b 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickOnlyHighNDV.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-AO-Btree-PickOnlyHighNDV.mdp @@ -48,7 +48,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ComplexConjDisj.mdp b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ComplexConjDisj.mdp index e7e55a37530..c498ed5d6a5 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ComplexConjDisj.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ComplexConjDisj.mdp @@ -116,7 +116,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ConjDisjWithOuterRefs.mdp b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ConjDisjWithOuterRefs.mdp index 46a55027f02..be1528640c3 100644 --- a/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ConjDisjWithOuterRefs.mdp +++ b/src/backend/gporca/data/dxl/minidump/BitmapTableScan-ConjDisjWithOuterRefs.mdp @@ -148,7 +148,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Blocking-Spool-Parallel-Union-All.mdp b/src/backend/gporca/data/dxl/minidump/Blocking-Spool-Parallel-Union-All.mdp index f5c51639890..157fa65a375 100644 --- a/src/backend/gporca/data/dxl/minidump/Blocking-Spool-Parallel-Union-All.mdp +++ b/src/backend/gporca/data/dxl/minidump/Blocking-Spool-Parallel-Union-All.mdp @@ -33,7 +33,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -129,7 +129,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityEquals.mdp b/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityEquals.mdp index d1086f1ee79..119f3e28da8 100644 --- a/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityEquals.mdp +++ b/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityEquals.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityGreaterThan.mdp b/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityGreaterThan.mdp index 8875b26ed83..a614ba1e804 100644 --- a/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityGreaterThan.mdp +++ b/src/backend/gporca/data/dxl/minidump/BpCharMCVCardinalityGreaterThan.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BroadcastSkewedHashjoin.mdp b/src/backend/gporca/data/dxl/minidump/BroadcastSkewedHashjoin.mdp index ec5c7f64266..59a892a8ed7 100644 --- a/src/backend/gporca/data/dxl/minidump/BroadcastSkewedHashjoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/BroadcastSkewedHashjoin.mdp @@ -2462,7 +2462,7 @@ Intent: The join should pick up a Broadcast over Redistribute. The hashjoin is s - + @@ -2496,7 +2496,7 @@ Intent: The join should pick up a Broadcast over Redistribute. The hashjoin is s - + diff --git a/src/backend/gporca/data/dxl/minidump/BtreeIndexNLJWithProjectNoPart.mdp b/src/backend/gporca/data/dxl/minidump/BtreeIndexNLJWithProjectNoPart.mdp index c7f0c308bab..cb0269f0966 100644 --- a/src/backend/gporca/data/dxl/minidump/BtreeIndexNLJWithProjectNoPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/BtreeIndexNLJWithProjectNoPart.mdp @@ -632,7 +632,7 @@ - + @@ -689,7 +689,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/BtreeIndexNLOJWithProject.mdp b/src/backend/gporca/data/dxl/minidump/BtreeIndexNLOJWithProject.mdp index 55dfe32ba60..2580894b200 100644 --- a/src/backend/gporca/data/dxl/minidump/BtreeIndexNLOJWithProject.mdp +++ b/src/backend/gporca/data/dxl/minidump/BtreeIndexNLOJWithProject.mdp @@ -189,7 +189,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -358,7 +358,7 @@ - + @@ -417,7 +417,7 @@ - + @@ -476,7 +476,7 @@ - + @@ -567,7 +567,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListExpand.mdp b/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListExpand.mdp index faa22807f9b..824e642e2a7 100644 --- a/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListExpand.mdp +++ b/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListExpand.mdp @@ -23,7 +23,7 @@ select a,b from foo, bar where foo.a in (1,2,3,4,5,6) and foo.a = bar.c; - + @@ -151,7 +151,7 @@ select a,b from foo, bar where foo.a in (1,2,3,4,5,6) and foo.a = bar.c; - + diff --git a/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListNoExpand.mdp b/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListNoExpand.mdp index 53ca3f16550..897e2ddcaab 100644 --- a/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListNoExpand.mdp +++ b/src/backend/gporca/data/dxl/minidump/CArrayExpansionTest/JoinWithInListNoExpand.mdp @@ -23,7 +23,7 @@ select a,b from foo, bar where foo.a in (1,2,3,4,5,6) and foo.a = bar.c; - + @@ -151,7 +151,7 @@ select a,b from foo, bar where foo.a in (1,2,3,4,5,6) and foo.a = bar.c; - + diff --git a/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithDP.mdp b/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithDP.mdp index 67814dcfb73..e4254e053f3 100644 --- a/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithDP.mdp +++ b/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithDP.mdp @@ -100,7 +100,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 FROM foo10 FOO10 WHERE FOO10.i2 = 'EN' ) FOO1 - + @@ -1325,7 +1325,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 FROM foo10 FOO10 WHERE FOO10.i2 = 'EN' ) FOO1 - + @@ -1374,7 +1374,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 FROM foo10 FOO10 WHERE FOO10.i2 = 'EN' ) FOO1 - + @@ -3096,7 +3096,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 FROM foo10 FOO10 WHERE FOO10.i2 = 'EN' ) FOO1 - + @@ -3541,7 +3541,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 FROM foo10 FOO10 WHERE FOO10.i2 = 'EN' ) FOO1 - + diff --git a/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithOutDP.mdp b/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithOutDP.mdp index 564656b753f..f795cc7a22b 100644 --- a/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithOutDP.mdp +++ b/src/backend/gporca/data/dxl/minidump/CJoinOrderDPTest/JoinOrderWithOutDP.mdp @@ -74,7 +74,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 - + @@ -389,7 +389,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 - + @@ -411,7 +411,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 - + @@ -767,7 +767,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 - + @@ -1328,7 +1328,7 @@ INNER JOIN (SELECT FOO10.i1 AS i1 - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/FallBackToSerialAppend.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/FallBackToSerialAppend.mdp index 92029bae941..e27a3e468c0 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/FallBackToSerialAppend.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/FallBackToSerialAppend.mdp @@ -122,7 +122,7 @@ SELECT * FROM pp WHERE b=2 AND c=2; - + @@ -166,7 +166,7 @@ SELECT * FROM pp WHERE b=2 AND c=2; - + @@ -220,7 +220,7 @@ SELECT * FROM pp WHERE b=2 AND c=2; - + @@ -274,7 +274,7 @@ SELECT * FROM pp WHERE b=2 AND c=2; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/NoOpMotionUsesOnlyGroupOutputColumns.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/NoOpMotionUsesOnlyGroupOutputColumns.mdp index b398b3adb98..776a362cbd1 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/NoOpMotionUsesOnlyGroupOutputColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/NoOpMotionUsesOnlyGroupOutputColumns.mdp @@ -144,7 +144,7 @@ EXPLAIN SELECT b, a FROM foo UNION ALL SELECT b, a FROM foo INTERSECT ALL SELECT - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-ConstTable.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-ConstTable.mdp index 3cacec28c2b..4f4a3a5de29 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-ConstTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-ConstTable.mdp @@ -21,7 +21,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Insert.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Insert.mdp index feb7a2d5b0e..53cc3fb0b01 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Insert.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Insert.mdp @@ -109,7 +109,7 @@ INSERT INTO t VALUES (11),(12),(13); - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Select.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Select.mdp index 5f44e9655b2..81433491f00 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Select.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelAppend-Select.mdp @@ -38,7 +38,7 @@ explain select * from foo union select * from bar; - + @@ -173,7 +173,7 @@ explain select * from foo union select * from bar; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNoRedistributableColumns.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNoRedistributableColumns.mdp index 161f8983983..7ed42bfd453 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNoRedistributableColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNoRedistributableColumns.mdp @@ -119,7 +119,7 @@ EXPLAIN SELECT xmin FROM tbl1 UNION ALL SELECT xmin FROM tbl2; - + @@ -154,7 +154,7 @@ EXPLAIN SELECT xmin FROM tbl1 UNION ALL SELECT xmin FROM tbl2; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNotEqualNumOfDistrColumns.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNotEqualNumOfDistrColumns.mdp index e264f41ff1a..11f5ce2f59f 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNotEqualNumOfDistrColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithNotEqualNumOfDistrColumns.mdp @@ -22,7 +22,7 @@ EXPLAIN SELECT a,b FROM foo UNION ALL SELECT c,d FROM bar; - + @@ -151,7 +151,7 @@ EXPLAIN SELECT a,b FROM foo UNION ALL SELECT c,d FROM bar; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithSingleNotRedistributableColumn.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithSingleNotRedistributableColumn.mdp index ce76ad8b557..69ead21f8da 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithSingleNotRedistributableColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/ParallelUnionAllWithSingleNotRedistributableColumn.mdp @@ -122,7 +122,7 @@ EXPLAIN SELECT * FROM foo UNION ALL SELECT * FROM bar; - + @@ -159,7 +159,7 @@ EXPLAIN SELECT * FROM foo UNION ALL SELECT * FROM bar; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RandomDistributedChildrenUnhashableColumns.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RandomDistributedChildrenUnhashableColumns.mdp index a2479404f8c..9af54bcd71b 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RandomDistributedChildrenUnhashableColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RandomDistributedChildrenUnhashableColumns.mdp @@ -22,7 +22,7 @@ EXPLAIN SELECT xmin FROM foo UNION ALL SELECT xmin FROM bar; - + @@ -56,7 +56,7 @@ EXPLAIN SELECT xmin FROM foo UNION ALL SELECT xmin FROM bar; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RedundantMotionParallelUnionAll.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RedundantMotionParallelUnionAll.mdp index 5e53a794bfa..bcd204c5418 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RedundantMotionParallelUnionAll.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/RedundantMotionParallelUnionAll.mdp @@ -20,7 +20,7 @@ select * from t, (select * from t union all select * from t) tt where t.c = tt.c - + diff --git a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/TwoHashedTables.mdp b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/TwoHashedTables.mdp index b819c5a7aa6..8262e3be496 100644 --- a/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/TwoHashedTables.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPhysicalParallelUnionAllTest/TwoHashedTables.mdp @@ -115,7 +115,7 @@ EXPLAIN SELECT * FROM foo UNION ALL SELECT * FROM bar; - + @@ -148,7 +148,7 @@ EXPLAIN SELECT * FROM foo UNION ALL SELECT * FROM bar; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AggTopOfSetRefFuncsOnTopTbl.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AggTopOfSetRefFuncsOnTopTbl.mdp index 7524aeaa979..22cf1dbca47 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AggTopOfSetRefFuncsOnTopTbl.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AggTopOfSetRefFuncsOnTopTbl.mdp @@ -173,7 +173,7 @@ select count(*) from (select unnest(string_to_array(c, '|')) i, d from foo) t; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AllColsUsed.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AllColsUsed.mdp index 1fb37ac07a5..247e1fcf80b 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AllColsUsed.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/AllColsUsed.mdp @@ -158,7 +158,7 @@ select i, j from (select unnest(string_to_array(c, '|')) i, abs(d) j from foo) t - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncs.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncs.mdp index 84659482876..bceba3f88f0 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncs.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncs.mdp @@ -176,7 +176,7 @@ select count(*) from (select (select unnest(string_to_array(c, '|')) ii from foo - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncsAndScalarFuncs.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncsAndScalarFuncs.mdp index 309fa29a5bd..c3897f6bc16 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncsAndScalarFuncs.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/MultiLevelSubqueryWithSetRetFuncsAndScalarFuncs.mdp @@ -173,7 +173,7 @@ select count(*) from (select (select 1 as p) i, unnest(string_to_array(c, '|')) - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UnusedSetRetFuncAndUsedScalarFunc.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UnusedSetRetFuncAndUsedScalarFunc.mdp index 4200296521f..5334ed080cd 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UnusedSetRetFuncAndUsedScalarFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UnusedSetRetFuncAndUsedScalarFunc.mdp @@ -158,7 +158,7 @@ select j from (select unnest(string_to_array(c, '|')) i, abs(d) j from foo) t; - + diff --git a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UsedSetRetFuncAndUnusedScalarFunc.mdp b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UsedSetRetFuncAndUnusedScalarFunc.mdp index c2811e8de73..fa27998564f 100644 --- a/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UsedSetRetFuncAndUnusedScalarFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/CPruneColumnsTest/UsedSetRetFuncAndUnusedScalarFunc.mdp @@ -158,7 +158,7 @@ select i from (select unnest(string_to_array(c, '|')) i, abs(d) j from foo) t; - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS-Random.mdp b/src/backend/gporca/data/dxl/minidump/CTAS-Random.mdp index c686d08b91f..360a3fba22f 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS-Random.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS-Random.mdp @@ -123,7 +123,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS-With-Global-Local-Agg.mdp b/src/backend/gporca/data/dxl/minidump/CTAS-With-Global-Local-Agg.mdp index bc382491bbe..ec672743346 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS-With-Global-Local-Agg.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS-With-Global-Local-Agg.mdp @@ -47,7 +47,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS-random-distributed-from-replicated-distributed-table.mdp b/src/backend/gporca/data/dxl/minidump/CTAS-random-distributed-from-replicated-distributed-table.mdp index 308baec5480..83f8ca0719f 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS-random-distributed-from-replicated-distributed-table.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS-random-distributed-from-replicated-distributed-table.mdp @@ -40,7 +40,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS-with-Limit.mdp b/src/backend/gporca/data/dxl/minidump/CTAS-with-Limit.mdp index 541ae5cc523..60f9098806b 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS-with-Limit.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS-with-Limit.mdp @@ -41,7 +41,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS.mdp b/src/backend/gporca/data/dxl/minidump/CTAS.mdp index 2c452d15e51..3294ea394c9 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS.mdp @@ -123,7 +123,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTAS_OrderedAgg_multiple_cols.mdp b/src/backend/gporca/data/dxl/minidump/CTAS_OrderedAgg_multiple_cols.mdp index caa3d3ca423..d17cf4be073 100644 --- a/src/backend/gporca/data/dxl/minidump/CTAS_OrderedAgg_multiple_cols.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTAS_OrderedAgg_multiple_cols.mdp @@ -111,7 +111,7 @@ EXPLAIN CREATE TABLE test AS - + @@ -1802,7 +1802,7 @@ EXPLAIN CREATE TABLE test AS - + diff --git a/src/backend/gporca/data/dxl/minidump/CTE-NoPushProperties.mdp b/src/backend/gporca/data/dxl/minidump/CTE-NoPushProperties.mdp index 55621b3c8db..7782c334120 100644 --- a/src/backend/gporca/data/dxl/minidump/CTE-NoPushProperties.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTE-NoPushProperties.mdp @@ -26,7 +26,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -257,7 +257,7 @@ - + @@ -842,7 +842,7 @@ - + @@ -896,7 +896,7 @@ - + @@ -967,7 +967,7 @@ - + @@ -1021,7 +1021,7 @@ - + @@ -1075,7 +1075,7 @@ - + @@ -1129,7 +1129,7 @@ - + @@ -1585,7 +1585,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTE-PartTbl.mdp b/src/backend/gporca/data/dxl/minidump/CTE-PartTbl.mdp index e38107cd817..4589298ee13 100644 --- a/src/backend/gporca/data/dxl/minidump/CTE-PartTbl.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTE-PartTbl.mdp @@ -190,7 +190,7 @@ - + @@ -244,7 +244,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -406,7 +406,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTE-PushProperties.mdp b/src/backend/gporca/data/dxl/minidump/CTE-PushProperties.mdp index 3c14cce68f9..5f110045736 100644 --- a/src/backend/gporca/data/dxl/minidump/CTE-PushProperties.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTE-PushProperties.mdp @@ -26,7 +26,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -257,7 +257,7 @@ - + @@ -842,7 +842,7 @@ - + @@ -896,7 +896,7 @@ - + @@ -967,7 +967,7 @@ - + @@ -1021,7 +1021,7 @@ - + @@ -1075,7 +1075,7 @@ - + @@ -1129,7 +1129,7 @@ - + @@ -1585,7 +1585,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTE-with-random-filter.mdp b/src/backend/gporca/data/dxl/minidump/CTE-with-random-filter.mdp index 8a06c1060c5..34c0637a627 100644 --- a/src/backend/gporca/data/dxl/minidump/CTE-with-random-filter.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTE-with-random-filter.mdp @@ -262,7 +262,7 @@ explain with t as (select * from foo) select count(*) from t where random() < 0. - + diff --git a/src/backend/gporca/data/dxl/minidump/CTEConstraintDeriveNegation.mdp b/src/backend/gporca/data/dxl/minidump/CTEConstraintDeriveNegation.mdp index 179e6be4086..712f48ae1cd 100644 --- a/src/backend/gporca/data/dxl/minidump/CTEConstraintDeriveNegation.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTEConstraintDeriveNegation.mdp @@ -132,7 +132,7 @@ pivotal=# explain with negcte as (select distinct a from t1 where a is not null - + diff --git a/src/backend/gporca/data/dxl/minidump/CTEMergeGroupsCircularDeriveStats.mdp b/src/backend/gporca/data/dxl/minidump/CTEMergeGroupsCircularDeriveStats.mdp index b212228c4e7..35cc73621bf 100644 --- a/src/backend/gporca/data/dxl/minidump/CTEMergeGroupsCircularDeriveStats.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTEMergeGroupsCircularDeriveStats.mdp @@ -22,7 +22,7 @@ - + @@ -56,7 +56,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CTEMisAlignedProducerConsumer.mdp b/src/backend/gporca/data/dxl/minidump/CTEMisAlignedProducerConsumer.mdp index 865e9dce3a8..c9542903b5f 100644 --- a/src/backend/gporca/data/dxl/minidump/CTEMisAlignedProducerConsumer.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTEMisAlignedProducerConsumer.mdp @@ -20,7 +20,7 @@ SELECT 1 FROM (SELECT * FROM foo) t2 FULL JOIN (SELECT 1) t1 ON true; - + diff --git a/src/backend/gporca/data/dxl/minidump/CTEWithMergedGroup.mdp b/src/backend/gporca/data/dxl/minidump/CTEWithMergedGroup.mdp index 2625b7b2802..2e370215d0a 100644 --- a/src/backend/gporca/data/dxl/minidump/CTEWithMergedGroup.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTEWithMergedGroup.mdp @@ -173,7 +173,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -423,10 +423,10 @@ - + - + @@ -437,7 +437,7 @@ - + @@ -448,7 +448,7 @@ - + @@ -465,7 +465,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -543,7 +543,7 @@ - + @@ -568,7 +568,7 @@ - + @@ -593,7 +593,7 @@ - + @@ -615,7 +615,7 @@ - + @@ -668,149 +668,178 @@ - + - + - + - - + - + - - + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - + - - - - + - + - - - - - + - - + + + + - + - - + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + - + + + + + + - + - + + + + + - + - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + diff --git a/src/backend/gporca/data/dxl/minidump/CTEinlining.mdp b/src/backend/gporca/data/dxl/minidump/CTEinlining.mdp index d2b4d22a0e7..948fee6d9d9 100644 --- a/src/backend/gporca/data/dxl/minidump/CTEinlining.mdp +++ b/src/backend/gporca/data/dxl/minidump/CTEinlining.mdp @@ -129,7 +129,7 @@ explain with v as (select x,y from bar) select v1.x from v v1, v v2 where v1.x = - + diff --git a/src/backend/gporca/data/dxl/minidump/CannotPullGrpColAboveAgg.mdp b/src/backend/gporca/data/dxl/minidump/CannotPullGrpColAboveAgg.mdp index a5217d9547f..c51e2043fe6 100644 --- a/src/backend/gporca/data/dxl/minidump/CannotPullGrpColAboveAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/CannotPullGrpColAboveAgg.mdp @@ -3760,7 +3760,7 @@ The SQL along with the DDL are in TINC repo. In the aggregates directory under q - + diff --git a/src/backend/gporca/data/dxl/minidump/CastedInClauseWithMCV.mdp b/src/backend/gporca/data/dxl/minidump/CastedInClauseWithMCV.mdp index fa0965fc07c..bb1b2fc69c8 100644 --- a/src/backend/gporca/data/dxl/minidump/CastedInClauseWithMCV.mdp +++ b/src/backend/gporca/data/dxl/minidump/CastedInClauseWithMCV.mdp @@ -24,7 +24,7 @@ explain select * from n1 where a in (1, (select count(*) from n1)); - + diff --git a/src/backend/gporca/data/dxl/minidump/CastedScalarIf-On-Index-Key.mdp b/src/backend/gporca/data/dxl/minidump/CastedScalarIf-On-Index-Key.mdp index 971844e175f..9e57605f308 100644 --- a/src/backend/gporca/data/dxl/minidump/CastedScalarIf-On-Index-Key.mdp +++ b/src/backend/gporca/data/dxl/minidump/CastedScalarIf-On-Index-Key.mdp @@ -24,7 +24,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -360,9 +360,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/Char-Cardinality.mdp b/src/backend/gporca/data/dxl/minidump/Char-Cardinality.mdp index dcee358f9c3..35b5b989254 100644 --- a/src/backend/gporca/data/dxl/minidump/Char-Cardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/Char-Cardinality.mdp @@ -25,7 +25,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Citext-Cardinality.mdp b/src/backend/gporca/data/dxl/minidump/Citext-Cardinality.mdp index bfd912f9e15..266ec74d6ce 100644 --- a/src/backend/gporca/data/dxl/minidump/Citext-Cardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/Citext-Cardinality.mdp @@ -41,7 +41,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Coalesce-With-Subquery.mdp b/src/backend/gporca/data/dxl/minidump/Coalesce-With-Subquery.mdp index 972495c0dcc..e7e2587cdf7 100644 --- a/src/backend/gporca/data/dxl/minidump/Coalesce-With-Subquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/Coalesce-With-Subquery.mdp @@ -845,7 +845,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CoerceViaIO.mdp b/src/backend/gporca/data/dxl/minidump/CoerceViaIO.mdp index bd9649fb5be..b832c9d4914 100644 --- a/src/backend/gporca/data/dxl/minidump/CoerceViaIO.mdp +++ b/src/backend/gporca/data/dxl/minidump/CoerceViaIO.mdp @@ -96,7 +96,7 @@ SELECT * FROM foo WHERE id::text = 'foo'; - + diff --git a/src/backend/gporca/data/dxl/minidump/CollapseNot.mdp b/src/backend/gporca/data/dxl/minidump/CollapseNot.mdp index 84a7cc6c133..ff312012644 100644 --- a/src/backend/gporca/data/dxl/minidump/CollapseNot.mdp +++ b/src/backend/gporca/data/dxl/minidump/CollapseNot.mdp @@ -19,7 +19,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -296,10 +296,10 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + - + @@ -310,14 +310,14 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + - + @@ -332,7 +332,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -342,7 +342,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -383,7 +383,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -411,7 +411,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -442,7 +442,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -465,7 +465,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -506,7 +506,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -534,7 +534,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -566,7 +566,7 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + @@ -623,30 +623,33 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - + - + - + - - + - + + + + + @@ -682,8 +685,8 @@ SELECT 1 FROM inverse WHERE NOT (cidr <<= ANY(SELECT * FROM inverse)); - - + + diff --git a/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning-CTE.mdp b/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning-CTE.mdp index b20ea445bf6..1c27986e8da 100644 --- a/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning-CTE.mdp +++ b/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning-CTE.mdp @@ -60,7 +60,7 @@ select * from t2; - + diff --git a/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning.mdp b/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning.mdp index 2d165750a75..555453f8a51 100644 --- a/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning.mdp +++ b/src/backend/gporca/data/dxl/minidump/CollapseProject-SetReturning.mdp @@ -53,7 +53,7 @@ from (select regexp_split_to_table(a, ',') as c, b from t) dumb(c, b); - + diff --git a/src/backend/gporca/data/dxl/minidump/CompositeTypeRelMdId.mdp b/src/backend/gporca/data/dxl/minidump/CompositeTypeRelMdId.mdp index 535816c85d5..f1e9eea9770 100644 --- a/src/backend/gporca/data/dxl/minidump/CompositeTypeRelMdId.mdp +++ b/src/backend/gporca/data/dxl/minidump/CompositeTypeRelMdId.mdp @@ -140,7 +140,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstScalarFuncNotPushedBelowGather.mdp b/src/backend/gporca/data/dxl/minidump/ConstScalarFuncNotPushedBelowGather.mdp index 3eff8428984..6e1ab687743 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstScalarFuncNotPushedBelowGather.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstScalarFuncNotPushedBelowGather.mdp @@ -58,7 +58,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqUnderProjectWithOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqUnderProjectWithOuterRef.mdp index 72bba942d7e..597df04d9ae 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqUnderProjectWithOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqUnderProjectWithOuterRef.mdp @@ -122,7 +122,7 @@ SELECT (SELECT a) FROM foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithNoOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithNoOuterRef.mdp index 75b3e1b86f3..cd360fe9d79 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithNoOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithNoOuterRef.mdp @@ -54,7 +54,7 @@ SELECT * FROM foo,bar WHERE a=(VALUES (1)); - + @@ -378,7 +378,7 @@ SELECT * FROM foo,bar WHERE a=(VALUES (1)); - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithOuterRef.mdp index 6dc560f1c70..72117ce2fbf 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstTblGetUnderSubqWithOuterRef.mdp @@ -123,7 +123,7 @@ SELECT * FROM foo,bar WHERE a=(SELECT c); - + @@ -160,7 +160,7 @@ SELECT * FROM foo,bar WHERE a=(SELECT c); - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalIncludesNull.mdp index 2756610acbe..4801e7b771c 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalIncludesNull.mdp @@ -34,7 +34,7 @@ Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..431.00 rows=1 width=4) - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalNotIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalNotIncludesNull.mdp index 7587bb5042a..15d5ef5664d 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalNotIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalNotIncludesNull.mdp @@ -33,7 +33,7 @@ Rows out: 0 rows with 0.007 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolIncludesNull.mdp index b94e6d7adc5..106e3f760c4 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolIncludesNull.mdp @@ -96,7 +96,7 @@ Rows out: 1 rows at destination with 0.241 ms to first row, 0.242 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolNotIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolNotIncludesNull.mdp index 2f32af8854c..dd19e16b7a2 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolNotIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithBoolNotIncludesNull.mdp @@ -125,7 +125,7 @@ Rows out: 0 rows with 0.002 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNull.mdp index 4a439724ef1..066d76306b0 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNull.mdp @@ -37,7 +37,7 @@ Rows out: 1 rows at destination with 0.253 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNullArray.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNullArray.mdp index da0583a9d61..3175cec7ac8 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNullArray.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInIncludesNullArray.mdp @@ -35,7 +35,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInNotIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInNotIncludesNull.mdp index debbb42063e..d91140f4d0b 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInNotIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithInNotIncludesNull.mdp @@ -36,7 +36,7 @@ Rows out: 0 rows with 0.010 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsIncludeNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsIncludeNull.mdp index 8f3bed94a40..9bda59e3557 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsIncludeNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsIncludeNull.mdp @@ -137,7 +137,7 @@ Rows out: 1 rows at destination with 1693 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsNotIncludeNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsNotIncludeNull.mdp index e874979ce82..025522cf22e 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsNotIncludeNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithMultiColumnsNotIncludeNull.mdp @@ -136,7 +136,7 @@ Rows out: 0 rows with 0.002 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithNotIncludesNull.mdp b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithNotIncludesNull.mdp index 5ebb2a8c87f..80fd8d6526a 100644 --- a/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithNotIncludesNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConstraintIntervalWithNotIncludesNull.mdp @@ -46,7 +46,7 @@ Rows out: 1 rows at destination with 0.250 ms to first row, 0.251 ms to end. - + diff --git a/src/backend/gporca/data/dxl/minidump/ConvertBoolConstNullToConstTableFalseFilter.mdp b/src/backend/gporca/data/dxl/minidump/ConvertBoolConstNullToConstTableFalseFilter.mdp index 35e42d253f5..80fff239799 100644 --- a/src/backend/gporca/data/dxl/minidump/ConvertBoolConstNullToConstTableFalseFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/ConvertBoolConstNullToConstTableFalseFilter.mdp @@ -20,7 +20,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-2.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-2.mdp new file mode 100644 index 00000000000..37e27ab2ce2 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-2.mdp @@ -0,0 +1,1532 @@ + + + Seq Scan on t (cost=0.00..431.41 rows=34 width=12) (actual rows=100 loops=1) + Filter: ((a = 1) AND (b = 1) AND (c = 1)) + Rows Removed by Filter: 3700 + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-3.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-3.mdp new file mode 100644 index 00000000000..1356f141899 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency-3.mdp @@ -0,0 +1,1104 @@ + + + Seq Scan on t (cost=0.00..431.29 rows=34 width=8) (actual rows=100 loops=1) + Filter: ((a = 1) AND (b = 1)) + Rows Removed by Filter: 3701 + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency.mdp new file mode 100644 index 00000000000..d9941883c94 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-Function-Dependency.mdp @@ -0,0 +1,1102 @@ + + + Seq Scan on t (cost=0.00..431.29 rows=34 width=8) (actual rows=100 loops=1) + Filter: ((a = 1) AND (b = 1)) + Rows Removed by Filter: 3700 + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-2.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-2.mdp new file mode 100644 index 00000000000..38b89d5ca0d --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-2.mdp @@ -0,0 +1,1166 @@ + + + GroupAggregate (cost=0.00..432.92 rows=34 width=8) (actual rows=38 loops=1) + Group Key: a, b + -> Sort (cost=0.00..432.89 rows=3334 width=8) (actual rows=3800 loops=1) + Sort Key: a, b + Sort Method: quicksort Memory: 836kB + Executor Memory: 604kB Segments: 3 Max: 216kB (segment 0) + -> Seq Scan on t (cost=0.00..431.07 rows=3334 width=8) (actual rows=3800 loops=1) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-3.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-3.mdp new file mode 100644 index 00000000000..e6b183f1bb4 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-3.mdp @@ -0,0 +1,1083 @@ + + + HashAggregate (cost=0.00..431.93 rows=34 width=8) (actual rows=38 loops=1) + Group Key: a, b + Peak Memory Usage: 0 kB + -> Seq Scan on t (cost=0.00..431.07 rows=3334 width=8) (actual rows=3800 loops=1) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-4.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-4.mdp new file mode 100644 index 00000000000..b82b52dd34d --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-4.mdp @@ -0,0 +1,2351 @@ + + + HashAggregate (cost=0.00..444.61 rows=334 width=8) (actual rows=380 loops=1) + Group Key: a, b, c + Peak Memory Usage: 0 kB + -> Seq Scan on t (cost=0.00..431.77 rows=33334 width=12) (actual rows=38000 loops=1) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-5.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-5.mdp new file mode 100644 index 00000000000..3dba183f501 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct-5.mdp @@ -0,0 +1,1136 @@ + + + HashAggregate (cost=0.00..440.33 rows=34 width=8) (actual rows=38 loops=1) + Group Key: a, b + Peak Memory Usage: 0 kB + -> Seq Scan on t (cost=0.00..431.77 rows=33334 width=8) (actual rows=38000 loops=1) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct.mdp b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct.mdp new file mode 100644 index 00000000000..564c2b0de26 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Correlated-Stat-NDistinct.mdp @@ -0,0 +1,1129 @@ + + + HashAggregate (cost=0.00..431.93 rows=34 width=8) (actual rows=38 loops=1) + Group Key: a, b + Peak Memory Usage: 0 kB + -> Seq Scan on t (cost=0.00..431.07 rows=3334 width=8) (actual rows=3800 loops=1) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedAntiSemiJoin-True.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedAntiSemiJoin-True.mdp index 2961d962592..cb0116352fc 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedAntiSemiJoin-True.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedAntiSemiJoin-True.mdp @@ -864,10 +864,10 @@ SELECT pn, cn, vn FROM sale s WHERE NOT EXISTS (SELECT * FROM customer WHERE NOT - + - + @@ -886,19 +886,87 @@ SELECT pn, cn, vn FROM sale s WHERE NOT EXISTS (SELECT * FROM customer WHERE NOT - + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -945,66 +1013,7 @@ SELECT pn, cn, vn FROM sale s WHERE NOT EXISTS (SELECT * FROM customer WHERE NOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-Limit.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-Limit.mdp index 3212fb7b4d0..c4665b068e0 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-Limit.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-Limit.mdp @@ -40,7 +40,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -304,7 +304,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-True.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-True.mdp index 5c774324bc2..e546afa916a 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-True.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiJoin-True.mdp @@ -39,7 +39,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -700,7 +700,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiNotIn-True.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiNotIn-True.mdp index 16d41cbd8a9..e726d00d3b3 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiNotIn-True.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedIN-LeftSemiNotIn-True.mdp @@ -82,7 +82,7 @@ create table customer - + @@ -164,7 +164,7 @@ create table customer - + @@ -327,7 +327,7 @@ create table customer - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedLeftSemiNLJoinWithLimit.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedLeftSemiNLJoinWithLimit.mdp index 904d9f88b6d..7544346d076 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedLeftSemiNLJoinWithLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedLeftSemiNLJoinWithLimit.mdp @@ -40,7 +40,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -315,7 +315,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJ-PartSelector-Subplan.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJ-PartSelector-Subplan.mdp index f479d202a02..6554a6abeee 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJ-PartSelector-Subplan.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJ-PartSelector-Subplan.mdp @@ -154,7 +154,7 @@ EXPLAIN SELECT pk from partitioned_table WHERE a > (select d from other_table wh - + @@ -191,7 +191,7 @@ EXPLAIN SELECT pk from partitioned_table WHERE a > (select d from other_table wh - + @@ -239,7 +239,7 @@ EXPLAIN SELECT pk from partitioned_table WHERE a > (select d from other_table wh - + @@ -292,7 +292,7 @@ EXPLAIN SELECT pk from partitioned_table WHERE a > (select d from other_table wh - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithStreamingSpool.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithStreamingSpool.mdp index f9ec2fb8554..ed801cd42c5 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithStreamingSpool.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithStreamingSpool.mdp @@ -25,7 +25,7 @@ - + @@ -56,7 +56,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithTrueCondition.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithTrueCondition.mdp index 61f38c69bc0..d389b89d2d1 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithTrueCondition.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedNLJWithTrueCondition.mdp @@ -106,7 +106,7 @@ - + @@ -137,7 +137,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedSemiJoin-True.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedSemiJoin-True.mdp index 2b6f4bc1114..d51f0aa2d4e 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedSemiJoin-True.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedSemiJoin-True.mdp @@ -859,10 +859,10 @@ SELECT pn, cn, vn FROM sale s WHERE EXISTS (SELECT * FROM customer WHERE EXISTS - + - + @@ -881,19 +881,87 @@ SELECT pn, cn, vn FROM sale s WHERE EXISTS (SELECT * FROM customer WHERE EXISTS - + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -940,66 +1008,7 @@ SELECT pn, cn, vn FROM sale s WHERE EXISTS (SELECT * FROM customer WHERE EXISTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/backend/gporca/data/dxl/minidump/CorrelatedSubqueryWithAggWindowFunc.mdp b/src/backend/gporca/data/dxl/minidump/CorrelatedSubqueryWithAggWindowFunc.mdp index 59da7a94e33..45c94a2c9de 100644 --- a/src/backend/gporca/data/dxl/minidump/CorrelatedSubqueryWithAggWindowFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/CorrelatedSubqueryWithAggWindowFunc.mdp @@ -238,7 +238,7 @@ explain select C.i from C where C.i in (select avg(i) over (partition by i) from - + @@ -272,7 +272,7 @@ explain select C.i from C where C.i in (select avg(i) over (partition by i) from - + diff --git a/src/backend/gporca/data/dxl/minidump/Correlation-With-Casting-1.mdp b/src/backend/gporca/data/dxl/minidump/Correlation-With-Casting-1.mdp index 543c6ffcdfe..46a27730660 100644 --- a/src/backend/gporca/data/dxl/minidump/Correlation-With-Casting-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/Correlation-With-Casting-1.mdp @@ -431,7 +431,7 @@ AND u_folio = (SELECT max(u_folio) FROM q68t792_temp c WHERE a.u_vtgnr = c.u_vt - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-ComputeScalar-With-Outerref.mdp b/src/backend/gporca/data/dxl/minidump/DML-ComputeScalar-With-Outerref.mdp index f537e3d0550..ef4c5679e36 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-ComputeScalar-With-Outerref.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-ComputeScalar-With-Outerref.mdp @@ -26,7 +26,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-Filter-With-OuterRef.mdp b/src/backend/gporca/data/dxl/minidump/DML-Filter-With-OuterRef.mdp index 1a2b5b07578..bd7d5cb7209 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-Filter-With-OuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-Filter-With-OuterRef.mdp @@ -50,7 +50,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-OuterRef.mdp b/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-OuterRef.mdp index da19e263ee3..df13fa746e4 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-OuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-OuterRef.mdp @@ -52,7 +52,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -248,7 +248,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-Universal-Child.mdp b/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-Universal-Child.mdp index 97825d3d17f..1772e9838d4 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-Universal-Child.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-UnionAll-With-Universal-Child.mdp @@ -25,7 +25,7 @@ - + @@ -56,7 +56,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-Volatile-Function.mdp b/src/backend/gporca/data/dxl/minidump/DML-Volatile-Function.mdp index efb354542d8..69ebe62080d 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-Volatile-Function.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-Volatile-Function.mdp @@ -135,7 +135,7 @@ - + @@ -166,7 +166,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-With-CorrelatedNLJ-With-Universal-Child.mdp b/src/backend/gporca/data/dxl/minidump/DML-With-CorrelatedNLJ-With-Universal-Child.mdp index fbba4c10c8d..ec7d031524e 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-With-CorrelatedNLJ-With-Universal-Child.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-With-CorrelatedNLJ-With-Universal-Child.mdp @@ -44,7 +44,7 @@ - + @@ -74,7 +74,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-With-HJ-And-UniversalChild.mdp b/src/backend/gporca/data/dxl/minidump/DML-With-HJ-And-UniversalChild.mdp index 081b04ae8d6..df10e394157 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-With-HJ-And-UniversalChild.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-With-HJ-And-UniversalChild.mdp @@ -26,7 +26,7 @@ - + @@ -191,7 +191,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-With-Join-With-Universal-Child.mdp b/src/backend/gporca/data/dxl/minidump/DML-With-Join-With-Universal-Child.mdp index 556d00edcfc..a7c0f92844a 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-With-Join-With-Universal-Child.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-With-Join-With-Universal-Child.mdp @@ -27,7 +27,7 @@ - + @@ -60,7 +60,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-With-MasterOnlyTable-1.mdp b/src/backend/gporca/data/dxl/minidump/DML-With-MasterOnlyTable-1.mdp index 46dbc935952..3f5836be235 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-With-MasterOnlyTable-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-With-MasterOnlyTable-1.mdp @@ -37,7 +37,7 @@ - + @@ -230,7 +230,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DML-With-WindowFunc-OuterRef.mdp b/src/backend/gporca/data/dxl/minidump/DML-With-WindowFunc-OuterRef.mdp index bc985178721..9ac19765eb4 100644 --- a/src/backend/gporca/data/dxl/minidump/DML-With-WindowFunc-OuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/DML-With-WindowFunc-OuterRef.mdp @@ -203,7 +203,7 @@ - + @@ -237,7 +237,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DPE-IN.mdp b/src/backend/gporca/data/dxl/minidump/DPE-IN.mdp index 9d4dc9af586..e1759e20e53 100644 --- a/src/backend/gporca/data/dxl/minidump/DPE-IN.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPE-IN.mdp @@ -66,7 +66,7 @@ select * from P,X where P.a=X.a and X.a in (1,2); - + @@ -114,7 +114,7 @@ select * from P,X where P.a=X.a and X.a in (1,2); - + @@ -162,7 +162,7 @@ select * from P,X where P.a=X.a and X.a in (1,2); - + diff --git a/src/backend/gporca/data/dxl/minidump/DPE-NOT-IN.mdp b/src/backend/gporca/data/dxl/minidump/DPE-NOT-IN.mdp index d09127a81ef..594544a0b1e 100644 --- a/src/backend/gporca/data/dxl/minidump/DPE-NOT-IN.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPE-NOT-IN.mdp @@ -66,7 +66,7 @@ select * from P,X where P.a=X.a and X.a not in (1,2); - + @@ -114,7 +114,7 @@ select * from P,X where P.a=X.a and X.a not in (1,2); - + @@ -162,7 +162,7 @@ select * from P,X where P.a=X.a and X.a not in (1,2); - + diff --git a/src/backend/gporca/data/dxl/minidump/DPE-SemiJoin.mdp b/src/backend/gporca/data/dxl/minidump/DPE-SemiJoin.mdp index 31ac6c8cae5..55bb92f14e5 100644 --- a/src/backend/gporca/data/dxl/minidump/DPE-SemiJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPE-SemiJoin.mdp @@ -798,7 +798,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -834,7 +834,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -870,7 +870,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -1313,7 +1313,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -1324,7 +1324,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -1342,7 +1342,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -1352,7 +1352,7 @@ Select * from X where X.a < ANY (select a from P); - + @@ -1361,9 +1361,9 @@ Select * from X where X.a < ANY (select a from P); - + - + diff --git a/src/backend/gporca/data/dxl/minidump/DPE-with-unsupported-pred.mdp b/src/backend/gporca/data/dxl/minidump/DPE-with-unsupported-pred.mdp index b4023be171a..ffc552c40c2 100644 --- a/src/backend/gporca/data/dxl/minidump/DPE-with-unsupported-pred.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPE-with-unsupported-pred.mdp @@ -44,7 +44,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -343,7 +343,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -1014,7 +1014,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DPv2GreedyOnly.mdp b/src/backend/gporca/data/dxl/minidump/DPv2GreedyOnly.mdp index 197a58d1ba6..a68c996bd48 100644 --- a/src/backend/gporca/data/dxl/minidump/DPv2GreedyOnly.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPv2GreedyOnly.mdp @@ -43,7 +43,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DPv2MinCardOnly.mdp b/src/backend/gporca/data/dxl/minidump/DPv2MinCardOnly.mdp index 9adcb71d85e..7df03006876 100644 --- a/src/backend/gporca/data/dxl/minidump/DPv2MinCardOnly.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPv2MinCardOnly.mdp @@ -43,7 +43,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DPv2QueryOnly.mdp b/src/backend/gporca/data/dxl/minidump/DPv2QueryOnly.mdp index e6ba95258cd..ca21d7ae0b6 100644 --- a/src/backend/gporca/data/dxl/minidump/DPv2QueryOnly.mdp +++ b/src/backend/gporca/data/dxl/minidump/DPv2QueryOnly.mdp @@ -43,7 +43,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate1.mdp b/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate1.mdp index 044c779f718..67dee1e692b 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate1.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate1.mdp @@ -35,7 +35,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate2.mdp b/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate2.mdp index 4a4ef26160b..6b842edca96 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate2.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-GroupBy-HashAggregate2.mdp @@ -38,7 +38,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-InnerJoin-GroupBy-HashAggregate.mdp b/src/backend/gporca/data/dxl/minidump/DQA-InnerJoin-GroupBy-HashAggregate.mdp index 605ece30509..79acfeb9cb0 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-InnerJoin-GroupBy-HashAggregate.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-InnerJoin-GroupBy-HashAggregate.mdp @@ -223,7 +223,7 @@ - + @@ -260,7 +260,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-KeepOuterReference.mdp b/src/backend/gporca/data/dxl/minidump/DQA-KeepOuterReference.mdp index c5590032151..32157c6282f 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-KeepOuterReference.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-KeepOuterReference.mdp @@ -128,7 +128,7 @@ select (select distinct tint.c from tint as tt) x from tint; - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-NonRedistributableCol.mdp b/src/backend/gporca/data/dxl/minidump/DQA-NonRedistributableCol.mdp index bbe9d2647b8..b2c91142151 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-NonRedistributableCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-NonRedistributableCol.mdp @@ -36,7 +36,7 @@ explain select count(distinct h) from testhstore; - + diff --git a/src/backend/gporca/data/dxl/minidump/DQA-SplitScalarOnDistCol.mdp b/src/backend/gporca/data/dxl/minidump/DQA-SplitScalarOnDistCol.mdp index e307e719962..aa920ebdeca 100644 --- a/src/backend/gporca/data/dxl/minidump/DQA-SplitScalarOnDistCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/DQA-SplitScalarOnDistCol.mdp @@ -33,7 +33,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DTS-Hetrogeneous-Partitioned.mdp b/src/backend/gporca/data/dxl/minidump/DTS-Hetrogeneous-Partitioned.mdp index 6afe85840a3..81d650e5907 100644 --- a/src/backend/gporca/data/dxl/minidump/DTS-Hetrogeneous-Partitioned.mdp +++ b/src/backend/gporca/data/dxl/minidump/DTS-Hetrogeneous-Partitioned.mdp @@ -136,7 +136,7 @@ explain select * from t; - + @@ -184,7 +184,7 @@ explain select * from t; - + @@ -226,7 +226,7 @@ explain select * from t; - + @@ -273,7 +273,7 @@ explain select * from t; - + diff --git a/src/backend/gporca/data/dxl/minidump/Delete-Check-AssignedQueryIdForTargetRel.mdp b/src/backend/gporca/data/dxl/minidump/Delete-Check-AssignedQueryIdForTargetRel.mdp new file mode 100644 index 00000000000..eb248df5bbc --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/Delete-Check-AssignedQueryIdForTargetRel.mdp @@ -0,0 +1,458 @@ + + + 10); + + Physical plan: + + QUERY PLAN + --------------------------------------------------------------------------------------------------- + Delete on test (cost=0.00..862.02 rows=1 width=1) + -> Hash Semi Join (cost=0.00..862.00 rows=1 width=14) + Hash Cond: (test.i = test_1.i) + -> Seq Scan on test (cost=0.00..431.00 rows=1 width=14) + -> Hash (cost=431.00..431.00 rows=3 width=4) + -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=3 width=4) + -> Seq Scan on test test_1 (cost=0.00..431.00 rows=1 width=4) + Filter: (i > 10) + Optimizer: Pivotal Optimizer (GPORCA) + (9 rows) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Delete-With-Limit-In-Subquery.mdp b/src/backend/gporca/data/dxl/minidump/Delete-With-Limit-In-Subquery.mdp index cd55ab698f5..4536d4c97a9 100644 --- a/src/backend/gporca/data/dxl/minidump/Delete-With-Limit-In-Subquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/Delete-With-Limit-In-Subquery.mdp @@ -155,7 +155,7 @@ - + @@ -186,7 +186,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DeleteMismatchedDistribution.mdp b/src/backend/gporca/data/dxl/minidump/DeleteMismatchedDistribution.mdp index 6a347b42378..ea90aa49d7c 100644 --- a/src/backend/gporca/data/dxl/minidump/DeleteMismatchedDistribution.mdp +++ b/src/backend/gporca/data/dxl/minidump/DeleteMismatchedDistribution.mdp @@ -215,7 +215,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -424,7 +424,7 @@ - + @@ -478,7 +478,7 @@ - + @@ -533,7 +533,7 @@ - + @@ -668,7 +668,7 @@ - + @@ -698,7 +698,7 @@ - + @@ -724,7 +724,7 @@ - + @@ -753,7 +753,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTable.mdp index 3d5f6d09912..3afa32539e7 100644 --- a/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTable.mdp @@ -31,7 +31,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTableJoin.mdp b/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTableJoin.mdp index ac9f68d21f9..7ef597108c5 100644 --- a/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTableJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/DeleteRandomlyDistributedTableJoin.mdp @@ -139,7 +139,7 @@ - + @@ -170,7 +170,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-DynamicIndexScan.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-DynamicIndexScan.mdp index 7b34166250a..fe205d54d21 100644 --- a/src/backend/gporca/data/dxl/minidump/DirectDispatch-DynamicIndexScan.mdp +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-DynamicIndexScan.mdp @@ -222,7 +222,7 @@ where a=1 and b>0; - + @@ -275,7 +275,7 @@ where a=1 and b>0; - + @@ -328,7 +328,7 @@ where a=1 and b>0; - + @@ -381,7 +381,7 @@ where a=1 and b>0; - + @@ -434,7 +434,7 @@ where a=1 and b>0; - + @@ -487,7 +487,7 @@ where a=1 and b>0; - + @@ -632,7 +632,7 @@ where a=1 and b>0; - + @@ -685,7 +685,7 @@ where a=1 and b>0; - + @@ -738,7 +738,7 @@ where a=1 and b>0; - + @@ -791,7 +791,7 @@ where a=1 and b>0; - + @@ -844,7 +844,7 @@ where a=1 and b>0; - + @@ -897,7 +897,7 @@ where a=1 and b>0; - + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-MultiCol-Conjunction.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-MultiCol-Conjunction.mdp index a4c2fa090ae..4669c68a9da 100644 --- a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-MultiCol-Conjunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-MultiCol-Conjunction.mdp @@ -154,7 +154,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-SingleCol-Conjunction.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-SingleCol-Conjunction.mdp index 3bf766a4b04..45e5dfd28d7 100644 --- a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-SingleCol-Conjunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId-SingleCol-Conjunction.mdp @@ -155,7 +155,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId.mdp index 8365ef29f69..1637d0aec1c 100644 --- a/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId.mdp +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-GpSegmentId.mdp @@ -20,7 +20,7 @@ select * from foo where gp_segment_id=2; - + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable-Disjunction.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable-Disjunction.mdp new file mode 100644 index 00000000000..78c0d7146ac --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable-Disjunction.mdp @@ -0,0 +1,310 @@ + + + Seq Scan on foo_randdistr (cost=0.00..431.00 rows=1 width=12) + Filter: ((gp_segment_id = 0) OR (gp_segment_id = 1)) + Optimizer: Pivotal Optimizer (GPORCA) + (4 rows) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable.mdp b/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable.mdp new file mode 100644 index 00000000000..1168a9c4c0b --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/DirectDispatch-RandDistTable.mdp @@ -0,0 +1,294 @@ + + + Seq Scan on foo_randdistr (cost=0.00..431.00 rows=1 width=12) + Filter: (gp_segment_id = 0) + Optimizer: Pivotal Optimizer (GPORCA) + (4 rows) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/DiscardRedistributeHashJoin.mdp b/src/backend/gporca/data/dxl/minidump/DiscardRedistributeHashJoin.mdp new file mode 100644 index 00000000000..9ccb7ef6636 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/DiscardRedistributeHashJoin.mdp @@ -0,0 +1,423 @@ + + + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=12) + -> Hash (cost=431.00..431.00 rows=1 width=12) + -> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=12) + -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=12) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Distinct-LegacyOpfamily.mdp b/src/backend/gporca/data/dxl/minidump/Distinct-LegacyOpfamily.mdp index 3cc87e91fe9..95ad4099bdc 100644 --- a/src/backend/gporca/data/dxl/minidump/Distinct-LegacyOpfamily.mdp +++ b/src/backend/gporca/data/dxl/minidump/Distinct-LegacyOpfamily.mdp @@ -25,7 +25,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DistinctAgg-NonSplittable.mdp b/src/backend/gporca/data/dxl/minidump/DistinctAgg-NonSplittable.mdp index 324b2e213cb..6b2632b391e 100644 --- a/src/backend/gporca/data/dxl/minidump/DistinctAgg-NonSplittable.mdp +++ b/src/backend/gporca/data/dxl/minidump/DistinctAgg-NonSplittable.mdp @@ -564,7 +564,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DonotPushPartConstThruLimit.mdp b/src/backend/gporca/data/dxl/minidump/DonotPushPartConstThruLimit.mdp index f5916551c01..60c2647e212 100644 --- a/src/backend/gporca/data/dxl/minidump/DonotPushPartConstThruLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/DonotPushPartConstThruLimit.mdp @@ -27,7 +27,7 @@ select * from (select * from h order by j limit 2) x where j = 2; - + @@ -64,7 +64,7 @@ select * from (select * from h order by j limit 2) x where j = 2; - + @@ -112,7 +112,7 @@ select * from (select * from h order by j limit 2) x where j = 2; - + diff --git a/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-1.mdp b/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-1.mdp index a492116bd1f..5055c755198 100644 --- a/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-1.mdp @@ -89,7 +89,7 @@ Physical plan: - + @@ -215,7 +215,7 @@ Physical plan: - + @@ -252,7 +252,7 @@ Physical plan: - + @@ -300,7 +300,7 @@ Physical plan: - + diff --git a/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-2.mdp b/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-2.mdp index d35fca902af..d3d62ea3661 100644 --- a/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/DontAddRedistributeBeforeInsert-2.mdp @@ -135,7 +135,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DoubleNDVCardinalityEquals.mdp b/src/backend/gporca/data/dxl/minidump/DoubleNDVCardinalityEquals.mdp index d99409850e8..de915486f54 100644 --- a/src/backend/gporca/data/dxl/minidump/DoubleNDVCardinalityEquals.mdp +++ b/src/backend/gporca/data/dxl/minidump/DoubleNDVCardinalityEquals.mdp @@ -54,7 +54,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DqaHavingMax.mdp b/src/backend/gporca/data/dxl/minidump/DqaHavingMax.mdp index 706cc417444..dad79d7d69c 100644 --- a/src/backend/gporca/data/dxl/minidump/DqaHavingMax.mdp +++ b/src/backend/gporca/data/dxl/minidump/DqaHavingMax.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DqaMax.mdp b/src/backend/gporca/data/dxl/minidump/DqaMax.mdp index f90b0da77d7..dd5c2969775 100644 --- a/src/backend/gporca/data/dxl/minidump/DqaMax.mdp +++ b/src/backend/gporca/data/dxl/minidump/DqaMax.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DqaMin.mdp b/src/backend/gporca/data/dxl/minidump/DqaMin.mdp index fd055cc85e4..80f7d1b49a6 100644 --- a/src/backend/gporca/data/dxl/minidump/DqaMin.mdp +++ b/src/backend/gporca/data/dxl/minidump/DqaMin.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DqaNoRedistribute.mdp b/src/backend/gporca/data/dxl/minidump/DqaNoRedistribute.mdp index 4d7bf702999..60b6a7fa27e 100644 --- a/src/backend/gporca/data/dxl/minidump/DqaNoRedistribute.mdp +++ b/src/backend/gporca/data/dxl/minidump/DqaNoRedistribute.mdp @@ -58,7 +58,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DqaSubqueryMax.mdp b/src/backend/gporca/data/dxl/minidump/DqaSubqueryMax.mdp index 0c18fc50c45..7983a740b46 100644 --- a/src/backend/gporca/data/dxl/minidump/DqaSubqueryMax.mdp +++ b/src/backend/gporca/data/dxl/minidump/DqaSubqueryMax.mdp @@ -24,7 +24,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicBitmapBoolOp.mdp b/src/backend/gporca/data/dxl/minidump/DynamicBitmapBoolOp.mdp index 567662757fc..cb9d0ab1bfc 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicBitmapBoolOp.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicBitmapBoolOp.mdp @@ -236,7 +236,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -468,7 +468,7 @@ - + @@ -600,7 +600,7 @@ - + @@ -658,7 +658,7 @@ - + @@ -716,7 +716,7 @@ - + @@ -774,7 +774,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -953,7 +953,7 @@ - + @@ -971,9 +971,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicBitmapIndexScan.mdp b/src/backend/gporca/data/dxl/minidump/DynamicBitmapIndexScan.mdp index f22992a5da6..499d743f117 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicBitmapIndexScan.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicBitmapIndexScan.mdp @@ -18,7 +18,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -189,7 +189,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -286,7 +286,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -322,7 +322,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -366,7 +366,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -410,7 +410,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -454,7 +454,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -498,7 +498,7 @@ see sql/DynamicBitmapIndexScan.sql - + @@ -685,7 +685,7 @@ see sql/DynamicBitmapIndexScan.sql - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Basic.mdp b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Basic.mdp index 94be4409915..245cd718c7d 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Basic.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Basic.mdp @@ -53,7 +53,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -368,7 +368,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -580,7 +580,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Heterogeneous.mdp b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Heterogeneous.mdp index d766f0f3132..4011e55dc34 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Heterogeneous.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-Heterogeneous.mdp @@ -191,7 +191,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -303,7 +303,7 @@ - + @@ -359,7 +359,7 @@ - + @@ -415,7 +415,7 @@ - + @@ -519,7 +519,7 @@ - + @@ -575,7 +575,7 @@ - + @@ -631,7 +631,7 @@ - + @@ -687,7 +687,7 @@ - + @@ -743,7 +743,7 @@ - + @@ -893,7 +893,7 @@ - + @@ -908,9 +908,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-UUID.mdp b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-UUID.mdp index 3e6da8b72d6..9fe3b40f638 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-UUID.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicBitmapTableScan-UUID.mdp @@ -36,7 +36,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -409,7 +409,7 @@ - + @@ -421,9 +421,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexGet-OuterRefs.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexGet-OuterRefs.mdp index 9582d7d6352..ae459098e18 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexGet-OuterRefs.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexGet-OuterRefs.mdp @@ -192,7 +192,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -492,7 +492,7 @@ - + @@ -642,7 +642,7 @@ - + @@ -792,7 +792,7 @@ - + @@ -942,7 +942,7 @@ - + @@ -1092,7 +1092,7 @@ - + @@ -1242,7 +1242,7 @@ - + @@ -1392,7 +1392,7 @@ - + @@ -1542,7 +1542,7 @@ - + @@ -1692,7 +1692,7 @@ - + @@ -1842,7 +1842,7 @@ - + @@ -1994,7 +1994,7 @@ - + @@ -2144,7 +2144,7 @@ - + @@ -2360,7 +2360,7 @@ - + @@ -2510,7 +2510,7 @@ - + @@ -2660,7 +2660,7 @@ - + @@ -2823,7 +2823,7 @@ - + @@ -2973,7 +2973,7 @@ - + @@ -3123,7 +3123,7 @@ - + @@ -3273,7 +3273,7 @@ - + @@ -3423,7 +3423,7 @@ - + @@ -3573,7 +3573,7 @@ - + @@ -3774,7 +3774,7 @@ - + @@ -3924,7 +3924,7 @@ - + @@ -4091,7 +4091,7 @@ - + @@ -4241,7 +4241,7 @@ - + @@ -4391,7 +4391,7 @@ - + @@ -4541,7 +4541,7 @@ - + @@ -4691,7 +4691,7 @@ - + @@ -4841,7 +4841,7 @@ - + @@ -5008,7 +5008,7 @@ - + @@ -5158,7 +5158,7 @@ - + @@ -5308,7 +5308,7 @@ - + @@ -5496,7 +5496,7 @@ - + @@ -5646,7 +5646,7 @@ - + @@ -5796,7 +5796,7 @@ - + @@ -6057,7 +6057,7 @@ - + @@ -6207,7 +6207,7 @@ - + @@ -6357,7 +6357,7 @@ - + @@ -6507,7 +6507,7 @@ - + @@ -6657,7 +6657,7 @@ - + @@ -6807,7 +6807,7 @@ - + @@ -6957,7 +6957,7 @@ - + @@ -7107,7 +7107,7 @@ - + @@ -7257,7 +7257,7 @@ - + @@ -7407,7 +7407,7 @@ - + @@ -7557,7 +7557,7 @@ - + @@ -7707,7 +7707,7 @@ - + @@ -7962,7 +7962,7 @@ - + @@ -8112,7 +8112,7 @@ - + @@ -8262,7 +8262,7 @@ - + @@ -8412,7 +8412,7 @@ - + @@ -8562,7 +8562,7 @@ - + @@ -8712,7 +8712,7 @@ - + @@ -8862,7 +8862,7 @@ - + @@ -9012,7 +9012,7 @@ - + @@ -9163,7 +9163,7 @@ - + @@ -9313,7 +9313,7 @@ - + @@ -9463,7 +9463,7 @@ - + @@ -9549,7 +9549,7 @@ - + @@ -9699,7 +9699,7 @@ - + @@ -9849,7 +9849,7 @@ - + @@ -9999,7 +9999,7 @@ - + @@ -10149,7 +10149,7 @@ - + @@ -10299,7 +10299,7 @@ - + @@ -10449,7 +10449,7 @@ - + @@ -10599,7 +10599,7 @@ - + @@ -10749,7 +10749,7 @@ - + @@ -10899,7 +10899,7 @@ - + @@ -11049,7 +11049,7 @@ - + @@ -11199,7 +11199,7 @@ - + @@ -11349,7 +11349,7 @@ - + @@ -11500,7 +11500,7 @@ - + @@ -11650,7 +11650,7 @@ - + @@ -11800,7 +11800,7 @@ - + @@ -11859,7 +11859,7 @@ - + @@ -12009,7 +12009,7 @@ - + @@ -12140,7 +12140,7 @@ - + @@ -12320,7 +12320,7 @@ - + @@ -12470,7 +12470,7 @@ - + @@ -12621,7 +12621,7 @@ - + @@ -12771,7 +12771,7 @@ - + @@ -12894,7 +12894,7 @@ - + @@ -13057,7 +13057,7 @@ - + @@ -13207,7 +13207,7 @@ - + @@ -13357,7 +13357,7 @@ - + @@ -13507,7 +13507,7 @@ - + @@ -13657,7 +13657,7 @@ - + @@ -13807,7 +13807,7 @@ - + @@ -13957,7 +13957,7 @@ - + @@ -14107,7 +14107,7 @@ - + @@ -14238,7 +14238,7 @@ - + @@ -14388,7 +14388,7 @@ - + @@ -14538,7 +14538,7 @@ - + @@ -14688,7 +14688,7 @@ - + @@ -14838,7 +14838,7 @@ - + @@ -14988,7 +14988,7 @@ - + @@ -15119,7 +15119,7 @@ - + @@ -15269,7 +15269,7 @@ - + @@ -15419,7 +15419,7 @@ - + @@ -15550,7 +15550,7 @@ - + @@ -15700,7 +15700,7 @@ - + @@ -15850,7 +15850,7 @@ - + @@ -16000,7 +16000,7 @@ - + @@ -16150,7 +16150,7 @@ - + @@ -16300,7 +16300,7 @@ - + @@ -16450,7 +16450,7 @@ - + @@ -16600,7 +16600,7 @@ - + @@ -16750,7 +16750,7 @@ - + @@ -16900,7 +16900,7 @@ - + @@ -17050,7 +17050,7 @@ - + @@ -17200,7 +17200,7 @@ - + @@ -17350,7 +17350,7 @@ - + @@ -17500,7 +17500,7 @@ - + @@ -17650,7 +17650,7 @@ - + @@ -17800,7 +17800,7 @@ - + @@ -17931,7 +17931,7 @@ - + @@ -18081,7 +18081,7 @@ - + @@ -18231,7 +18231,7 @@ - + @@ -18382,7 +18382,7 @@ - + @@ -18532,7 +18532,7 @@ - + @@ -18685,7 +18685,7 @@ - + @@ -18835,7 +18835,7 @@ - + @@ -18985,7 +18985,7 @@ - + @@ -19135,7 +19135,7 @@ - + @@ -19285,7 +19285,7 @@ - + @@ -19435,7 +19435,7 @@ - + @@ -19585,7 +19585,7 @@ - + @@ -19735,7 +19735,7 @@ - + @@ -19885,7 +19885,7 @@ - + @@ -20052,7 +20052,7 @@ - + @@ -20215,7 +20215,7 @@ - + @@ -20365,7 +20365,7 @@ - + @@ -20515,7 +20515,7 @@ - + @@ -20665,7 +20665,7 @@ - + @@ -20815,7 +20815,7 @@ - + @@ -20965,7 +20965,7 @@ - + @@ -21115,7 +21115,7 @@ - + @@ -21265,7 +21265,7 @@ - + @@ -21415,7 +21415,7 @@ - + @@ -21565,7 +21565,7 @@ - + @@ -21716,7 +21716,7 @@ - + @@ -21866,7 +21866,7 @@ - + @@ -22016,7 +22016,7 @@ - + @@ -22166,7 +22166,7 @@ - + @@ -22316,7 +22316,7 @@ - + @@ -22466,7 +22466,7 @@ - + @@ -22616,7 +22616,7 @@ - + @@ -22766,7 +22766,7 @@ - + @@ -22916,7 +22916,7 @@ - + @@ -23070,7 +23070,7 @@ - + @@ -23220,7 +23220,7 @@ - + @@ -23370,7 +23370,7 @@ - + @@ -23520,7 +23520,7 @@ - + @@ -23670,7 +23670,7 @@ - + @@ -23820,7 +23820,7 @@ - + @@ -23970,7 +23970,7 @@ - + @@ -24120,7 +24120,7 @@ - + @@ -24270,7 +24270,7 @@ - + @@ -24420,7 +24420,7 @@ - + @@ -24570,7 +24570,7 @@ - + @@ -24722,7 +24722,7 @@ - + @@ -24872,7 +24872,7 @@ - + @@ -25022,7 +25022,7 @@ - + @@ -25172,7 +25172,7 @@ - + @@ -25322,7 +25322,7 @@ - + @@ -25472,7 +25472,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexGetDroppedCols.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexGetDroppedCols.mdp index b40d909d586..22000b0db7a 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexGetDroppedCols.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexGetDroppedCols.mdp @@ -1713,7 +1713,7 @@ EXPLAIN SELECT * FROM solo WHERE year_id=2017 AND month_id=6; - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolFalse.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolFalse.mdp index 5dfd214984f..b3d41c33def 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolFalse.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolFalse.mdp @@ -99,7 +99,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -578,7 +578,7 @@ - + @@ -631,7 +631,7 @@ - + @@ -684,7 +684,7 @@ - + @@ -737,7 +737,7 @@ - + @@ -827,7 +827,7 @@ - + @@ -842,7 +842,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolTrue.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolTrue.mdp index 494736b6a1f..197af97c50b 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolTrue.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-BoolTrue.mdp @@ -99,7 +99,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -578,7 +578,7 @@ - + @@ -631,7 +631,7 @@ - + @@ -684,7 +684,7 @@ - + @@ -737,7 +737,7 @@ - + @@ -825,7 +825,7 @@ - + @@ -840,7 +840,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition-2.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition-2.mdp index 1088195aa59..b4c38a95825 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition-2.mdp @@ -551,7 +551,7 @@ - + @@ -605,7 +605,7 @@ - + @@ -659,7 +659,7 @@ - + @@ -713,7 +713,7 @@ - + @@ -767,7 +767,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition.mdp index 39fd23d56ad..7096750aded 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DefaultPartition.mdp @@ -231,7 +231,7 @@ - + @@ -284,7 +284,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -390,7 +390,7 @@ - + @@ -443,7 +443,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedCols.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedCols.mdp index 60d8c939585..f9ec59898aa 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedCols.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedCols.mdp @@ -165,7 +165,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -273,7 +273,7 @@ - + @@ -452,7 +452,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedColumns.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedColumns.mdp index a1b3f3992ff..92342c5f8cd 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-DroppedColumns.mdp @@ -143,7 +143,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -253,7 +253,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -665,7 +665,7 @@ - + @@ -720,7 +720,7 @@ - + @@ -775,7 +775,7 @@ - + @@ -830,7 +830,7 @@ - + @@ -885,7 +885,7 @@ - + @@ -940,7 +940,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-EnabledDateConstraint.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-EnabledDateConstraint.mdp index 1d3355e4c9c..dbb13c4d3c7 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-EnabledDateConstraint.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-EnabledDateConstraint.mdp @@ -249,7 +249,7 @@ - + @@ -302,7 +302,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -408,7 +408,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-NoDTS.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-NoDTS.mdp index 42a951d741e..06e8f6742cd 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-NoDTS.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-NoDTS.mdp @@ -238,7 +238,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -340,7 +340,7 @@ - + @@ -391,7 +391,7 @@ - + @@ -442,7 +442,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Overlapping.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Overlapping.mdp index cddc4cc44dd..d4af061aff3 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Overlapping.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Overlapping.mdp @@ -240,7 +240,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -393,7 +393,7 @@ - + @@ -444,7 +444,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectEquality.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectEquality.mdp index dd42cbb62c6..276483d9f21 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectEquality.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectEquality.mdp @@ -230,7 +230,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -430,7 +430,7 @@ - + @@ -738,7 +738,7 @@ - + @@ -788,7 +788,7 @@ - + @@ -838,7 +838,7 @@ - + @@ -888,7 +888,7 @@ - + @@ -938,7 +938,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectRange.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectRange.mdp index 768c666c9dc..fce71db7739 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-PartSelectRange.mdp @@ -230,7 +230,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -430,7 +430,7 @@ - + @@ -738,7 +738,7 @@ - + @@ -788,7 +788,7 @@ - + @@ -838,7 +838,7 @@ - + @@ -888,7 +888,7 @@ - + @@ -938,7 +938,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Union.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Union.mdp index 60a27816c39..3ee181ba225 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Union.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-Union.mdp @@ -129,7 +129,7 @@ - + @@ -175,7 +175,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -325,7 +325,7 @@ - + @@ -375,7 +375,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -475,7 +475,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -575,7 +575,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-UnsupportedConstraint.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-UnsupportedConstraint.mdp index 222f6df62c6..02cc7b132a1 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-UnsupportedConstraint.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous-UnsupportedConstraint.mdp @@ -221,7 +221,7 @@ - + @@ -274,7 +274,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous.mdp index 1f37fd3b7c6..6d36045a960 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Heterogenous.mdp @@ -237,7 +237,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -390,7 +390,7 @@ - + @@ -441,7 +441,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-EnabledDateConstraint.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-EnabledDateConstraint.mdp index d49cad64e74..2168bd413c9 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-EnabledDateConstraint.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-EnabledDateConstraint.mdp @@ -256,7 +256,7 @@ - + @@ -310,7 +310,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-UnsupportedConstraint.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-UnsupportedConstraint.mdp index 8d3d6f2ea5e..9d847f1a86f 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-UnsupportedConstraint.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous-UnsupportedConstraint.mdp @@ -240,7 +240,7 @@ - + @@ -294,7 +294,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous.mdp index 2f930d6f87a..268d4e323cc 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Homogenous.mdp @@ -176,7 +176,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -322,7 +322,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -472,7 +472,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -622,7 +622,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-OpenEndedPartitions.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-OpenEndedPartitions.mdp index 023a35ce60d..bd70dc97e8b 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-OpenEndedPartitions.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-OpenEndedPartitions.mdp @@ -129,7 +129,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -575,7 +575,7 @@ - + @@ -625,7 +625,7 @@ - + @@ -675,7 +675,7 @@ - + @@ -725,7 +725,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Relabel.mdp b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Relabel.mdp index 2c0dad7bb94..046b3a817eb 100644 --- a/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Relabel.mdp +++ b/src/backend/gporca/data/dxl/minidump/DynamicIndexScan-Relabel.mdp @@ -160,7 +160,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -360,7 +360,7 @@ - + @@ -482,7 +482,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -582,7 +582,7 @@ - + @@ -632,7 +632,7 @@ - + @@ -682,7 +682,7 @@ - + @@ -1240,7 +1240,7 @@ - + @@ -1252,7 +1252,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggEmptyInput.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggEmptyInput.mdp index 9168e6f754c..df441920d6e 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggEmptyInput.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggEmptyInput.mdp @@ -30,7 +30,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggExpression.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggExpression.mdp index 4c201bcb4ae..edf182a53ec 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggExpression.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggExpression.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggGroupColumnInJoin.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggGroupColumnInJoin.mdp index 3bfc4a65b5e..1ace1f84bf5 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggGroupColumnInJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggGroupColumnInJoin.mdp @@ -49,7 +49,7 @@ - + @@ -86,7 +86,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggMax.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggMax.mdp index d5997e70cf0..c8342b75e50 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggMax.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggMax.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggMaxWithNestedLoop.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggMaxWithNestedLoop.mdp index 649d2110c1c..87c590daa08 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggMaxWithNestedLoop.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggMaxWithNestedLoop.mdp @@ -65,7 +65,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -2532,7 +2532,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggMinMax.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggMinMax.mdp index 046fe136408..7b30c24dbee 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggMinMax.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggMinMax.mdp @@ -30,7 +30,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggSubquery.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggSubquery.mdp index be38ac32adc..20a3bc6933b 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggSubquery.mdp @@ -57,7 +57,7 @@ - + @@ -94,7 +94,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EagerAggUnsupportedAgg.mdp b/src/backend/gporca/data/dxl/minidump/EagerAggUnsupportedAgg.mdp index 82e05ca934d..1379e24bb45 100644 --- a/src/backend/gporca/data/dxl/minidump/EagerAggUnsupportedAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/EagerAggUnsupportedAgg.mdp @@ -51,7 +51,7 @@ - + @@ -88,7 +88,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin2.mdp b/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin2.mdp index 10f3166fdfc..c7e375df4da 100644 --- a/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin2.mdp +++ b/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin2.mdp @@ -3894,7 +3894,7 @@ - + @@ -4020,7 +4020,7 @@ - + @@ -4261,7 +4261,7 @@ - + @@ -4387,7 +4387,7 @@ - + @@ -6412,7 +6412,7 @@ - + @@ -6514,7 +6514,7 @@ - + @@ -6616,7 +6616,7 @@ - + @@ -6718,7 +6718,7 @@ - + @@ -6820,7 +6820,7 @@ - + @@ -11319,9 +11319,9 @@ - + - + @@ -11386,10 +11386,16 @@ - - + + + + + + + + - + @@ -11454,16 +11460,10 @@ - - - - - - - - + + - + @@ -11567,117 +11567,77 @@ - + + + + + + + + + + + + + - + - - - - - - - + + + - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin3.mdp b/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin3.mdp index d28b586ef03..2d63b02e440 100644 --- a/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin3.mdp +++ b/src/backend/gporca/data/dxl/minidump/EffectOfLocalPredOnJoin3.mdp @@ -260,7 +260,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -548,7 +548,7 @@ - + @@ -692,7 +692,7 @@ - + @@ -836,7 +836,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EqualityPredicateOverDate.mdp b/src/backend/gporca/data/dxl/minidump/EqualityPredicateOverDate.mdp index a3283095be5..9604032f8e5 100644 --- a/src/backend/gporca/data/dxl/minidump/EqualityPredicateOverDate.mdp +++ b/src/backend/gporca/data/dxl/minidump/EqualityPredicateOverDate.mdp @@ -48,7 +48,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Supported.mdp b/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Supported.mdp index db61382898b..16dea286e47 100644 --- a/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Supported.mdp +++ b/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Supported.mdp @@ -1024,7 +1024,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Unsupported.mdp b/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Unsupported.mdp index d732b3bedad..c4ff1e3994a 100644 --- a/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Unsupported.mdp +++ b/src/backend/gporca/data/dxl/minidump/EquiJoinOnExpr-Unsupported.mdp @@ -39,7 +39,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Equivalence-class-project-over-LOJ.mdp b/src/backend/gporca/data/dxl/minidump/Equivalence-class-project-over-LOJ.mdp index dbe93313b71..03be6f49c3b 100644 --- a/src/backend/gporca/data/dxl/minidump/Equivalence-class-project-over-LOJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/Equivalence-class-project-over-LOJ.mdp @@ -59,7 +59,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ExistentialSubquriesInsideScalarExpression.mdp b/src/backend/gporca/data/dxl/minidump/ExistentialSubquriesInsideScalarExpression.mdp index 23de8c68376..9f683d8823b 100644 --- a/src/backend/gporca/data/dxl/minidump/ExistentialSubquriesInsideScalarExpression.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExistentialSubquriesInsideScalarExpression.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -438,7 +438,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ExistsSubqInsideExpr.mdp b/src/backend/gporca/data/dxl/minidump/ExistsSubqInsideExpr.mdp index 44ce587abbe..38a0b53f6a9 100644 --- a/src/backend/gporca/data/dxl/minidump/ExistsSubqInsideExpr.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExistsSubqInsideExpr.mdp @@ -30,7 +30,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -334,7 +334,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ExpandNAryJoinGreedyWithLOJOnly.mdp b/src/backend/gporca/data/dxl/minidump/ExpandNAryJoinGreedyWithLOJOnly.mdp index e4652246e0c..87cba42586a 100644 --- a/src/backend/gporca/data/dxl/minidump/ExpandNAryJoinGreedyWithLOJOnly.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExpandNAryJoinGreedyWithLOJOnly.mdp @@ -76,7 +76,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -261,7 +261,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ExprOnScSubqueryWithOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/ExprOnScSubqueryWithOuterRef.mdp index 1a19994fc23..f55b9b2c5a8 100644 --- a/src/backend/gporca/data/dxl/minidump/ExprOnScSubqueryWithOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExprOnScSubqueryWithOuterRef.mdp @@ -131,7 +131,7 @@ select (select b from bar) + 1 from foo; - + @@ -168,7 +168,7 @@ select (select b from bar) + 1 from foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/ExtractOneBindingFromScalarGroups.mdp b/src/backend/gporca/data/dxl/minidump/ExtractOneBindingFromScalarGroups.mdp index 4f9a117d357..cacf969883f 100644 --- a/src/backend/gporca/data/dxl/minidump/ExtractOneBindingFromScalarGroups.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExtractOneBindingFromScalarGroups.mdp @@ -29,7 +29,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -138,7 +138,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisj.mdp b/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisj.mdp index 42182061620..3749a52ae6a 100644 --- a/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisj.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisj.mdp @@ -6039,7 +6039,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6150,7 +6150,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6261,7 +6261,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6372,7 +6372,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6483,7 +6483,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6713,7 +6713,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6839,7 +6839,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -6965,7 +6965,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -7091,7 +7091,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + @@ -7217,7 +7217,7 @@ WHERE ((sale_type = 's'::text AND dyear = 2001 AND year_total > 0::numeric) O - + diff --git a/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisjWithComputedColumns.mdp b/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisjWithComputedColumns.mdp index 62d31fd2975..c9586fadb02 100644 --- a/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisjWithComputedColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/ExtractPredicateFromDisjWithComputedColumns.mdp @@ -456,7 +456,7 @@ where (cd.dyear = 2001 and s.tickets_cnt > 3) or (cd.dmoy = 4 and s.tickets_c - + diff --git a/src/backend/gporca/data/dxl/minidump/FOJ-Condition-False.mdp b/src/backend/gporca/data/dxl/minidump/FOJ-Condition-False.mdp index 4a0540260fd..15eceb56d2f 100644 --- a/src/backend/gporca/data/dxl/minidump/FOJ-Condition-False.mdp +++ b/src/backend/gporca/data/dxl/minidump/FOJ-Condition-False.mdp @@ -112,7 +112,7 @@ select * from foo a full join foo b on false; - + diff --git a/src/backend/gporca/data/dxl/minidump/FilterScalarCast.mdp b/src/backend/gporca/data/dxl/minidump/FilterScalarCast.mdp index 543581e940b..14476cb3485 100644 --- a/src/backend/gporca/data/dxl/minidump/FilterScalarCast.mdp +++ b/src/backend/gporca/data/dxl/minidump/FilterScalarCast.mdp @@ -23,7 +23,7 @@ EXPLAIN SELECT * FROM foo WHERE b IN ('xyz', 'asds'); - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-2PredicateOnDistColumns.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-2PredicateOnDistColumns.mdp index e89986aeb9d..27306fd0db0 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-2PredicateOnDistColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-2PredicateOnDistColumns.mdp @@ -174,7 +174,7 @@ - + @@ -208,7 +208,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-Caps.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-Caps.mdp index bac1031a0e8..4025ea6399b 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-Caps.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-Caps.mdp @@ -41,7 +41,7 @@ explain select * from edges e1 full outer join edges e2 on (e1.grp = e2.grp and - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-InnerNotOnDistributionColumn.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-InnerNotOnDistributionColumn.mdp index 58a6de6cfa2..882efc10cb5 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-InnerNotOnDistributionColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-InnerNotOnDistributionColumn.mdp @@ -164,7 +164,7 @@ - + @@ -198,7 +198,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-NonDefaultOpfamily.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-NonDefaultOpfamily.mdp index 4cd2954340c..165de5efc31 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-NonDefaultOpfamily.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-NonDefaultOpfamily.mdp @@ -116,7 +116,7 @@ - + @@ -167,7 +167,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-NotOnDistributionColumn.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-NotOnDistributionColumn.mdp index da29fafea1f..26a85fec4b2 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-NotOnDistributionColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-NotOnDistributionColumn.mdp @@ -174,7 +174,7 @@ - + @@ -208,7 +208,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-NullPredicate.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-NullPredicate.mdp index b0d09ceee3f..1b8af558347 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-NullPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-NullPredicate.mdp @@ -134,7 +134,7 @@ - + @@ -168,7 +168,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-OnDistributionColumn.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-OnDistributionColumn.mdp index a1c93e554ac..5028d66dcc0 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-OnDistributionColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-OnDistributionColumn.mdp @@ -158,7 +158,7 @@ - + @@ -192,7 +192,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-PredicateOnSameTable.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-PredicateOnSameTable.mdp index 98ea4654923..b903d0088fb 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-PredicateOnSameTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-PredicateOnSameTable.mdp @@ -168,7 +168,7 @@ - + @@ -202,7 +202,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-Replicated.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-Replicated.mdp index 0cbe4f48f1e..d1cf398dd58 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-Replicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-Replicated.mdp @@ -141,7 +141,7 @@ - + @@ -175,7 +175,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-Subquery-CastedPredicates.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-Subquery-CastedPredicates.mdp index 0f2437c11e3..d705af538f3 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-Subquery-CastedPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-Subquery-CastedPredicates.mdp @@ -60,7 +60,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -169,7 +169,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-SubquerySingleton.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-SubquerySingleton.mdp index e0bf867ad17..6424a16b3af 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-SubquerySingleton.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-SubquerySingleton.mdp @@ -178,7 +178,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-SubqueryWithRedistribute.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-SubqueryWithRedistribute.mdp index 6f8d18146f0..00ec574a0d9 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-SubqueryWithRedistribute.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-SubqueryWithRedistribute.mdp @@ -165,7 +165,7 @@ - + @@ -199,7 +199,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullJoin-SwappedPredicates.mdp b/src/backend/gporca/data/dxl/minidump/FullJoin-SwappedPredicates.mdp index 8ef3ae32306..9190c29455f 100644 --- a/src/backend/gporca/data/dxl/minidump/FullJoin-SwappedPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullJoin-SwappedPredicates.mdp @@ -158,7 +158,7 @@ - + @@ -192,7 +192,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS1.mdp b/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS1.mdp index 0469f368158..09d24ee12e3 100644 --- a/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS1.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS1.mdp @@ -140,7 +140,7 @@ - + @@ -174,7 +174,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS2.mdp b/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS2.mdp index 65cfdf9df39..0c2f5644dfb 100644 --- a/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS2.mdp +++ b/src/backend/gporca/data/dxl/minidump/FullOuterJoin-NullRejectingLHS2.mdp @@ -191,7 +191,7 @@ - + @@ -243,7 +243,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/GinIndex.mdp b/src/backend/gporca/data/dxl/minidump/GinIndex.mdp index 369fb928492..4e6bc98b0ed 100644 --- a/src/backend/gporca/data/dxl/minidump/GinIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/GinIndex.mdp @@ -139,7 +139,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/GinIndexPathOpfamily.mdp b/src/backend/gporca/data/dxl/minidump/GinIndexPathOpfamily.mdp index a78f8b203f7..b57551df01f 100644 --- a/src/backend/gporca/data/dxl/minidump/GinIndexPathOpfamily.mdp +++ b/src/backend/gporca/data/dxl/minidump/GinIndexPathOpfamily.mdp @@ -139,7 +139,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/GinIndexSearchModeAll.mdp b/src/backend/gporca/data/dxl/minidump/GinIndexSearchModeAll.mdp index 112c6760ead..a184e7cf3b1 100644 --- a/src/backend/gporca/data/dxl/minidump/GinIndexSearchModeAll.mdp +++ b/src/backend/gporca/data/dxl/minidump/GinIndexSearchModeAll.mdp @@ -139,7 +139,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-AOCOTable-NonLossy-BitmapIndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-AOCOTable-NonLossy-BitmapIndexPlan.mdp index 1e7f8f05e23..be89cb98a70 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-AOCOTable-NonLossy-BitmapIndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-AOCOTable-NonLossy-BitmapIndexPlan.mdp @@ -123,7 +123,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..0.00 rows=1 width=4) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Lossy-IndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Lossy-IndexPlan.mdp index 781d6d61663..40278c018da 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Lossy-IndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Lossy-IndexPlan.mdp @@ -57,7 +57,7 @@ - + @@ -101,7 +101,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Postgis-IndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Postgis-IndexPlan.mdp index 13b3b922aee..0884f0d7b68 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Postgis-IndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-NestedLoopJoin-Postgis-IndexPlan.mdp @@ -165,7 +165,7 @@ Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..433.00 rows=1 width=24) - + @@ -209,7 +209,7 @@ Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..433.00 rows=1 width=24) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-BitmapIndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-BitmapIndexPlan.mdp index 65b7200a7dc..e8def207406 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-BitmapIndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-BitmapIndexPlan.mdp @@ -128,7 +128,7 @@ Optimizer status: PQO version 2.65.1 - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-IndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-IndexPlan.mdp index 7dac909ca16..7f39ed60e8f 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-IndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-NonPart-Lossy-IndexPlan.mdp @@ -128,7 +128,7 @@ Optimizer status: PQO version 2.65.1 - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-BitmapPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-BitmapPlan.mdp index 779ba50cf24..a3c41e209c1 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-BitmapPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-BitmapPlan.mdp @@ -198,7 +198,7 @@ Result (cost=0.00..0.00 rows=1 width=36) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-IndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-IndexPlan.mdp index 2476a86fed9..9100156dbe2 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-IndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-OrderBy-IndexPlan.mdp @@ -236,7 +236,7 @@ Result (cost=0.00..8.00 rows=2 width=36) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-PartTable-Lossy-IndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-PartTable-Lossy-IndexPlan.mdp index 211a2d0d147..f8d365a6cad 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-PartTable-Lossy-IndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-PartTable-Lossy-IndexPlan.mdp @@ -172,7 +172,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..6.00 rows=1 width=4) - + @@ -217,7 +217,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..6.00 rows=1 width=4) - + @@ -273,7 +273,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..6.00 rows=1 width=4) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-PartTable-NonLossy-BitmapIndexPlan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-PartTable-NonLossy-BitmapIndexPlan.mdp index e8de20f4ac4..f8e379b8ae5 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-PartTable-NonLossy-BitmapIndexPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-PartTable-NonLossy-BitmapIndexPlan.mdp @@ -211,7 +211,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..0.00 rows=1 width=4) - + @@ -255,7 +255,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..0.00 rows=1 width=4) - + diff --git a/src/backend/gporca/data/dxl/minidump/Gist-PartialIndex-TableScan.mdp b/src/backend/gporca/data/dxl/minidump/Gist-PartialIndex-TableScan.mdp index 3bc5ea31aac..0954f03a81d 100644 --- a/src/backend/gporca/data/dxl/minidump/Gist-PartialIndex-TableScan.mdp +++ b/src/backend/gporca/data/dxl/minidump/Gist-PartialIndex-TableScan.mdp @@ -112,7 +112,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=44) - + @@ -143,7 +143,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=44) - + @@ -184,7 +184,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=44) - + @@ -225,7 +225,7 @@ Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=44) - + diff --git a/src/backend/gporca/data/dxl/minidump/GreedyNAryDelayCrossJoin.mdp b/src/backend/gporca/data/dxl/minidump/GreedyNAryDelayCrossJoin.mdp index 77c594f4a95..c5cf674a61a 100644 --- a/src/backend/gporca/data/dxl/minidump/GreedyNAryDelayCrossJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/GreedyNAryDelayCrossJoin.mdp @@ -1026,7 +1026,7 @@ EXPLAIN SELECT * FROM t1, t2, t3, t4 where b = c; - + @@ -1057,7 +1057,7 @@ EXPLAIN SELECT * FROM t1, t2, t3, t4 where b = c; - + @@ -1088,7 +1088,7 @@ EXPLAIN SELECT * FROM t1, t2, t3, t4 where b = c; - + @@ -1119,7 +1119,7 @@ EXPLAIN SELECT * FROM t1, t2, t3, t4 where b = c; - + diff --git a/src/backend/gporca/data/dxl/minidump/GreedyNAryJoin.mdp b/src/backend/gporca/data/dxl/minidump/GreedyNAryJoin.mdp index a4a11c42607..da7c28e65e4 100644 --- a/src/backend/gporca/data/dxl/minidump/GreedyNAryJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/GreedyNAryJoin.mdp @@ -138,7 +138,7 @@ EXPLAIN SELECT * FROM t1 INNER JOIN t2 ON a =b INNER JOIN t3 ON b = c; - + @@ -169,7 +169,7 @@ EXPLAIN SELECT * FROM t1 INNER JOIN t2 ON a =b INNER JOIN t3 ON b = c; - + @@ -200,7 +200,7 @@ EXPLAIN SELECT * FROM t1 INNER JOIN t2 ON a =b INNER JOIN t3 ON b = c; - + diff --git a/src/backend/gporca/data/dxl/minidump/GreedyNAryJoinWithDisconnectedEdges.mdp b/src/backend/gporca/data/dxl/minidump/GreedyNAryJoinWithDisconnectedEdges.mdp index c66d4849c46..119cdf08d3f 100644 --- a/src/backend/gporca/data/dxl/minidump/GreedyNAryJoinWithDisconnectedEdges.mdp +++ b/src/backend/gporca/data/dxl/minidump/GreedyNAryJoinWithDisconnectedEdges.mdp @@ -1321,7 +1321,7 @@ - + @@ -1355,7 +1355,7 @@ - + @@ -1389,7 +1389,7 @@ - + @@ -1423,7 +1423,7 @@ - + @@ -2253,7 +2253,7 @@ - + @@ -2287,7 +2287,7 @@ - + @@ -2321,7 +2321,7 @@ - + @@ -2355,7 +2355,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/GreedyNAryOnlyCrossJoins.mdp b/src/backend/gporca/data/dxl/minidump/GreedyNAryOnlyCrossJoins.mdp index b4a972582cc..ca101463b1c 100644 --- a/src/backend/gporca/data/dxl/minidump/GreedyNAryOnlyCrossJoins.mdp +++ b/src/backend/gporca/data/dxl/minidump/GreedyNAryOnlyCrossJoins.mdp @@ -532,7 +532,7 @@ EXPLAIN SELECT * FROM t1, t2, t3; - + @@ -961,7 +961,7 @@ EXPLAIN SELECT * FROM t1, t2, t3; - + @@ -992,7 +992,7 @@ EXPLAIN SELECT * FROM t1, t2, t3; - + diff --git a/src/backend/gporca/data/dxl/minidump/HJN-DPE-Bitmap-Outer-Child.mdp b/src/backend/gporca/data/dxl/minidump/HJN-DPE-Bitmap-Outer-Child.mdp index 685929f58b7..6c19249808d 100644 --- a/src/backend/gporca/data/dxl/minidump/HJN-DPE-Bitmap-Outer-Child.mdp +++ b/src/backend/gporca/data/dxl/minidump/HJN-DPE-Bitmap-Outer-Child.mdp @@ -215,7 +215,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -268,7 +268,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -321,7 +321,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -374,7 +374,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -427,7 +427,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -480,7 +480,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -533,7 +533,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -586,7 +586,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -639,7 +639,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -692,7 +692,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -795,7 +795,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -848,7 +848,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -901,7 +901,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -954,7 +954,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1007,7 +1007,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1060,7 +1060,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1113,7 +1113,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1166,7 +1166,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1219,7 +1219,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1272,7 +1272,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1897,7 +1897,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1923,7 +1923,7 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + @@ -1988,9 +1988,9 @@ select * from dbs_target, dbs_helper where dbs_target.c1 = dbs_helper.c1 and dbs - + - + diff --git a/src/backend/gporca/data/dxl/minidump/IN-Nulls-ArrayCmpAny.mdp b/src/backend/gporca/data/dxl/minidump/IN-Nulls-ArrayCmpAny.mdp index 4a17729c09a..23ac2e6e02a 100644 --- a/src/backend/gporca/data/dxl/minidump/IN-Nulls-ArrayCmpAny.mdp +++ b/src/backend/gporca/data/dxl/minidump/IN-Nulls-ArrayCmpAny.mdp @@ -25,7 +25,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IN-Numeric.mdp b/src/backend/gporca/data/dxl/minidump/IN-Numeric.mdp index 71f37be193c..d90f49390fa 100644 --- a/src/backend/gporca/data/dxl/minidump/IN-Numeric.mdp +++ b/src/backend/gporca/data/dxl/minidump/IN-Numeric.mdp @@ -82,7 +82,7 @@ explain select * from t_numeric where c5 in (10, 11); - + @@ -147,7 +147,7 @@ explain select * from t_numeric where c5 in (10, 11); - + diff --git a/src/backend/gporca/data/dxl/minidump/InClauseWithMCV.mdp b/src/backend/gporca/data/dxl/minidump/InClauseWithMCV.mdp index 5129c9e0e6f..30b59f9aa43 100644 --- a/src/backend/gporca/data/dxl/minidump/InClauseWithMCV.mdp +++ b/src/backend/gporca/data/dxl/minidump/InClauseWithMCV.mdp @@ -24,7 +24,7 @@ explain select * from bar where a in (1, (select count(*) from bar)); - + diff --git a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnIn.mdp b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnIn.mdp index 2dacd988068..98d204b1f21 100644 --- a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnIn.mdp +++ b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnIn.mdp @@ -43,7 +43,7 @@ EXPLAIN SELECT * FROM foo WHERE a IN (SELECT b+1 FROM bar); - + @@ -77,7 +77,7 @@ EXPLAIN SELECT * FROM foo WHERE a IN (SELECT b+1 FROM bar); - + @@ -620,7 +620,7 @@ EXPLAIN SELECT * FROM foo WHERE a IN (SELECT b+1 FROM bar); - + diff --git a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnPlusConstIn.mdp b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnPlusConstIn.mdp index d36d0f655e3..f450d5cfca9 100644 --- a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnPlusConstIn.mdp +++ b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefColumnPlusConstIn.mdp @@ -43,7 +43,7 @@ EXPLAIN SELECT * FROM foo WHERE 1+a IN (SELECT b+1 FROM bar); - + @@ -77,7 +77,7 @@ EXPLAIN SELECT * FROM foo WHERE 1+a IN (SELECT b+1 FROM bar); - + @@ -623,7 +623,7 @@ EXPLAIN SELECT * FROM foo WHERE 1+a IN (SELECT b+1 FROM bar); - + diff --git a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefConstIn.mdp b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefConstIn.mdp index fc89dd81895..59330337a82 100644 --- a/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefConstIn.mdp +++ b/src/backend/gporca/data/dxl/minidump/InSubqWithPrjListOuterRefNoInnerRefConstIn.mdp @@ -40,7 +40,7 @@ SELECT * FROM foo WHERE 2 IN (SELECT b+1 FROM bar); - + @@ -74,7 +74,7 @@ SELECT * FROM foo WHERE 2 IN (SELECT b+1 FROM bar); - + @@ -617,7 +617,7 @@ SELECT * FROM foo WHERE 2 IN (SELECT b+1 FROM bar); - + diff --git a/src/backend/gporca/data/dxl/minidump/InSubqueryWithNotNullCol.mdp b/src/backend/gporca/data/dxl/minidump/InSubqueryWithNotNullCol.mdp index 7b254823b83..a9e38cd2e57 100644 --- a/src/backend/gporca/data/dxl/minidump/InSubqueryWithNotNullCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/InSubqueryWithNotNullCol.mdp @@ -62,7 +62,7 @@ select * - + @@ -96,7 +96,7 @@ select * - + diff --git a/src/backend/gporca/data/dxl/minidump/Index-Join-With-Subquery-In-Pred.mdp b/src/backend/gporca/data/dxl/minidump/Index-Join-With-Subquery-In-Pred.mdp index 8391cf3b586..94b58101e02 100644 --- a/src/backend/gporca/data/dxl/minidump/Index-Join-With-Subquery-In-Pred.mdp +++ b/src/backend/gporca/data/dxl/minidump/Index-Join-With-Subquery-In-Pred.mdp @@ -175,7 +175,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + @@ -214,7 +214,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + @@ -347,7 +347,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-BothSidesPartitioned.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-BothSidesPartitioned.mdp index cc4a0d51f9f..e807971a765 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-BothSidesPartitioned.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-BothSidesPartitioned.mdp @@ -238,7 +238,7 @@ select * from x, y where (x.i > y.j); - + @@ -294,7 +294,7 @@ select * from x, y where (x.i > y.j); - + @@ -395,7 +395,7 @@ select * from x, y where (x.i > y.j); - + @@ -451,7 +451,7 @@ select * from x, y where (x.i > y.j); - + @@ -578,7 +578,7 @@ select * from x, y where (x.i > y.j); - + @@ -634,7 +634,7 @@ select * from x, y where (x.i > y.j); - + @@ -735,7 +735,7 @@ select * from x, y where (x.i > y.j); - + @@ -791,7 +791,7 @@ select * from x, y where (x.i > y.j); - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-DTS.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-DTS.mdp index 08cad4191a7..4c0ae165ac5 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-DTS.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-DTS.mdp @@ -305,7 +305,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -365,7 +365,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -425,7 +425,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -536,7 +536,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -596,7 +596,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -656,7 +656,7 @@ WHERE tt.event_ts >= tq.ets AND - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-NoDTS.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-NoDTS.mdp index 068286e57ba..8b81884ebaa 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-NoDTS.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-Heterogeneous-NoDTS.mdp @@ -336,7 +336,7 @@ ORDER BY 1 asc ; - + @@ -396,7 +396,7 @@ ORDER BY 1 asc ; - + @@ -506,7 +506,7 @@ ORDER BY 1 asc ; - + @@ -566,7 +566,7 @@ ORDER BY 1 asc ; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-Heterogeneous-DTS.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-Heterogeneous-DTS.mdp index 3fb97ffab0a..3d5012ba5a0 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-Heterogeneous-DTS.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-Heterogeneous-DTS.mdp @@ -187,7 +187,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -247,7 +247,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -307,7 +307,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -417,7 +417,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -477,7 +477,7 @@ WHERE tt.event_ts >= tq.ets AND - + @@ -537,7 +537,7 @@ WHERE tt.event_ts >= tq.ets AND - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable.mdp index 9e98bf7210f..212ca765a8b 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable.mdp @@ -88,7 +88,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + @@ -153,7 +153,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + @@ -218,7 +218,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + @@ -338,7 +338,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + @@ -403,7 +403,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + @@ -468,7 +468,7 @@ SELECT * FROM s i1, t t2 where t2.c2 = i1.c2 and t2.c1 > 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable2.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable2.mdp index e4132e7acf4..6ad12c7b8ad 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable2.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-InnerSelect-PartTable2.mdp @@ -176,7 +176,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -215,7 +215,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -265,7 +265,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -316,7 +316,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -488,7 +488,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -508,7 +508,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -534,7 +534,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + @@ -581,7 +581,7 @@ select * from bar, (select * from foo where foo.a in (select h.a from bar h, bar - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-LeftOuter-NLJoin.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-LeftOuter-NLJoin.mdp index 391e45d1a3b..58570ca55dd 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-LeftOuter-NLJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-LeftOuter-NLJoin.mdp @@ -87,7 +87,7 @@ explain select * from t0 left join t1 on t0.a=t1.a left join t2 on (t2.a=t0.a an - + @@ -158,7 +158,7 @@ explain select * from t0 left join t1 on t0.a=t1.a left join t2 on (t2.a=t0.a an - + @@ -249,7 +249,7 @@ explain select * from t0 left join t1 on t0.a=t1.a left join t2 on (t2.a=t0.a an - + @@ -283,7 +283,7 @@ explain select * from t0 left join t1 on t0.a=t1.a left join t2 on (t2.a=t0.a an - + @@ -341,7 +341,7 @@ explain select * from t0 left join t1 on t0.a=t1.a left join t2 on (t2.a=t0.a an - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKey-WithComplexPreds.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKey-WithComplexPreds.mdp index 34ca56e7b8c..b581642c241 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKey-WithComplexPreds.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKey-WithComplexPreds.mdp @@ -35,7 +35,7 @@ - + @@ -74,7 +74,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp index 49ee1188b1f..dcd118df73b 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp @@ -143,7 +143,7 @@ - + @@ -177,7 +177,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap.mdp index 5b11211bd6c..6564f7353bd 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-Bitmap.mdp @@ -135,7 +135,7 @@ - + @@ -169,7 +169,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-IncompletePDS-3-DistCols.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-IncompletePDS-3-DistCols.mdp index 7199ee27924..4b338d95f14 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-IncompletePDS-3-DistCols.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-MultiDistKeys-IncompletePDS-3-DistCols.mdp @@ -153,7 +153,7 @@ - + @@ -201,7 +201,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-No-Motion-Below-Join.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-No-Motion-Below-Join.mdp index 6a35fe3e8f2..0b128f35255 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-No-Motion-Below-Join.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-No-Motion-Below-Join.mdp @@ -397,7 +397,7 @@ Table X (int i, int j) is distributed by i, column j has index - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-PartKey-Is-IndexKey.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-PartKey-Is-IndexKey.mdp index 3f4f792f08e..a071b1a8016 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-PartKey-Is-IndexKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-PartKey-Is-IndexKey.mdp @@ -221,7 +221,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -271,7 +271,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -360,7 +360,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -410,7 +410,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -521,7 +521,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -575,7 +575,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -672,7 +672,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + @@ -726,7 +726,7 @@ select z_p.j from z_p,tt_p where z_p.i=6 and z_p.i - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply-PartTable.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply-PartTable.mdp index cd597c58066..cda4d442866 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply-PartTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply-PartTable.mdp @@ -103,7 +103,7 @@ ORDER BY 1 asc ; - + @@ -162,7 +162,7 @@ ORDER BY 1 asc ; - + @@ -221,7 +221,7 @@ ORDER BY 1 asc ; - + @@ -330,7 +330,7 @@ ORDER BY 1 asc ; - + @@ -389,7 +389,7 @@ ORDER BY 1 asc ; - + @@ -448,7 +448,7 @@ ORDER BY 1 asc ; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexApply_NestLoopWithNestParamTrue.mdp b/src/backend/gporca/data/dxl/minidump/IndexApply_NestLoopWithNestParamTrue.mdp index df1c90bcd44..5c01afb8f2b 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexApply_NestLoopWithNestParamTrue.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexApply_NestLoopWithNestParamTrue.mdp @@ -42,7 +42,7 @@ - + @@ -78,7 +78,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexConstraintsMDidCache.mdp b/src/backend/gporca/data/dxl/minidump/IndexConstraintsMDidCache.mdp index 457552fc536..e0db261cd4c 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexConstraintsMDidCache.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexConstraintsMDidCache.mdp @@ -104,7 +104,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexNLJ-IndexGet-OuterRef.mdp b/src/backend/gporca/data/dxl/minidump/IndexNLJ-IndexGet-OuterRef.mdp index 3e014a1c1a3..070977db880 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexNLJ-IndexGet-OuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexNLJ-IndexGet-OuterRef.mdp @@ -26,7 +26,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -1474,7 +1474,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexNLJoin_Cast_NoMotion.mdp b/src/backend/gporca/data/dxl/minidump/IndexNLJoin_Cast_NoMotion.mdp index 134b8851eb2..18e9ff86d95 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexNLJoin_Cast_NoMotion.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexNLJoin_Cast_NoMotion.mdp @@ -176,7 +176,7 @@ explain select * from R1 inner join S1 on a = b union all select * from R2 inner - + @@ -209,7 +209,7 @@ explain select * from R1 inner join S1 on a = b union all select * from R2 inner - + @@ -256,7 +256,7 @@ explain select * from R1 inner join S1 on a = b union all select * from R2 inner - + @@ -277,7 +277,7 @@ explain select * from R1 inner join S1 on a = b union all select * from R2 inner - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddNewPartitionToRootTableContainingHeterogenousIndex.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddNewPartitionToRootTableContainingHeterogenousIndex.mdp index f83f78f504f..e76e833a14d 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddNewPartitionToRootTableContainingHeterogenousIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddNewPartitionToRootTableContainingHeterogenousIndex.mdp @@ -80,7 +80,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -220,7 +220,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -266,7 +266,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -323,7 +323,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddPartitionToRootWithHomogenousIndex.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddPartitionToRootWithHomogenousIndex.mdp index 8c50dc78598..5013dfb9100 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddPartitionToRootWithHomogenousIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-AddPartitionToRootWithHomogenousIndex.mdp @@ -73,7 +73,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -118,7 +118,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -174,7 +174,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + @@ -338,7 +338,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p3 WHERE c > 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-IndexOnPartitionsWithDifferentStorageTypes.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-IndexOnPartitionsWithDifferentStorageTypes.mdp index 7dcc8017bed..6e6cc97efde 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-IndexOnPartitionsWithDifferentStorageTypes.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-IndexOnPartitionsWithDifferentStorageTypes.mdp @@ -113,7 +113,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -144,7 +144,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -178,7 +178,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -223,7 +223,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-AO.mdp index 30ab4a96cf6..0192addf51e 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-AO.mdp @@ -135,18 +135,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 15; - - - - - - - - - - - - @@ -173,7 +161,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 15; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp index aa19d95fb10..c268900c725 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp @@ -179,7 +179,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 12; - + @@ -231,7 +231,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 12; - + @@ -294,7 +294,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 12; - + @@ -358,7 +358,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND f > 12; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp index f8c102836c7..e5f8825f2cb 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp @@ -161,7 +161,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND d > 14; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp index e876c0feecc..26cbdff9c20 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-NonOverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp @@ -143,7 +143,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE e > 20 OR f > 22; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-AO.mdp index 36b940e1aff..35d3724e11b 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-AO.mdp @@ -83,18 +83,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - - - - - - - - - - - - @@ -154,7 +142,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - + @@ -279,30 +267,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp index b52a00d5f56..16bae357079 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ANDPredicate-HEAP.mdp @@ -40,7 +40,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - + @@ -86,7 +86,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - + @@ -143,7 +143,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - + @@ -201,7 +201,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10 AND d > 20; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ORPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ORPredicate-AO.mdp index d0ad5e537fd..8e0f3e8dc0f 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ORPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHeterogenousIndex-ORPredicate-AO.mdp @@ -32,18 +32,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c > 11 OR d > 20; - - - - - - - - - - - - @@ -173,7 +161,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c > 11 OR d > 20; - + @@ -341,30 +329,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c > 11 OR d > 20; - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp index 9b16ec34789..6defbb8d0fa 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ANDPredicate-AO.mdp @@ -158,7 +158,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 10 AND d > 13; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-AO.mdp index 05e812a9d88..ef80e8c559a 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-AO.mdp @@ -131,7 +131,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE d > 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp index ba1adb6f5c8..5a88b1851d3 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-OverlappingHomogenousIndexesOnRoot-ORPredicate-AO.mdp @@ -50,7 +50,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 12 OR d > 13; - + @@ -84,7 +84,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 12 OR d > 13; - + @@ -129,7 +129,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 12 OR d > 13; - + @@ -265,7 +265,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p2 WHERE c > 12 OR d > 13; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-AO.mdp index 7cf13499a01..b681004bad5 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-AO.mdp @@ -123,7 +123,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -155,7 +155,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -189,7 +189,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -234,7 +234,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-HEAP.mdp index 643a00f5f3d..57d7b3c5a28 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-1-HEAP.mdp @@ -169,7 +169,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -215,7 +215,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -272,7 +272,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + @@ -354,7 +354,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE c < 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-AO.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-AO.mdp index cc0031f1844..84e00789b2f 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-AO.mdp @@ -116,34 +116,10 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -207,18 +183,6 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-HEAP.mdp index b453873adbd..91424d911f9 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnLeaf-SingleColumnHeterogenousIndexOnRoot-2-HEAP.mdp @@ -169,7 +169,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - + @@ -215,7 +215,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - + @@ -272,7 +272,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - + @@ -354,7 +354,7 @@ EXPLAIN SELECT * FROM foo_1_prt_p1 WHERE d < 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexOnlyScan-NoDistKeyInIndex.mdp b/src/backend/gporca/data/dxl/minidump/IndexOnlyScan-NoDistKeyInIndex.mdp index 31a9a9175a0..acf67c45e86 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexOnlyScan-NoDistKeyInIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexOnlyScan-NoDistKeyInIndex.mdp @@ -81,7 +81,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexScan-AndedIn.mdp b/src/backend/gporca/data/dxl/minidump/IndexScan-AndedIn.mdp index 1e321dd37aa..c06a6b051df 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexScan-AndedIn.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexScan-AndedIn.mdp @@ -111,7 +111,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsAOPart.mdp b/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsAOPart.mdp index c92639b5aea..0382a630709 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsAOPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsAOPart.mdp @@ -134,7 +134,7 @@ - + @@ -168,7 +168,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -332,7 +332,7 @@ - + @@ -373,7 +373,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsNonPart.mdp b/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsNonPart.mdp index ccc7dfd847e..d582b079cb1 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsNonPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexScan-ORPredsNonPart.mdp @@ -90,7 +90,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexScanWithNestedCTEAndSetOp.mdp b/src/backend/gporca/data/dxl/minidump/IndexScanWithNestedCTEAndSetOp.mdp index 161c0063963..72cf286f7e5 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexScanWithNestedCTEAndSetOp.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexScanWithNestedCTEAndSetOp.mdp @@ -40,7 +40,7 @@ SELECT a FROM y WHERE (a IN (SELECT b FROM bar WHERE b = 2)); - + @@ -73,7 +73,7 @@ SELECT a FROM y WHERE (a IN (SELECT b FROM bar WHERE b = 2)); - + diff --git a/src/backend/gporca/data/dxl/minidump/IndexedNLJBitmap.mdp b/src/backend/gporca/data/dxl/minidump/IndexedNLJBitmap.mdp index 90ade66f656..1483dd47de9 100644 --- a/src/backend/gporca/data/dxl/minidump/IndexedNLJBitmap.mdp +++ b/src/backend/gporca/data/dxl/minidump/IndexedNLJBitmap.mdp @@ -154,7 +154,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -303,7 +303,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -392,7 +392,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicates.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicates.mdp index 029e34286ae..ea582f9980a 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicates.mdp @@ -164,7 +164,7 @@ explain select 1+row_number() over(partition by foo.c) from foo, bar where foo.a - + @@ -203,7 +203,7 @@ explain select 1+row_number() over(partition by foo.c) from foo, bar where foo.a - + @@ -281,7 +281,7 @@ explain select 1+row_number() over(partition by foo.c) from foo, bar where foo.a - + @@ -320,7 +320,7 @@ explain select 1+row_number() over(partition by foo.c) from foo, bar where foo.a - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-oid-oid.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-oid-oid.mdp index 2fdf63ea54c..54e08100712 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-oid-oid.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-oid-oid.mdp @@ -12,17 +12,17 @@ Plan: - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.00 rows=1 width=8) -> Hash Join (cost=0.00..862.00 rows=1 width=8) Hash Cond: (foid.a = foid_1.a) - -> Table Scan on foid (cost=0.00..431.00 rows=1 width=4) + -> Seq Scan on foid (cost=0.00..431.00 rows=1 width=4) + Filter: (a = '5'::oid) -> Hash (cost=431.00..431.00 rows=1 width=4) - -> Table Scan on foid foid_1 (cost=0.00..431.00 rows=1 width=4) - Filter: (a = 5::oid) - Planning time: 162.562 ms - Optimizer: PQO version 3.9.0 + -> Seq Scan on foid foid_1 (cost=0.00..431.00 rows=1 width=4) + Filter: (a = '5'::oid) + Optimizer: Pivotal Optimizer (GPORCA) ]]> @@ -56,7 +56,7 @@ - + @@ -227,7 +227,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -261,14 +261,19 @@ - + - + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-txt-txt.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-txt-txt.mdp index 5373052769e..fc4f0e27455 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-txt-txt.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-txt-txt.mdp @@ -16,17 +16,17 @@ Plan: - QUERY PLAN ---------------------------------------------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.08 rows=1 width=6) - -> Hash Join (cost=0.00..862.08 rows=1 width=6) + QUERY PLAN +----------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.03 rows=1 width=6) + -> Hash Join (cost=0.00..862.03 rows=1 width=6) Hash Cond: (infer_txt.a = infer_txt_1.a) - -> Table Scan on infer_txt (cost=0.00..431.02 rows=1 width=3) + -> Seq Scan on infer_txt (cost=0.00..431.02 rows=1 width=3) Filter: (a = 'K'::text) - -> Hash (cost=431.01..431.01 rows=334 width=3) - -> Table Scan on infer_txt infer_txt_1 (cost=0.00..431.01 rows=334 width=3) - Planning time: 131.476 ms - Optimizer: PQO version 3.9.0 + -> Hash (cost=431.02..431.02 rows=1 width=3) + -> Seq Scan on infer_txt infer_txt_1 (cost=0.00..431.02 rows=1 width=3) + Filter: (a = 'K'::text) + Optimizer: Pivotal Optimizer (GPORCA) ]]> @@ -45,7 +45,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -312,14 +312,19 @@ - + - + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-txt.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-txt.mdp index 0b98e8cd905..eaad3c700da 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-txt.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-txt.mdp @@ -19,17 +19,16 @@ Plan: - QUERY PLAN ---------------------------------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.08 rows=1 width=6) - -> Hash Join (cost=0.00..862.08 rows=1 width=6) + QUERY PLAN +------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.03 rows=1 width=6) + -> Hash Join (cost=0.00..862.03 rows=1 width=6) Hash Cond: ((infer_vc.a)::text = infer_txt.a) - -> Table Scan on infer_vc (cost=0.00..431.02 rows=1 width=3) + -> Seq Scan on infer_vc (cost=0.00..431.02 rows=1 width=3) Filter: ((a)::text = 'K'::text) - -> Hash (cost=431.01..431.01 rows=334 width=3) - -> Table Scan on infer_txt (cost=0.00..431.01 rows=334 width=3) - Planning time: 145.067 ms - Optimizer: PQO version 3.9.0 + -> Hash (cost=431.02..431.02 rows=1 width=3) + -> Seq Scan on infer_txt (cost=0.00..431.02 rows=1 width=3) + Filter: (a = 'K'::text) ]]> @@ -48,7 +47,7 @@ - + @@ -95,7 +94,7 @@ - + @@ -305,7 +304,7 @@ - + @@ -319,7 +318,7 @@ - + @@ -371,14 +370,19 @@ - + - + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-vc.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-vc.mdp index 55f9d3c25b6..1af87001c38 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-vc.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vc-vc.mdp @@ -16,17 +16,17 @@ Plan: - QUERY PLAN -------------------------------------------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.08 rows=1 width=6) - -> Hash Join (cost=0.00..862.08 rows=1 width=6) + QUERY PLAN +----------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.06 rows=1 width=6) + -> Hash Join (cost=0.00..862.06 rows=1 width=6) Hash Cond: ((infer_vc.a)::text = (infer_vc_1.a)::text) - -> Table Scan on infer_vc (cost=0.00..431.02 rows=1 width=3) + -> Seq Scan on infer_vc (cost=0.00..431.02 rows=1 width=3) Filter: ((a)::text = 'K'::text) - -> Hash (cost=431.01..431.01 rows=334 width=3) - -> Table Scan on infer_vc infer_vc_1 (cost=0.00..431.01 rows=334 width=3) - Planning time: 204.591 ms - Optimizer: PQO version 3.9.0 + -> Hash (cost=431.02..431.02 rows=134 width=3) + -> Seq Scan on infer_vc infer_vc_1 (cost=0.00..431.02 rows=134 width=3) + Filter: ('K'::text = (a)::text) + Optimizer: Pivotal Optimizer (GPORCA) ]]> @@ -61,7 +61,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -286,7 +286,7 @@ - + @@ -340,14 +340,21 @@ - + - + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vcpart-txt.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vcpart-txt.mdp index 07a663030ac..20356b56979 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vcpart-txt.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesBCC-vcpart-txt.mdp @@ -471,7 +471,7 @@ - + @@ -501,7 +501,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesForLimit.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesForLimit.mdp index d4fe9e97961..c3ec9f15b51 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesForLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesForLimit.mdp @@ -24,7 +24,7 @@ a < 2 should also be outside the limit but not below. - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesForPartSQ.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesForPartSQ.mdp index 43d241d8bea..6a7e6764e4c 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesForPartSQ.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesForPartSQ.mdp @@ -61,7 +61,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -189,7 +189,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesForProcessedColumn.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesForProcessedColumn.mdp index 549eb3c89f8..58ee559a39f 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesForProcessedColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesForProcessedColumn.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -109,7 +109,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesForQuantifiedSQ.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesForQuantifiedSQ.mdp index 5bc35ab59ff..72c40117190 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesForQuantifiedSQ.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesForQuantifiedSQ.mdp @@ -85,7 +85,7 @@ - + @@ -139,7 +139,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesFromExistsSubquery.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesFromExistsSubquery.mdp index 284e28210b6..61801b0235c 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesFromExistsSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesFromExistsSubquery.mdp @@ -66,7 +66,7 @@ - + @@ -120,7 +120,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesFromMultiSubquery.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesFromMultiSubquery.mdp index 0aa1f2739b0..a115bba8eb5 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesFromMultiSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesFromMultiSubquery.mdp @@ -214,7 +214,7 @@ - + @@ -260,7 +260,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesInnerOfLOJ.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesInnerOfLOJ.mdp index cdced1c0db2..d1d07b935ba 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesInnerOfLOJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesInnerOfLOJ.mdp @@ -150,7 +150,7 @@ - + @@ -184,7 +184,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -358,7 +358,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -454,7 +454,7 @@ - + @@ -502,7 +502,7 @@ - + @@ -550,7 +550,7 @@ - + @@ -598,7 +598,7 @@ - + @@ -646,7 +646,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromExistsSubquery.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromExistsSubquery.mdp index 4ab130019e4..13723e7d870 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromExistsSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromExistsSubquery.mdp @@ -172,7 +172,7 @@ - + @@ -263,7 +263,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromSubquery.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromSubquery.mdp index 8f20da2b34e..92aa48b2927 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesIntFromSubquery.mdp @@ -181,7 +181,7 @@ - + @@ -218,7 +218,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesJoinSubquery.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesJoinSubquery.mdp index f8b373998bd..a2935aad80c 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesJoinSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesJoinSubquery.mdp @@ -49,7 +49,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -285,7 +285,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferPredicatesMultiColumns.mdp b/src/backend/gporca/data/dxl/minidump/InferPredicatesMultiColumns.mdp index 76dfe038142..970ca68c788 100644 --- a/src/backend/gporca/data/dxl/minidump/InferPredicatesMultiColumns.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferPredicatesMultiColumns.mdp @@ -209,7 +209,7 @@ - + @@ -255,7 +255,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InferredPredicatesConstraintSimplification.mdp b/src/backend/gporca/data/dxl/minidump/InferredPredicatesConstraintSimplification.mdp index 620f815380b..2b2478ada7d 100644 --- a/src/backend/gporca/data/dxl/minidump/InferredPredicatesConstraintSimplification.mdp +++ b/src/backend/gporca/data/dxl/minidump/InferredPredicatesConstraintSimplification.mdp @@ -27,7 +27,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -399,7 +399,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -439,14 +439,19 @@ - + - + + + + + + @@ -462,7 +467,7 @@ - + @@ -512,14 +517,21 @@ - + - + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/InnerJoinBroadcastTableHashSpec.mdp b/src/backend/gporca/data/dxl/minidump/InnerJoinBroadcastTableHashSpec.mdp index a4bc9cc9e25..9ed2b2c223e 100644 --- a/src/backend/gporca/data/dxl/minidump/InnerJoinBroadcastTableHashSpec.mdp +++ b/src/backend/gporca/data/dxl/minidump/InnerJoinBroadcastTableHashSpec.mdp @@ -53,7 +53,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1, t2 WHERE a1 = b2 GROUP BY b2 ORDER BY b2; - + @@ -93,7 +93,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1, t2 WHERE a1 = b2 GROUP BY b2 ORDER BY b2; - + diff --git a/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExcept.mdp b/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExcept.mdp index 1fa55b9c550..704fcb9d9d1 100644 --- a/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExcept.mdp +++ b/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExcept.mdp @@ -35,7 +35,7 @@ ON (a.col = b.col); - + diff --git a/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExceptAll.mdp b/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExceptAll.mdp index bea581ab39a..44e891d67ad 100644 --- a/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExceptAll.mdp +++ b/src/backend/gporca/data/dxl/minidump/InnerJoinOverJoinExceptAll.mdp @@ -35,7 +35,7 @@ ON (a.col = b.col); - + diff --git a/src/backend/gporca/data/dxl/minidump/InnerJoinReplicatedTableHashSpec.mdp b/src/backend/gporca/data/dxl/minidump/InnerJoinReplicatedTableHashSpec.mdp index d031d7fb679..3e2e8139c4f 100644 --- a/src/backend/gporca/data/dxl/minidump/InnerJoinReplicatedTableHashSpec.mdp +++ b/src/backend/gporca/data/dxl/minidump/InnerJoinReplicatedTableHashSpec.mdp @@ -171,7 +171,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1, t2 WHERE a1 = b2 GROUP BY b2 ORDER BY b2; - + @@ -208,7 +208,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1, t2 WHERE a1 = b2 GROUP BY b2 ORDER BY b2; - + diff --git a/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned-SortDisabled.mdp b/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned-SortDisabled.mdp index ef8604939aa..37fb8ec2f54 100644 --- a/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned-SortDisabled.mdp +++ b/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned-SortDisabled.mdp @@ -16,7 +16,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -327,7 +327,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned.mdp b/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned.mdp index 64e4c65c9ba..ee35c625006 100644 --- a/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned.mdp +++ b/src/backend/gporca/data/dxl/minidump/Insert-AO-Partitioned.mdp @@ -16,7 +16,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -278,7 +278,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Insert-AO.mdp b/src/backend/gporca/data/dxl/minidump/Insert-AO.mdp index 99c0a273d92..ffcf1e7cb9e 100644 --- a/src/backend/gporca/data/dxl/minidump/Insert-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/Insert-AO.mdp @@ -16,7 +16,7 @@ - + @@ -141,7 +141,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Insert-With-HJ-CTE-Agg.mdp b/src/backend/gporca/data/dxl/minidump/Insert-With-HJ-CTE-Agg.mdp index 654e9021b03..575092262da 100644 --- a/src/backend/gporca/data/dxl/minidump/Insert-With-HJ-CTE-Agg.mdp +++ b/src/backend/gporca/data/dxl/minidump/Insert-With-HJ-CTE-Agg.mdp @@ -55,7 +55,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -284,7 +284,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertConstTupleRandomDistribution.mdp b/src/backend/gporca/data/dxl/minidump/InsertConstTupleRandomDistribution.mdp index 359910a3eee..3e06c5f1464 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertConstTupleRandomDistribution.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertConstTupleRandomDistribution.mdp @@ -133,7 +133,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertIntoNonNullAfterDroppingColumn.mdp b/src/backend/gporca/data/dxl/minidump/InsertIntoNonNullAfterDroppingColumn.mdp index f36c90bfc76..1a02dabdcb2 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertIntoNonNullAfterDroppingColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertIntoNonNullAfterDroppingColumn.mdp @@ -112,7 +112,7 @@ EXPLAIN INSERT INTO ColumnMapping VALUES (NULL); - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution-2.mdp b/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution-2.mdp index ed468898ee5..b45d2497961 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution-2.mdp @@ -207,7 +207,7 @@ explain insert into pt2 select * from r; - + @@ -258,7 +258,7 @@ explain insert into pt2 select * from r; - + @@ -309,7 +309,7 @@ explain insert into pt2 select * from r; - + @@ -360,7 +360,7 @@ explain insert into pt2 select * from r; - + @@ -411,7 +411,7 @@ explain insert into pt2 select * from r; - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution.mdp b/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution.mdp index 482c93c534f..df19cfc8388 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertMismatchedDistrubution.mdp @@ -207,7 +207,7 @@ explain insert into pt2 select * from r; - + @@ -258,7 +258,7 @@ explain insert into pt2 select * from r; - + @@ -309,7 +309,7 @@ explain insert into pt2 select * from r; - + @@ -360,7 +360,7 @@ explain insert into pt2 select * from r; - + @@ -411,7 +411,7 @@ explain insert into pt2 select * from r; - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertNoEnforceConstraints.mdp b/src/backend/gporca/data/dxl/minidump/InsertNoEnforceConstraints.mdp index 55770e3ad86..5b2d9d00352 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertNoEnforceConstraints.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertNoEnforceConstraints.mdp @@ -129,7 +129,7 @@ insert into constraints_tab values (NULL, -1); - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertNonSingleton.mdp b/src/backend/gporca/data/dxl/minidump/InsertNonSingleton.mdp index c94674ae342..70c72ab2106 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertNonSingleton.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertNonSingleton.mdp @@ -156,7 +156,7 @@ EXPLAIN INSERT INTO snackbox SELECT a FROM (SELECT c FROM hottoast LIMIT 3) hott - + @@ -187,7 +187,7 @@ EXPLAIN INSERT INTO snackbox SELECT a FROM (SELECT c FROM hottoast LIMIT 3) hott - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertRandomDistr.mdp b/src/backend/gporca/data/dxl/minidump/InsertRandomDistr.mdp index 9681799edce..d558aab9078 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertRandomDistr.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertRandomDistr.mdp @@ -125,7 +125,7 @@ - + @@ -158,7 +158,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/InsertReplicatedIntoSerialHashDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/InsertReplicatedIntoSerialHashDistributedTable.mdp index 464ba63f923..6a619af5afb 100644 --- a/src/backend/gporca/data/dxl/minidump/InsertReplicatedIntoSerialHashDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/InsertReplicatedIntoSerialHashDistributedTable.mdp @@ -38,7 +38,7 @@ EXPLAIN (COSTS OFF) INSERT INTO distributed_table (val1, val2) SELECT val1, val2 - + @@ -71,7 +71,7 @@ EXPLAIN (COSTS OFF) INSERT INTO distributed_table (val1, val2) SELECT val1, val2 - + diff --git a/src/backend/gporca/data/dxl/minidump/JOIN-NonRedistributableCol.mdp b/src/backend/gporca/data/dxl/minidump/JOIN-NonRedistributableCol.mdp index 81409818223..107088ded4e 100644 --- a/src/backend/gporca/data/dxl/minidump/JOIN-NonRedistributableCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/JOIN-NonRedistributableCol.mdp @@ -34,7 +34,7 @@ explain select * from foo, testhstore where foo.b = testhstore.h; - + @@ -80,7 +80,7 @@ explain select * from foo, testhstore where foo.b = testhstore.h; - + diff --git a/src/backend/gporca/data/dxl/minidump/Join-INDF-NoBroadcast.mdp b/src/backend/gporca/data/dxl/minidump/Join-INDF-NoBroadcast.mdp index 1548ad0fe53..5580929fd8b 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-INDF-NoBroadcast.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-INDF-NoBroadcast.mdp @@ -25,7 +25,7 @@ select * from foo, bar where foo.a is not distinct from bar.a; - + @@ -59,7 +59,7 @@ select * from foo, bar where foo.a is not distinct from bar.a; - + diff --git a/src/backend/gporca/data/dxl/minidump/Join-INDF-Nulls-Not-Collocated.mdp b/src/backend/gporca/data/dxl/minidump/Join-INDF-Nulls-Not-Collocated.mdp index 90f231b569f..b371a59988c 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-INDF-Nulls-Not-Collocated.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-INDF-Nulls-Not-Collocated.mdp @@ -117,7 +117,7 @@ select * from foo, (select NULL a from bar) other where foo.a is not distinct fr - + @@ -151,7 +151,7 @@ select * from foo, (select NULL a from bar) other where foo.a is not distinct fr - + diff --git a/src/backend/gporca/data/dxl/minidump/Join-Varchar-Equality.mdp b/src/backend/gporca/data/dxl/minidump/Join-Varchar-Equality.mdp index 9c31e72edd0..ef174ed0c40 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-Varchar-Equality.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-Varchar-Equality.mdp @@ -3277,7 +3277,7 @@ - + @@ -3328,7 +3328,7 @@ - + @@ -3379,7 +3379,7 @@ - + @@ -3430,7 +3430,7 @@ - + @@ -4044,7 +4044,7 @@ - + @@ -4064,7 +4064,7 @@ - + @@ -4084,7 +4084,7 @@ - + @@ -4119,7 +4119,7 @@ - + @@ -4156,7 +4156,7 @@ - + @@ -4179,7 +4179,7 @@ - + @@ -4214,7 +4214,7 @@ - + @@ -4276,7 +4276,7 @@ - + @@ -4352,7 +4352,7 @@ - + @@ -4379,7 +4379,7 @@ - + @@ -4402,7 +4402,7 @@ - + @@ -4467,9 +4467,9 @@ - + - + @@ -4482,34 +4482,51 @@ - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/Join-WinFunc-Preds.mdp b/src/backend/gporca/data/dxl/minidump/Join-WinFunc-Preds.mdp index 0d402cabd70..0a7882e6237 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-WinFunc-Preds.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-WinFunc-Preds.mdp @@ -536,7 +536,7 @@ where e < 10; - + diff --git a/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-1.mdp b/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-1.mdp index 82db745f096..15591a29f61 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-1.mdp @@ -781,7 +781,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-2.mdp b/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-2.mdp index e6eaa4459e5..4c3ce210eff 100644 --- a/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/Join-With-Subq-Preds-2.mdp @@ -807,7 +807,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinAbsEqWithoutOpfamilies.mdp b/src/backend/gporca/data/dxl/minidump/JoinAbsEqWithoutOpfamilies.mdp index 566f039caca..bf199c883a6 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinAbsEqWithoutOpfamilies.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinAbsEqWithoutOpfamilies.mdp @@ -97,7 +97,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAboveLimit.mdp b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAboveLimit.mdp index 28095d76270..d2ccbfbb19e 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAboveLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAboveLimit.mdp @@ -29,7 +29,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAtLimit.mdp b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAtLimit.mdp index 9ff44314985..698b8e6dd80 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAtLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityAtLimit.mdp @@ -29,7 +29,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityBelowLimit.mdp b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityBelowLimit.mdp index 7cb41bf8db0..88924cf0730 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityBelowLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinArityAssociativityCommutativityBelowLimit.mdp @@ -29,7 +29,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinCitextVarchar.mdp b/src/backend/gporca/data/dxl/minidump/JoinCitextVarchar.mdp index c1137e417d1..4cfa813e398 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinCitextVarchar.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinCitextVarchar.mdp @@ -31,7 +31,7 @@ - + @@ -85,7 +85,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinDefaultOpfamiliesUsingNonDefaultOpfamilyOp.mdp b/src/backend/gporca/data/dxl/minidump/JoinDefaultOpfamiliesUsingNonDefaultOpfamilyOp.mdp index 0de695af7f8..cbad5e62067 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinDefaultOpfamiliesUsingNonDefaultOpfamilyOp.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinDefaultOpfamiliesUsingNonDefaultOpfamilyOp.mdp @@ -207,7 +207,7 @@ - + @@ -241,7 +241,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumn.mdp b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumn.mdp index ab118b7b559..55789c928b1 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumn.mdp @@ -181,7 +181,7 @@ - + @@ -218,7 +218,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumnAndSubqueryInPredicate.mdp b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumnAndSubqueryInPredicate.mdp index 5075cd6dea9..062e2b47d59 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumnAndSubqueryInPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithCastedColumnAndSubqueryInPredicate.mdp @@ -44,7 +44,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithMixOfPushableAndNonpushablePredicates.mdp b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithMixOfPushableAndNonpushablePredicates.mdp index 4fd8aa79e5d..dd7c71eb589 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithMixOfPushableAndNonpushablePredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithMixOfPushableAndNonpushablePredicates.mdp @@ -57,7 +57,7 @@ - + @@ -94,7 +94,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithSetReturningColumn.mdp b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithSetReturningColumn.mdp index c8e72f2d3c6..d2331ca484a 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithSetReturningColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithSetReturningColumn.mdp @@ -41,7 +41,7 @@ - + @@ -78,7 +78,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithVolatileColumn.mdp b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithVolatileColumn.mdp index fa8049dde33..7b2061237e2 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOnViewWithVolatileColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOnViewWithVolatileColumn.mdp @@ -208,7 +208,7 @@ - + @@ -245,7 +245,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelGreedyNonPartTblInnerJoin.mdp b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelGreedyNonPartTblInnerJoin.mdp index 00d86e7f3a3..c0a51e9a4d5 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelGreedyNonPartTblInnerJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelGreedyNonPartTblInnerJoin.mdp @@ -221,7 +221,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -323,7 +323,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQuery3WayHashJoinPartTbl.mdp b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQuery3WayHashJoinPartTbl.mdp index 485103082ee..2333facdf8d 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQuery3WayHashJoinPartTbl.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQuery3WayHashJoinPartTbl.mdp @@ -44,7 +44,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -151,7 +151,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -295,7 +295,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQueryNonPartTblInnerJoin.mdp b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQueryNonPartTblInnerJoin.mdp index 10660d374ed..6875e7dfb74 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQueryNonPartTblInnerJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOptimizationLevelQueryNonPartTblInnerJoin.mdp @@ -221,7 +221,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -323,7 +323,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinOrderDPE.mdp b/src/backend/gporca/data/dxl/minidump/JoinOrderDPE.mdp index fd520ff0c05..4dffea0327d 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinOrderDPE.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinOrderDPE.mdp @@ -64,7 +64,7 @@ - + @@ -1064,7 +1064,7 @@ - + @@ -1116,7 +1116,7 @@ - + @@ -1163,7 +1163,7 @@ - + @@ -1214,7 +1214,7 @@ - + @@ -1265,7 +1265,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1367,7 +1367,7 @@ - + @@ -1418,7 +1418,7 @@ - + @@ -1469,7 +1469,7 @@ - + @@ -1520,7 +1520,7 @@ - + @@ -1571,7 +1571,7 @@ - + @@ -1622,7 +1622,7 @@ - + @@ -1674,7 +1674,7 @@ - + @@ -1721,7 +1721,7 @@ - + @@ -1772,7 +1772,7 @@ - + @@ -1824,7 +1824,7 @@ - + @@ -1875,7 +1875,7 @@ - + @@ -1926,7 +1926,7 @@ - + @@ -2008,7 +2008,7 @@ - + @@ -2055,7 +2055,7 @@ - + @@ -2106,7 +2106,7 @@ - + @@ -2589,7 +2589,7 @@ - + @@ -2640,7 +2640,7 @@ - + @@ -2691,7 +2691,7 @@ - + @@ -2742,7 +2742,7 @@ - + @@ -2793,7 +2793,7 @@ - + @@ -2844,7 +2844,7 @@ - + @@ -2939,7 +2939,7 @@ - + @@ -2990,7 +2990,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinTinterval.mdp b/src/backend/gporca/data/dxl/minidump/JoinTinterval.mdp index 53c81ec72e5..b0976265c38 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinTinterval.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinTinterval.mdp @@ -175,7 +175,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/JoinWithSubqueryProjectColumn.mdp b/src/backend/gporca/data/dxl/minidump/JoinWithSubqueryProjectColumn.mdp index 9559fedb0ed..cd08cf6cdf3 100644 --- a/src/backend/gporca/data/dxl/minidump/JoinWithSubqueryProjectColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/JoinWithSubqueryProjectColumn.mdp @@ -63,7 +63,7 @@ - + @@ -256,7 +256,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-Condition-False.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-Condition-False.mdp index 0a42c883b41..452fc00b470 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-Condition-False.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-Condition-False.mdp @@ -21,7 +21,7 @@ select * from foo a left outer join foo b on false; - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndex.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndex.mdp index fe9e464a169..e7ddf4d36f0 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndex.mdp @@ -204,7 +204,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -336,7 +336,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndexWithSelect.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndexWithSelect.mdp index 74545761de7..e5a51798e47 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndexWithSelect.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-DynBitmapIndexWithSelect.mdp @@ -204,7 +204,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -336,7 +336,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndex.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndex.mdp index dda2957dd10..2a5c35c157c 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndex.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndex.mdp @@ -50,7 +50,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -190,7 +190,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndexWithSelect.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndexWithSelect.mdp index 33760f141f8..b5ea8617693 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndexWithSelect.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-DynBtreeIndexWithSelect.mdp @@ -81,7 +81,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -236,7 +236,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-HashJoin-MultiDistKeys-WithComplexPreds.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-HashJoin-MultiDistKeys-WithComplexPreds.mdp index 97680ba3826..c3c8cb5fb47 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-HashJoin-MultiDistKeys-WithComplexPreds.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-HashJoin-MultiDistKeys-WithComplexPreds.mdp @@ -37,7 +37,7 @@ - + @@ -76,7 +76,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-Equiv.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-Equiv.mdp index 60a1262d2d7..db753af4d5c 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-Equiv.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-Equiv.mdp @@ -153,7 +153,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + @@ -190,7 +190,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + @@ -236,7 +236,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-NoMotion.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-NoMotion.mdp index 237d397a3cd..fb38b107c8c 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-NoMotion.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-CompsiteKey-NoMotion.mdp @@ -115,7 +115,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + @@ -224,7 +224,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + @@ -267,7 +267,7 @@ explain select * from foo left join bar on foo.a = bar.a and foo.b = bar.b left - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-DistKey-Multiple-Predicates.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-DistKey-Multiple-Predicates.mdp index 15215416189..1c7e9992f90 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-DistKey-Multiple-Predicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-DistKey-Multiple-Predicates.mdp @@ -48,7 +48,7 @@ explain select * from foo left join bar on bar.a=foo.a and bar.a - + @@ -88,7 +88,7 @@ explain select * from foo left join bar on bar.a=foo.a and bar.a - + @@ -126,7 +126,7 @@ explain select * from foo left join bar on bar.a=foo.a and bar.a - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MasterOnly-Table.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MasterOnly-Table.mdp index 94a279656a7..62edb96d997 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MasterOnly-Table.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MasterOnly-Table.mdp @@ -291,7 +291,7 @@ union all - + @@ -457,7 +457,7 @@ union all - + @@ -584,7 +584,7 @@ union all - + @@ -618,7 +618,7 @@ union all - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey-NoExtraFilter.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey-NoExtraFilter.mdp index 22a4f9d583b..75ec2166c25 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey-NoExtraFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey-NoExtraFilter.mdp @@ -207,7 +207,7 @@ - + @@ -244,7 +244,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey.mdp index a8b791dc994..6e2f40bd84b 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKey-MultiIndexKey.mdp @@ -222,7 +222,7 @@ - + @@ -259,7 +259,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp index 13022fcbcad..d5ff29c6de6 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap-WithComplexPreds.mdp @@ -144,7 +144,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap.mdp index 836b4ee95c3..e2ccc700848 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-Bitmap.mdp @@ -135,7 +135,7 @@ - + @@ -169,7 +169,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-IndexKeys.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-IndexKeys.mdp index a55d0cb4774..e6101562e05 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-IndexKeys.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-IndexKeys.mdp @@ -208,7 +208,7 @@ explain select * from foo left join bar on foo.a=bar.a and foo.b=bar.b and foo.c - + @@ -249,7 +249,7 @@ explain select * from foo left join bar on foo.a=bar.a and foo.b=bar.b and foo.c - + @@ -295,7 +295,7 @@ explain select * from foo left join bar on foo.a=bar.a and foo.b=bar.b and foo.c - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-WithComplexPreds.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-WithComplexPreds.mdp index 8e44aad4a54..7ac44068603 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-WithComplexPreds.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiDistKeys-WithComplexPreds.mdp @@ -36,7 +36,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiIndexes.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiIndexes.mdp index 98b4bf04efa..501e41c7703 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiIndexes.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-MultiIndexes.mdp @@ -30,7 +30,7 @@ set optimizer_enable_hashjoin = off; - + @@ -55,7 +55,7 @@ set optimizer_enable_hashjoin = off; - + @@ -127,7 +127,7 @@ set optimizer_enable_hashjoin = off; - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-Negative-NonEqual-Predicate.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-Negative-NonEqual-Predicate.mdp index 7d772545938..e0e248c1046 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-Negative-NonEqual-Predicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-Negative-NonEqual-Predicate.mdp @@ -47,7 +47,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-NonDistKey.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-NonDistKey.mdp index 915ac1b8283..72c9512860d 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-NonDistKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-NonDistKey.mdp @@ -35,7 +35,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-WithComplexPredicates.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-WithComplexPredicates.mdp index 49a1aba0f9e..4ec47ebcd73 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-WithComplexPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-IndexApply-WithComplexPredicates.mdp @@ -57,7 +57,7 @@ - + @@ -106,7 +106,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-PushDown.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-PushDown.mdp index 5e904204784..7ecc98e61b9 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-PushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-PushDown.mdp @@ -154,7 +154,7 @@ explain select 1 from push_t3 where exists ( - + @@ -191,7 +191,7 @@ explain select 1 from push_t3 where exists ( - + @@ -228,7 +228,7 @@ explain select 1 from push_t3 where exists ( - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ-With-Agg.mdp b/src/backend/gporca/data/dxl/minidump/LOJ-With-Agg.mdp index 95f2e438938..92fab1f1a26 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ-With-Agg.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ-With-Agg.mdp @@ -161,7 +161,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJNonNullRejectingPredicates.mdp b/src/backend/gporca/data/dxl/minidump/LOJNonNullRejectingPredicates.mdp index ec80878faa1..aec7c14bc18 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJNonNullRejectingPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJNonNullRejectingPredicates.mdp @@ -45,7 +45,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -166,7 +166,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJNullRejectingPredicates.mdp b/src/backend/gporca/data/dxl/minidump/LOJNullRejectingPredicates.mdp index d1a7c83650f..292a481262f 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJNullRejectingPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJNullRejectingPredicates.mdp @@ -42,7 +42,7 @@ explain select * from t1 left join t2 on t1.a=t2.a left join t3 on t2.a=t3.a lef - + @@ -82,7 +82,7 @@ explain select * from t1 left join t2 on t1.a=t2.a left join t3 on t2.a=t3.a lef - + @@ -122,7 +122,7 @@ explain select * from t1 left join t2 on t1.a=t2.a left join t3 on t2.a=t3.a lef - + @@ -163,7 +163,7 @@ explain select * from t1 left join t2 on t1.a=t2.a left join t3 on t2.a=t3.a lef - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJNullRejectingZeroPlacePredicates.mdp b/src/backend/gporca/data/dxl/minidump/LOJNullRejectingZeroPlacePredicates.mdp index e5667218b77..b9b8c9022d8 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJNullRejectingZeroPlacePredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJNullRejectingZeroPlacePredicates.mdp @@ -50,7 +50,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderComplexNestedLOJs.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderComplexNestedLOJs.mdp index 50928b9ca47..34241f0baf2 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderComplexNestedLOJs.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderComplexNestedLOJs.mdp @@ -1349,7 +1349,7 @@ - + @@ -1386,7 +1386,7 @@ - + @@ -1423,7 +1423,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderWithComplexPredicate.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderWithComplexPredicate.mdp index bdca9f3b95a..8719969ee4d 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderWithComplexPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderWithComplexPredicate.mdp @@ -28,7 +28,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderWithIDF.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderWithIDF.mdp index 35198cc8e32..e3dbdb5500e 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderWithIDF.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderWithIDF.mdp @@ -1346,7 +1346,7 @@ - + @@ -1383,7 +1383,7 @@ - + @@ -1420,7 +1420,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderWithNestedLOJAndFilter.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderWithNestedLOJAndFilter.mdp index d0ba37ffdd1..ac79aac6588 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderWithNestedLOJAndFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderWithNestedLOJAndFilter.mdp @@ -1341,7 +1341,7 @@ - + @@ -1378,7 +1378,7 @@ - + @@ -1415,7 +1415,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderWithOneSidedFilter.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderWithOneSidedFilter.mdp index a04762b186d..8a0f833260f 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderWithOneSidedFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderWithOneSidedFilter.mdp @@ -1755,7 +1755,7 @@ - + @@ -1792,7 +1792,7 @@ - + @@ -1829,7 +1829,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJReorderWithSimplePredicate.mdp b/src/backend/gporca/data/dxl/minidump/LOJReorderWithSimplePredicate.mdp index 58a6f593d5e..f9dfed8929b 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJReorderWithSimplePredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJReorderWithSimplePredicate.mdp @@ -1346,7 +1346,7 @@ - + @@ -1383,7 +1383,7 @@ - + @@ -1420,7 +1420,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_NULL.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_NULL.mdp index f74df79864d..1040397cc80 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_NULL.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_NULL.mdp @@ -38,7 +38,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t1.b IS DISTINC - + @@ -72,7 +72,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t1.b IS DISTINC - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_inner_ref.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_inner_ref.mdp index 62933e8cbe5..f125619306c 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_inner_ref.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_IDF_no_convert_outer_ref_predicate_with_inner_ref.mdp @@ -39,7 +39,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t1.b IS DISTINC - + @@ -73,7 +73,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t1.b IS DISTINC - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_bb_mpph.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_bb_mpph.mdp index f6680bc8f1a..18b2bd9eb1c 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_bb_mpph.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_bb_mpph.mdp @@ -172,7 +172,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1575,7 +1575,7 @@ - + @@ -1673,7 +1673,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_and_predicate.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_and_predicate.mdp index b92befa9b77..5e206ae8c7d 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_and_predicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_and_predicate.mdp @@ -203,7 +203,7 @@ - + @@ -245,7 +245,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_inner_predicate_IDF.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_inner_predicate_IDF.mdp index d46767e3197..2550668e48e 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_inner_predicate_IDF.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_inner_predicate_IDF.mdp @@ -36,7 +36,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS DISTINC - + @@ -70,7 +70,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS DISTINC - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_or_predicate.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_or_predicate.mdp index 75c065aeba7..1a21e2b7e86 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_or_predicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_convert_to_inner_with_or_predicate.mdp @@ -205,7 +205,7 @@ - + @@ -247,7 +247,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_inner_predicate_IDF_const.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_inner_predicate_IDF_const.mdp index ffe1b2ea22b..33448e64c14 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_inner_predicate_IDF_const.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_inner_predicate_IDF_const.mdp @@ -37,7 +37,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS DISTINC - + @@ -71,7 +71,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS DISTINC - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF.mdp index 1d6cfc7e602..5eb0be3bb0e 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF.mdp @@ -37,7 +37,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS NOT DIS - + @@ -71,7 +71,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS NOT DIS - + diff --git a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF_const.mdp b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF_const.mdp index f97d328f948..bdab5e5b26f 100644 --- a/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF_const.mdp +++ b/src/backend/gporca/data/dxl/minidump/LOJ_dont_convert_to_inner_with_outer_predicate_INDF_const.mdp @@ -37,7 +37,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS NOT DIS - + @@ -71,7 +71,7 @@ EXPLAIN SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.a = t2.a WHERE t2.b IS NOT DIS - + diff --git a/src/backend/gporca/data/dxl/minidump/LargeMultiColumnInList.mdp b/src/backend/gporca/data/dxl/minidump/LargeMultiColumnInList.mdp index 6236e24cd38..d6f6a2c5f21 100644 --- a/src/backend/gporca/data/dxl/minidump/LargeMultiColumnInList.mdp +++ b/src/backend/gporca/data/dxl/minidump/LargeMultiColumnInList.mdp @@ -30,7 +30,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -435,7 +435,7 @@ - + @@ -486,7 +486,7 @@ - + @@ -537,7 +537,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Lead-Lag-WinFuncs.mdp b/src/backend/gporca/data/dxl/minidump/Lead-Lag-WinFuncs.mdp index c1439b2f3bc..2d8f6c41417 100644 --- a/src/backend/gporca/data/dxl/minidump/Lead-Lag-WinFuncs.mdp +++ b/src/backend/gporca/data/dxl/minidump/Lead-Lag-WinFuncs.mdp @@ -111,7 +111,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LeftJoin-DPv2-With-Select.mdp b/src/backend/gporca/data/dxl/minidump/LeftJoin-DPv2-With-Select.mdp index 5ec3138930a..bd5fc9690b7 100644 --- a/src/backend/gporca/data/dxl/minidump/LeftJoin-DPv2-With-Select.mdp +++ b/src/backend/gporca/data/dxl/minidump/LeftJoin-DPv2-With-Select.mdp @@ -66,7 +66,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -345,7 +345,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LeftJoin-UnsupportedFilter-Cardinality.mdp b/src/backend/gporca/data/dxl/minidump/LeftJoin-UnsupportedFilter-Cardinality.mdp index 364b9c2ac07..80191334a0f 100644 --- a/src/backend/gporca/data/dxl/minidump/LeftJoin-UnsupportedFilter-Cardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/LeftJoin-UnsupportedFilter-Cardinality.mdp @@ -169,7 +169,7 @@ explain select * from foo left join bar on foo.a=bar.a left join zoo on foo.a::i - + @@ -203,7 +203,7 @@ explain select * from foo left join bar on foo.a=bar.a left join zoo on foo.a::i - + @@ -251,7 +251,7 @@ explain select * from foo left join bar on foo.a=bar.a left join zoo on foo.a::i - + diff --git a/src/backend/gporca/data/dxl/minidump/LeftJoinBroadcastTableHashSpec.mdp b/src/backend/gporca/data/dxl/minidump/LeftJoinBroadcastTableHashSpec.mdp index c77f6d68c00..114ae33deba 100644 --- a/src/backend/gporca/data/dxl/minidump/LeftJoinBroadcastTableHashSpec.mdp +++ b/src/backend/gporca/data/dxl/minidump/LeftJoinBroadcastTableHashSpec.mdp @@ -178,7 +178,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1 LEFT JOIN t2 ON a1 = b2 GROUP BY b2 ORDER BY - + @@ -218,7 +218,7 @@ EXPLAIN SELECT b2, sum(c1) FROM t1 LEFT JOIN t2 ON a1 = b2 GROUP BY b2 ORDER BY - + diff --git a/src/backend/gporca/data/dxl/minidump/LeftJoinDPv2JoinOrder.mdp b/src/backend/gporca/data/dxl/minidump/LeftJoinDPv2JoinOrder.mdp index ff63990f0c0..fb1251a121d 100644 --- a/src/backend/gporca/data/dxl/minidump/LeftJoinDPv2JoinOrder.mdp +++ b/src/backend/gporca/data/dxl/minidump/LeftJoinDPv2JoinOrder.mdp @@ -64,7 +64,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -175,7 +175,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/LeftJoinNullsNotColocated.mdp b/src/backend/gporca/data/dxl/minidump/LeftJoinNullsNotColocated.mdp index 0c26ef07f24..b7668cd0325 100644 --- a/src/backend/gporca/data/dxl/minidump/LeftJoinNullsNotColocated.mdp +++ b/src/backend/gporca/data/dxl/minidump/LeftJoinNullsNotColocated.mdp @@ -79,7 +79,7 @@ on id2 = id3 distributed by (id1); - + @@ -113,7 +113,7 @@ on id2 = id3 distributed by (id1); - + @@ -147,7 +147,7 @@ on id2 = id3 distributed by (id1); - + diff --git a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastEq.mdp b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastEq.mdp index 004087d08ae..6d22dbd5be5 100644 --- a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastEq.mdp +++ b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastEq.mdp @@ -30,7 +30,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -171,7 +171,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastLT.mdp b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastLT.mdp index 7ae2631a412..633248703f7 100644 --- a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastLT.mdp +++ b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastLT.mdp @@ -30,7 +30,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -171,7 +171,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastNEq.mdp b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastNEq.mdp index 54039fd4c4d..ee79e14169a 100644 --- a/src/backend/gporca/data/dxl/minidump/ListPartLossyCastNEq.mdp +++ b/src/backend/gporca/data/dxl/minidump/ListPartLossyCastNEq.mdp @@ -162,7 +162,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + diff --git a/src/backend/gporca/data/dxl/minidump/LogicalIndexGetDroppedCols.mdp b/src/backend/gporca/data/dxl/minidump/LogicalIndexGetDroppedCols.mdp index 6de63b2f481..c416f95b119 100644 --- a/src/backend/gporca/data/dxl/minidump/LogicalIndexGetDroppedCols.mdp +++ b/src/backend/gporca/data/dxl/minidump/LogicalIndexGetDroppedCols.mdp @@ -1063,7 +1063,7 @@ EXPLAIN SELECT * FROM solo WHERE year_id=2017 AND month_id=6; - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-1.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-1.mdp index 350ab90bf04..0d98f70a59e 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-1.mdp @@ -572,7 +572,7 @@ - + @@ -689,7 +689,7 @@ - + @@ -929,7 +929,7 @@ - + @@ -1046,7 +1046,7 @@ - + @@ -1306,7 +1306,7 @@ - + @@ -1423,7 +1423,7 @@ - + @@ -1687,7 +1687,7 @@ - + @@ -1804,7 +1804,7 @@ - + @@ -2044,7 +2044,7 @@ - + @@ -2161,7 +2161,7 @@ - + @@ -2386,7 +2386,7 @@ - + @@ -2503,7 +2503,7 @@ - + @@ -2726,7 +2726,7 @@ - + @@ -2843,7 +2843,7 @@ - + @@ -3107,7 +3107,7 @@ - + @@ -3224,7 +3224,7 @@ - + @@ -3473,7 +3473,7 @@ - + @@ -3590,7 +3590,7 @@ - + @@ -3813,7 +3813,7 @@ - + @@ -3930,7 +3930,7 @@ - + @@ -4154,7 +4154,7 @@ - + @@ -4271,7 +4271,7 @@ - + @@ -4495,7 +4495,7 @@ - + @@ -4612,7 +4612,7 @@ - + @@ -4876,7 +4876,7 @@ - + @@ -4993,7 +4993,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-2.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-2.mdp index 1015569b7eb..836067038aa 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-2.mdp @@ -572,7 +572,7 @@ - + @@ -689,7 +689,7 @@ - + @@ -929,7 +929,7 @@ - + @@ -1046,7 +1046,7 @@ - + @@ -1306,7 +1306,7 @@ - + @@ -1423,7 +1423,7 @@ - + @@ -1687,7 +1687,7 @@ - + @@ -1804,7 +1804,7 @@ - + @@ -2044,7 +2044,7 @@ - + @@ -2161,7 +2161,7 @@ - + @@ -2386,7 +2386,7 @@ - + @@ -2503,7 +2503,7 @@ - + @@ -2726,7 +2726,7 @@ - + @@ -2843,7 +2843,7 @@ - + @@ -3107,7 +3107,7 @@ - + @@ -3224,7 +3224,7 @@ - + @@ -3473,7 +3473,7 @@ - + @@ -3590,7 +3590,7 @@ - + @@ -3813,7 +3813,7 @@ - + @@ -3930,7 +3930,7 @@ - + @@ -4154,7 +4154,7 @@ - + @@ -4271,7 +4271,7 @@ - + @@ -4495,7 +4495,7 @@ - + @@ -4612,7 +4612,7 @@ - + @@ -4876,7 +4876,7 @@ - + @@ -4993,7 +4993,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-4.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-4.mdp index 400517ccfd9..395da986061 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-4.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-4.mdp @@ -428,7 +428,7 @@ - + @@ -534,7 +534,7 @@ - + @@ -651,7 +651,7 @@ - + @@ -785,7 +785,7 @@ - + @@ -891,7 +891,7 @@ - + @@ -1008,7 +1008,7 @@ - + @@ -1150,7 +1150,7 @@ - + @@ -1256,7 +1256,7 @@ - + @@ -1373,7 +1373,7 @@ - + @@ -1531,7 +1531,7 @@ - + @@ -1637,7 +1637,7 @@ - + @@ -1754,7 +1754,7 @@ - + @@ -1872,7 +1872,7 @@ - + @@ -1978,7 +1978,7 @@ - + @@ -2095,7 +2095,7 @@ - + @@ -2214,7 +2214,7 @@ - + @@ -2320,7 +2320,7 @@ - + @@ -2437,7 +2437,7 @@ - + @@ -2554,7 +2554,7 @@ - + @@ -2660,7 +2660,7 @@ - + @@ -2777,7 +2777,7 @@ - + @@ -2935,7 +2935,7 @@ - + @@ -3041,7 +3041,7 @@ - + @@ -3158,7 +3158,7 @@ - + @@ -3301,7 +3301,7 @@ - + @@ -3407,7 +3407,7 @@ - + @@ -3524,7 +3524,7 @@ - + @@ -3641,7 +3641,7 @@ - + @@ -3747,7 +3747,7 @@ - + @@ -3864,7 +3864,7 @@ - + @@ -3982,7 +3982,7 @@ - + @@ -4088,7 +4088,7 @@ - + @@ -4205,7 +4205,7 @@ - + @@ -4323,7 +4323,7 @@ - + @@ -4429,7 +4429,7 @@ - + @@ -4546,7 +4546,7 @@ - + @@ -4704,7 +4704,7 @@ - + @@ -4810,7 +4810,7 @@ - + @@ -4927,7 +4927,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-5.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-5.mdp index 4f883736796..bbf15d4a87b 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-5.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-5.mdp @@ -181,7 +181,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -678,7 +678,7 @@ - + @@ -795,7 +795,7 @@ - + @@ -958,7 +958,7 @@ - + @@ -1064,7 +1064,7 @@ - + @@ -1181,7 +1181,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-6.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-6.mdp index ceb7ef36442..77ebbefc14e 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-6.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-6.mdp @@ -181,7 +181,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -678,7 +678,7 @@ - + @@ -795,7 +795,7 @@ - + @@ -958,7 +958,7 @@ - + @@ -1064,7 +1064,7 @@ - + @@ -1181,7 +1181,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-7.mdp b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-7.mdp index bd861f8df6c..211b9660963 100644 --- a/src/backend/gporca/data/dxl/minidump/MS-UnionAll-7.mdp +++ b/src/backend/gporca/data/dxl/minidump/MS-UnionAll-7.mdp @@ -181,7 +181,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -572,7 +572,7 @@ - + @@ -678,7 +678,7 @@ - + @@ -795,7 +795,7 @@ - + @@ -958,7 +958,7 @@ - + @@ -1064,7 +1064,7 @@ - + @@ -1181,7 +1181,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ManyTextUnionsInSubquery.mdp b/src/backend/gporca/data/dxl/minidump/ManyTextUnionsInSubquery.mdp index 7e099f3c455..d85037c2e21 100644 --- a/src/backend/gporca/data/dxl/minidump/ManyTextUnionsInSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/ManyTextUnionsInSubquery.mdp @@ -209,7 +209,7 @@ - + @@ -256,7 +256,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MotionHazard-MaterializeUnderResult.mdp b/src/backend/gporca/data/dxl/minidump/MotionHazard-MaterializeUnderResult.mdp index cb322a3c44f..0fbd4c98287 100644 --- a/src/backend/gporca/data/dxl/minidump/MotionHazard-MaterializeUnderResult.mdp +++ b/src/backend/gporca/data/dxl/minidump/MotionHazard-MaterializeUnderResult.mdp @@ -51,7 +51,7 @@ Optimizer status: PQO version 2.67.0 - + @@ -88,7 +88,7 @@ Optimizer status: PQO version 2.67.0 - + @@ -125,7 +125,7 @@ Optimizer status: PQO version 2.67.0 - + diff --git a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeGatherUnderResult.mdp b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeGatherUnderResult.mdp index 669114be892..49d24220def 100644 --- a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeGatherUnderResult.mdp +++ b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeGatherUnderResult.mdp @@ -47,7 +47,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + @@ -84,7 +84,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + @@ -121,7 +121,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + diff --git a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeHashAggUnderResult.mdp b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeHashAggUnderResult.mdp index 729fd93f718..fa1969fa599 100644 --- a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeHashAggUnderResult.mdp +++ b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeHashAggUnderResult.mdp @@ -87,7 +87,7 @@ explain select f.k, f.subq from (select tab3.k, (select tab2.k from tab2 where t - + @@ -229,7 +229,7 @@ explain select f.k, f.subq from (select tab3.k, (select tab2.k from tab2 where t - + @@ -266,7 +266,7 @@ explain select f.k, f.subq from (select tab3.k, (select tab2.k from tab2 where t - + @@ -444,7 +444,7 @@ explain select f.k, f.subq from (select tab3.k, (select tab2.k from tab2 where t - + diff --git a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeSortUnderResult.mdp b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeSortUnderResult.mdp index 756e36d28ec..e962d457137 100644 --- a/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeSortUnderResult.mdp +++ b/src/backend/gporca/data/dxl/minidump/MotionHazard-NoMaterializeSortUnderResult.mdp @@ -53,7 +53,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + @@ -90,7 +90,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + @@ -127,7 +127,7 @@ explain select tab3.k, (select tab2.k from tab2 where tab2.i = tab1.i limit 1) a - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiColumnAggWithDefaultOpfamilies.mdp b/src/backend/gporca/data/dxl/minidump/MultiColumnAggWithDefaultOpfamilies.mdp index aa7a698541d..88278b79fe1 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiColumnAggWithDefaultOpfamilies.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiColumnAggWithDefaultOpfamilies.mdp @@ -124,7 +124,7 @@ - + @@ -161,7 +161,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiColumnDQA-InnerJoin-GroupBy-HashAggregate.mdp b/src/backend/gporca/data/dxl/minidump/MultiColumnDQA-InnerJoin-GroupBy-HashAggregate.mdp index f51f317160d..c75b21f9c4a 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiColumnDQA-InnerJoin-GroupBy-HashAggregate.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiColumnDQA-InnerJoin-GroupBy-HashAggregate.mdp @@ -44,7 +44,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiDistKeyJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/MultiDistKeyJoinCardinality.mdp index a29926e9ef5..168780a7f8d 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiDistKeyJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiDistKeyJoinCardinality.mdp @@ -1017,7 +1017,7 @@ - + @@ -1055,7 +1055,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiDistKeyWithOtherPredsJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/MultiDistKeyWithOtherPredsJoinCardinality.mdp index 61188629234..53221888944 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiDistKeyWithOtherPredsJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiDistKeyWithOtherPredsJoinCardinality.mdp @@ -329,7 +329,7 @@ - + @@ -466,7 +466,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiLevel-CorrelatedExec.mdp b/src/backend/gporca/data/dxl/minidump/MultiLevel-CorrelatedExec.mdp index e4a80950134..d8165557800 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiLevel-CorrelatedExec.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiLevel-CorrelatedExec.mdp @@ -729,10 +729,10 @@ - + - + @@ -754,14 +754,14 @@ - + - + @@ -772,7 +772,7 @@ - + @@ -788,7 +788,7 @@ - + @@ -806,7 +806,7 @@ - + @@ -817,7 +817,7 @@ - + @@ -837,7 +837,7 @@ - + @@ -949,35 +949,35 @@ - + - + - - - - - - - - + + - + - - + + + + + + + + - + @@ -985,10 +985,9 @@ - - + - + @@ -996,22 +995,34 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/MultiLevel-NOT-IN-Subquery.mdp b/src/backend/gporca/data/dxl/minidump/MultiLevel-NOT-IN-Subquery.mdp index 335168cc473..3e159071192 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiLevel-NOT-IN-Subquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiLevel-NOT-IN-Subquery.mdp @@ -53,7 +53,7 @@ select * from A,B where exists (select * from C where C.j = A.j and B.i not in ( - + @@ -87,7 +87,7 @@ select * from A,B where exists (select * from C where C.j = A.j and B.i not in ( - + @@ -129,7 +129,7 @@ select * from A,B where exists (select * from C where C.j = A.j and B.i not in ( - + diff --git a/src/backend/gporca/data/dxl/minidump/MultiLevelPartLossyCastNEq.mdp b/src/backend/gporca/data/dxl/minidump/MultiLevelPartLossyCastNEq.mdp index 3de8d865283..68eea09718d 100644 --- a/src/backend/gporca/data/dxl/minidump/MultiLevelPartLossyCastNEq.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultiLevelPartLossyCastNEq.mdp @@ -185,7 +185,7 @@ default subpartition other2 - + diff --git a/src/backend/gporca/data/dxl/minidump/MultipleDampedPredJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/MultipleDampedPredJoinCardinality.mdp index c24947d959d..72687d24e3d 100644 --- a/src/backend/gporca/data/dxl/minidump/MultipleDampedPredJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultipleDampedPredJoinCardinality.mdp @@ -2355,7 +2355,7 @@ explain select * from t1, t2 where t1.a=t2.a and t1.b=t2.b; - + @@ -2389,7 +2389,7 @@ explain select * from t1, t2 where t1.a=t2.a and t1.b=t2.b; - + diff --git a/src/backend/gporca/data/dxl/minidump/MultipleIndependentPredJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/MultipleIndependentPredJoinCardinality.mdp index cd1c9540018..d16d4056e0d 100644 --- a/src/backend/gporca/data/dxl/minidump/MultipleIndependentPredJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultipleIndependentPredJoinCardinality.mdp @@ -54,7 +54,7 @@ explain select * from t1, t2, t3 where t1.a = t2.a and t2.a = t3.a and t1.b = t3 - + @@ -88,7 +88,7 @@ explain select * from t1, t2, t3 where t1.a = t2.a and t2.a = t3.a and t1.b = t3 - + @@ -152,7 +152,7 @@ explain select * from t1, t2, t3 where t1.a = t2.a and t2.a = t3.a and t1.b = t3 - + diff --git a/src/backend/gporca/data/dxl/minidump/MultipleIndexPredicate.mdp b/src/backend/gporca/data/dxl/minidump/MultipleIndexPredicate.mdp index 59ef00dfe5b..a5b91af8ec0 100644 --- a/src/backend/gporca/data/dxl/minidump/MultipleIndexPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultipleIndexPredicate.mdp @@ -933,7 +933,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultipleSubqueriesInSelectClause.mdp b/src/backend/gporca/data/dxl/minidump/MultipleSubqueriesInSelectClause.mdp index c8366d9b548..00d724a032e 100644 --- a/src/backend/gporca/data/dxl/minidump/MultipleSubqueriesInSelectClause.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultipleSubqueriesInSelectClause.mdp @@ -1177,7 +1177,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/MultipleUpdateWithJoinOnDistCol.mdp b/src/backend/gporca/data/dxl/minidump/MultipleUpdateWithJoinOnDistCol.mdp index d9225757eda..256a776b8f3 100644 --- a/src/backend/gporca/data/dxl/minidump/MultipleUpdateWithJoinOnDistCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/MultipleUpdateWithJoinOnDistCol.mdp @@ -28,7 +28,7 @@ - + @@ -62,7 +62,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NLJ-Broadcast-DPE-Outer-Child.mdp b/src/backend/gporca/data/dxl/minidump/NLJ-Broadcast-DPE-Outer-Child.mdp index b0e1de85029..3aca30adcf0 100644 --- a/src/backend/gporca/data/dxl/minidump/NLJ-Broadcast-DPE-Outer-Child.mdp +++ b/src/backend/gporca/data/dxl/minidump/NLJ-Broadcast-DPE-Outer-Child.mdp @@ -64,7 +64,7 @@ select * from bmao_part as t1 join bmao_part as t2 on t1.a < t2.a where t1.a < 5 - + @@ -112,7 +112,7 @@ select * from bmao_part as t1 join bmao_part as t2 on t1.a < t2.a where t1.a < 5 - + @@ -160,7 +160,7 @@ select * from bmao_part as t1 join bmao_part as t2 on t1.a < t2.a where t1.a < 5 - + diff --git a/src/backend/gporca/data/dxl/minidump/NLJ-DistCol-No-Broadcast.mdp b/src/backend/gporca/data/dxl/minidump/NLJ-DistCol-No-Broadcast.mdp index 622f7f456c3..6cea113bf52 100644 --- a/src/backend/gporca/data/dxl/minidump/NLJ-DistCol-No-Broadcast.mdp +++ b/src/backend/gporca/data/dxl/minidump/NLJ-DistCol-No-Broadcast.mdp @@ -123,7 +123,7 @@ explain select * from a1,b1 where a1.a = b1.a; - + @@ -157,7 +157,7 @@ explain select * from a1,b1 where a1.a = b1.a; - + diff --git a/src/backend/gporca/data/dxl/minidump/NLJ-EqAllCol-No-Broadcast.mdp b/src/backend/gporca/data/dxl/minidump/NLJ-EqAllCol-No-Broadcast.mdp index 4c4edd3db07..4726320f9ef 100644 --- a/src/backend/gporca/data/dxl/minidump/NLJ-EqAllCol-No-Broadcast.mdp +++ b/src/backend/gporca/data/dxl/minidump/NLJ-EqAllCol-No-Broadcast.mdp @@ -124,7 +124,7 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a = b1.b; - + @@ -158,7 +158,7 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a = b1.b; - + @@ -305,33 +305,6 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a = b1.b; - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -364,6 +337,33 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a = b1.b; + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/NLJ-EqDistCol-InEqNonDistCol-No-Broadcast.mdp b/src/backend/gporca/data/dxl/minidump/NLJ-EqDistCol-InEqNonDistCol-No-Broadcast.mdp index 440be729ff1..cd1bc0caab9 100644 --- a/src/backend/gporca/data/dxl/minidump/NLJ-EqDistCol-InEqNonDistCol-No-Broadcast.mdp +++ b/src/backend/gporca/data/dxl/minidump/NLJ-EqDistCol-InEqNonDistCol-No-Broadcast.mdp @@ -131,7 +131,7 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a != b1.b; - + @@ -165,7 +165,7 @@ explain select * from a1,b1 where a1.a = b1.a and a1.a != b1.b; - + diff --git a/src/backend/gporca/data/dxl/minidump/NLJ-InEqDistCol-EqNonDistCol-Redistribute.mdp b/src/backend/gporca/data/dxl/minidump/NLJ-InEqDistCol-EqNonDistCol-Redistribute.mdp index 7bb27b967c1..f877c179f6c 100644 --- a/src/backend/gporca/data/dxl/minidump/NLJ-InEqDistCol-EqNonDistCol-Redistribute.mdp +++ b/src/backend/gporca/data/dxl/minidump/NLJ-InEqDistCol-EqNonDistCol-Redistribute.mdp @@ -134,7 +134,7 @@ explain select * from a1,b1 where a1.a != b1.a and a1.a = b1.b; - + @@ -168,7 +168,7 @@ explain select * from a1,b1 where a1.a != b1.a and a1.a = b1.b; - + diff --git a/src/backend/gporca/data/dxl/minidump/Name-Cardinality.mdp b/src/backend/gporca/data/dxl/minidump/Name-Cardinality.mdp index 178fbef557d..571f429f35e 100644 --- a/src/backend/gporca/data/dxl/minidump/Name-Cardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/Name-Cardinality.mdp @@ -26,7 +26,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NaryWithLojAndNonLojChilds.mdp b/src/backend/gporca/data/dxl/minidump/NaryWithLojAndNonLojChilds.mdp index 742c0375480..021380ef66b 100644 --- a/src/backend/gporca/data/dxl/minidump/NaryWithLojAndNonLojChilds.mdp +++ b/src/backend/gporca/data/dxl/minidump/NaryWithLojAndNonLojChilds.mdp @@ -228,7 +228,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -296,7 +296,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -364,7 +364,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Negative-IndexApply1.mdp b/src/backend/gporca/data/dxl/minidump/Negative-IndexApply1.mdp index 030860e2560..b6099d48cea 100644 --- a/src/backend/gporca/data/dxl/minidump/Negative-IndexApply1.mdp +++ b/src/backend/gporca/data/dxl/minidump/Negative-IndexApply1.mdp @@ -30,7 +30,7 @@ select * from z,tt where tt.i=5 and z.i=6 ; - + @@ -74,7 +74,7 @@ select * from z,tt where tt.i=5 and z.i=6 ; - + diff --git a/src/backend/gporca/data/dxl/minidump/Negative-IndexApply2.mdp b/src/backend/gporca/data/dxl/minidump/Negative-IndexApply2.mdp index ef1598a7b2e..029c1fb5af8 100644 --- a/src/backend/gporca/data/dxl/minidump/Negative-IndexApply2.mdp +++ b/src/backend/gporca/data/dxl/minidump/Negative-IndexApply2.mdp @@ -35,7 +35,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + @@ -89,7 +89,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + @@ -131,7 +131,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + @@ -223,7 +223,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + @@ -297,7 +297,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + @@ -342,7 +342,7 @@ select * from z_p,tt_p where tt_p.i=5 and z_p.i=6; - + diff --git a/src/backend/gporca/data/dxl/minidump/Nested-Setops-2.mdp b/src/backend/gporca/data/dxl/minidump/Nested-Setops-2.mdp index 4025d22c3d6..de75b6dc62b 100644 --- a/src/backend/gporca/data/dxl/minidump/Nested-Setops-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/Nested-Setops-2.mdp @@ -595,7 +595,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NestedInSubqWithPrjListOuterRefNoInnerRef.mdp b/src/backend/gporca/data/dxl/minidump/NestedInSubqWithPrjListOuterRefNoInnerRef.mdp index f606fb1f3d5..4af13e588ab 100644 --- a/src/backend/gporca/data/dxl/minidump/NestedInSubqWithPrjListOuterRefNoInnerRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/NestedInSubqWithPrjListOuterRefNoInnerRef.mdp @@ -55,7 +55,7 @@ EXPLAIN SELECT * FROM foo WHERE foo.a IN (SELECT foo.b + 1 FROM (SELECT * FROM b - + @@ -85,7 +85,7 @@ EXPLAIN SELECT * FROM foo WHERE foo.a IN (SELECT foo.b + 1 FROM (SELECT * FROM b - + @@ -121,7 +121,7 @@ EXPLAIN SELECT * FROM foo WHERE foo.a IN (SELECT foo.b + 1 FROM (SELECT * FROM b - + @@ -699,7 +699,7 @@ EXPLAIN SELECT * FROM foo WHERE foo.a IN (SELECT foo.b + 1 FROM (SELECT * FROM b - + diff --git a/src/backend/gporca/data/dxl/minidump/NestedJoinWithCastedColumn.mdp b/src/backend/gporca/data/dxl/minidump/NestedJoinWithCastedColumn.mdp index f4f8f5c5936..fe4e5490123 100644 --- a/src/backend/gporca/data/dxl/minidump/NestedJoinWithCastedColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/NestedJoinWithCastedColumn.mdp @@ -244,7 +244,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -336,7 +336,7 @@ - + @@ -370,7 +370,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NestedNLJWithBlockingSpool.mdp b/src/backend/gporca/data/dxl/minidump/NestedNLJWithBlockingSpool.mdp index c2bda2ad798..4fee876e4ba 100644 --- a/src/backend/gporca/data/dxl/minidump/NestedNLJWithBlockingSpool.mdp +++ b/src/backend/gporca/data/dxl/minidump/NestedNLJWithBlockingSpool.mdp @@ -55,7 +55,7 @@ - + @@ -360,7 +360,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NestedSubqLimitBindings.mdp b/src/backend/gporca/data/dxl/minidump/NestedSubqLimitBindings.mdp index f83e00dd05e..7b468a15777 100644 --- a/src/backend/gporca/data/dxl/minidump/NestedSubqLimitBindings.mdp +++ b/src/backend/gporca/data/dxl/minidump/NestedSubqLimitBindings.mdp @@ -38,7 +38,7 @@ select a from t as t1 where a in ( - + diff --git a/src/backend/gporca/data/dxl/minidump/NewBtreeIndexScanCost.mdp b/src/backend/gporca/data/dxl/minidump/NewBtreeIndexScanCost.mdp index 815337596ae..63f1e5248f4 100644 --- a/src/backend/gporca/data/dxl/minidump/NewBtreeIndexScanCost.mdp +++ b/src/backend/gporca/data/dxl/minidump/NewBtreeIndexScanCost.mdp @@ -2345,7 +2345,7 @@ explain select * from oip oip join ria a on ip=cidr and oip.oid=194073; - + @@ -3993,7 +3993,7 @@ explain select * from oip oip join ria a on ip=cidr and oip.oid=194073; - + diff --git a/src/backend/gporca/data/dxl/minidump/NoBroadcastUnderGatherForWindowFunction.mdp b/src/backend/gporca/data/dxl/minidump/NoBroadcastUnderGatherForWindowFunction.mdp index 4061c4d4b1c..94e245998d1 100644 --- a/src/backend/gporca/data/dxl/minidump/NoBroadcastUnderGatherForWindowFunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoBroadcastUnderGatherForWindowFunction.mdp @@ -329,7 +329,7 @@ WHERE buyer_name = 'ABC' - + diff --git a/src/backend/gporca/data/dxl/minidump/NoDistKeyMultiPredJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/NoDistKeyMultiPredJoinCardinality.mdp index 4059575dbe2..8b30a35ba7b 100644 --- a/src/backend/gporca/data/dxl/minidump/NoDistKeyMultiPredJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoDistKeyMultiPredJoinCardinality.mdp @@ -1447,7 +1447,7 @@ - + @@ -1487,7 +1487,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NoPartConstraint-WhenNoDefaultPartsAndIndices.mdp b/src/backend/gporca/data/dxl/minidump/NoPartConstraint-WhenNoDefaultPartsAndIndices.mdp index 9dbf4a0fad6..3f7a254d8c8 100644 --- a/src/backend/gporca/data/dxl/minidump/NoPartConstraint-WhenNoDefaultPartsAndIndices.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoPartConstraint-WhenNoDefaultPartsAndIndices.mdp @@ -260,7 +260,7 @@ EXPLAIN SELECT * FROM date_parts WHERE month BETWEEN 1 AND 4; - + diff --git a/src/backend/gporca/data/dxl/minidump/NoPartPropagationPlan.mdp b/src/backend/gporca/data/dxl/minidump/NoPartPropagationPlan.mdp index b2e50ca977c..22e93edb475 100644 --- a/src/backend/gporca/data/dxl/minidump/NoPartPropagationPlan.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoPartPropagationPlan.mdp @@ -601,7 +601,7 @@ - + @@ -649,7 +649,7 @@ - + @@ -697,7 +697,7 @@ - + @@ -745,7 +745,7 @@ - + @@ -793,7 +793,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NoPushdownPredicateWithCTEAnchor.mdp b/src/backend/gporca/data/dxl/minidump/NoPushdownPredicateWithCTEAnchor.mdp index 5a003841e4d..b0c783c9a7c 100644 --- a/src/backend/gporca/data/dxl/minidump/NoPushdownPredicateWithCTEAnchor.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoPushdownPredicateWithCTEAnchor.mdp @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NoRedistributeOnAppend.mdp b/src/backend/gporca/data/dxl/minidump/NoRedistributeOnAppend.mdp index 57c76fade40..95fa12195db 100644 --- a/src/backend/gporca/data/dxl/minidump/NoRedistributeOnAppend.mdp +++ b/src/backend/gporca/data/dxl/minidump/NoRedistributeOnAppend.mdp @@ -186,7 +186,7 @@ GROUP BY b; - + diff --git a/src/backend/gporca/data/dxl/minidump/NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp index 55a008f0d4b..ddd9673389c 100644 --- a/src/backend/gporca/data/dxl/minidump/NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/NonOverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp @@ -176,7 +176,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -370,7 +370,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NonSingleton.mdp b/src/backend/gporca/data/dxl/minidump/NonSingleton.mdp index 3f167c1bef2..3cba1b4b055 100644 --- a/src/backend/gporca/data/dxl/minidump/NonSingleton.mdp +++ b/src/backend/gporca/data/dxl/minidump/NonSingleton.mdp @@ -153,7 +153,7 @@ EXPLAIN SELECT a FROM snackbox JOIN (SELECT c FROM hottoast LIMIT 3) hottoast ON - + @@ -184,7 +184,7 @@ EXPLAIN SELECT a FROM snackbox JOIN (SELECT c FROM hottoast LIMIT 3) hottoast ON - + diff --git a/src/backend/gporca/data/dxl/minidump/NonSplittableAgg.mdp b/src/backend/gporca/data/dxl/minidump/NonSplittableAgg.mdp index b1cb0daef82..62b5f115111 100644 --- a/src/backend/gporca/data/dxl/minidump/NonSplittableAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/NonSplittableAgg.mdp @@ -161,7 +161,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NotExists-SuperflousOuterRefWithGbAgg.mdp b/src/backend/gporca/data/dxl/minidump/NotExists-SuperflousOuterRefWithGbAgg.mdp index fe8782b210a..1206d39e4d9 100644 --- a/src/backend/gporca/data/dxl/minidump/NotExists-SuperflousOuterRefWithGbAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/NotExists-SuperflousOuterRefWithGbAgg.mdp @@ -38,7 +38,7 @@ explain select * from A where not exists (select sum(C.i) from C where C.i = A.i - + @@ -72,7 +72,7 @@ explain select * from A where not exists (select sum(C.i) from C where C.i = A.i - + diff --git a/src/backend/gporca/data/dxl/minidump/NotInToLASJ.mdp b/src/backend/gporca/data/dxl/minidump/NotInToLASJ.mdp index dafd13c1c2b..68f565bd57e 100644 --- a/src/backend/gporca/data/dxl/minidump/NotInToLASJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/NotInToLASJ.mdp @@ -240,7 +240,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/NotWellDefinedDisjunctConjunctPredicates.mdp b/src/backend/gporca/data/dxl/minidump/NotWellDefinedDisjunctConjunctPredicates.mdp index db2088877a4..25aad185489 100644 --- a/src/backend/gporca/data/dxl/minidump/NotWellDefinedDisjunctConjunctPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/NotWellDefinedDisjunctConjunctPredicates.mdp @@ -50,7 +50,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/OR-WithIsNullPred.mdp b/src/backend/gporca/data/dxl/minidump/OR-WithIsNullPred.mdp index c1ecc186b6c..680f17b3b73 100644 --- a/src/backend/gporca/data/dxl/minidump/OR-WithIsNullPred.mdp +++ b/src/backend/gporca/data/dxl/minidump/OR-WithIsNullPred.mdp @@ -178,7 +178,7 @@ explain select * from test_stat where c <> 'J' or c is null; - + diff --git a/src/backend/gporca/data/dxl/minidump/OneDistKeyMultiPredJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/OneDistKeyMultiPredJoinCardinality.mdp index 499bc84bb68..ee528b45c59 100644 --- a/src/backend/gporca/data/dxl/minidump/OneDistKeyMultiPredJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/OneDistKeyMultiPredJoinCardinality.mdp @@ -368,7 +368,7 @@ - + @@ -408,7 +408,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/OneLevel-CorrelatedExec.mdp b/src/backend/gporca/data/dxl/minidump/OneLevel-CorrelatedExec.mdp index 95bdb34022f..8f0085feaa2 100644 --- a/src/backend/gporca/data/dxl/minidump/OneLevel-CorrelatedExec.mdp +++ b/src/backend/gporca/data/dxl/minidump/OneLevel-CorrelatedExec.mdp @@ -737,7 +737,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/OneSegmentGather.mdp b/src/backend/gporca/data/dxl/minidump/OneSegmentGather.mdp index 804fcce9f3e..fdbfb283700 100644 --- a/src/backend/gporca/data/dxl/minidump/OneSegmentGather.mdp +++ b/src/backend/gporca/data/dxl/minidump/OneSegmentGather.mdp @@ -299,7 +299,7 @@ WHERE filter_col = 'TEST' - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_array_fraction.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_array_fraction.mdp index af3702651e1..e3d75e73e02 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_array_fraction.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_array_fraction.mdp @@ -205,7 +205,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_computed_col.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_computed_col.mdp index cf2df6a061f..d709b4ac1a6 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_computed_col.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_computed_col.mdp @@ -212,7 +212,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_diffcol.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_diffcol.mdp index 004c7a27d6e..34bf692f1ab 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_diffcol.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_diffcol.mdp @@ -69,7 +69,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a1), percentile_cont(0 - + @@ -445,7 +445,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a1), percentile_cont(0 - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol.mdp index adb4a3eb4cc..65310b9b273 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol.mdp @@ -50,7 +50,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2), percentile_disc(0 - + @@ -430,7 +430,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2), percentile_disc(0 - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol_difforderespec.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol_difforderespec.mdp index e7f6adb4063..6e98380dab6 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol_difforderespec.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_multiple_samecol_difforderespec.mdp @@ -71,7 +71,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2), percentile_cont(0 - + @@ -441,7 +441,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2), percentile_cont(0 - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_single.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_single.mdp index 3a6e98a90fb..4e83293fe4c 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_single.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_single.mdp @@ -49,7 +49,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2) FROM foo; - + @@ -391,7 +391,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a2) FROM foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_skewed_data.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_skewed_data.mdp index 033df43324a..97105e70e43 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_skewed_data.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_skewed_data.mdp @@ -54,7 +54,7 @@ EXPLAIN ANALYZE SELECT percentile_cont(0.25) WITHIN GROUP (ORDER BY a ASC nulls - + @@ -352,7 +352,7 @@ EXPLAIN ANALYZE SELECT percentile_cont(0.25) WITHIN GROUP (ORDER BY a ASC nulls - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_groupby.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_groupby.mdp index 461d1b0dcd8..e2dea089101 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_groupby.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_groupby.mdp @@ -208,7 +208,7 @@ Optimizer: Pivotal Optimizer (GPORCA) - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonOrderedAgg.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonOrderedAgg.mdp index 89442d5e72a..c1c60948f91 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonOrderedAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonOrderedAgg.mdp @@ -81,7 +81,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a1), percentile_disc(0 - + @@ -498,7 +498,7 @@ EXPLAIN SELECT percentile_cont(0.5) WITHIN GROUP(ORDER BY a1), percentile_disc(0 - + diff --git a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonconst_fraction.mdp b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonconst_fraction.mdp index 732a0f6d403..6048164c3ca 100644 --- a/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonconst_fraction.mdp +++ b/src/backend/gporca/data/dxl/minidump/OrderedAgg_with_nonconst_fraction.mdp @@ -54,7 +54,7 @@ EXPLAIN SELECT percentile_cont(floor(random()*0.1)+0.5) WITHIN GROUP(ORDER BY a1 - + @@ -436,7 +436,7 @@ EXPLAIN SELECT percentile_cont(floor(random()*0.1)+0.5) WITHIN GROUP(ORDER BY a1 - + diff --git a/src/backend/gporca/data/dxl/minidump/OuterJoinOnViewWithCastedColumn.mdp b/src/backend/gporca/data/dxl/minidump/OuterJoinOnViewWithCastedColumn.mdp index 27d0454a96c..dd42d8dc8c7 100644 --- a/src/backend/gporca/data/dxl/minidump/OuterJoinOnViewWithCastedColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/OuterJoinOnViewWithCastedColumn.mdp @@ -177,7 +177,7 @@ - + @@ -214,7 +214,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp index 844f6eef602..12fdc5f1229 100644 --- a/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-ANDPredicate-HEAP.mdp @@ -172,7 +172,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -349,7 +349,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-HEAP.mdp index 15d3d9cd0ab..c2460a44626 100644 --- a/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/OverlappingHomogenousIndexesOnRoot-HEAP.mdp @@ -172,7 +172,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -349,7 +349,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-1.mdp b/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-1.mdp index c408372b8a6..f3b8d5822c1 100644 --- a/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-1.mdp @@ -65,7 +65,7 @@ select * from P where a = ANY ('{1,2,3}'::integer[]); - + @@ -113,7 +113,7 @@ select * from P where a = ANY ('{1,2,3}'::integer[]); - + @@ -161,7 +161,7 @@ select * from P where a = ANY ('{1,2,3}'::integer[]); - + diff --git a/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-2.mdp b/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-2.mdp index 09802b2a8c8..78b8e89a323 100644 --- a/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/Part-Selection-ConstArray-2.mdp @@ -65,7 +65,7 @@ select * from P where a > ALL ('{1,2,3}'::integer[]); - + @@ -113,7 +113,7 @@ select * from P where a > ALL ('{1,2,3}'::integer[]); - + @@ -161,7 +161,7 @@ select * from P where a > ALL ('{1,2,3}'::integer[]); - + diff --git a/src/backend/gporca/data/dxl/minidump/Part-Selection-IN.mdp b/src/backend/gporca/data/dxl/minidump/Part-Selection-IN.mdp index cdc35e0ca5d..a36b860465a 100644 --- a/src/backend/gporca/data/dxl/minidump/Part-Selection-IN.mdp +++ b/src/backend/gporca/data/dxl/minidump/Part-Selection-IN.mdp @@ -65,7 +65,7 @@ Select * from P where P.a IN (1,2); - + @@ -113,7 +113,7 @@ Select * from P where P.a IN (1,2); - + @@ -161,7 +161,7 @@ Select * from P where P.a IN (1,2); - + diff --git a/src/backend/gporca/data/dxl/minidump/Part-Selection-NOT-IN.mdp b/src/backend/gporca/data/dxl/minidump/Part-Selection-NOT-IN.mdp index abaf701e05d..8294847bb00 100644 --- a/src/backend/gporca/data/dxl/minidump/Part-Selection-NOT-IN.mdp +++ b/src/backend/gporca/data/dxl/minidump/Part-Selection-NOT-IN.mdp @@ -65,7 +65,7 @@ Select * from P where P.a NOT IN (1,2); - + @@ -113,7 +113,7 @@ Select * from P where P.a NOT IN (1,2); - + @@ -161,7 +161,7 @@ Select * from P where P.a NOT IN (1,2); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenDefaultPartsAndIndices.mdp b/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenDefaultPartsAndIndices.mdp index 122e7c7fea6..0cb3eab70bb 100644 --- a/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenDefaultPartsAndIndices.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenDefaultPartsAndIndices.mdp @@ -175,7 +175,7 @@ EXPLAIN SELECT * FROM date_parts WHERE month BETWEEN 1 AND 4; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenIndicesAndNoDefaultParts.mdp b/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenIndicesAndNoDefaultParts.mdp index a00513acb7c..e7896e0ed3c 100644 --- a/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenIndicesAndNoDefaultParts.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartConstraint-WhenIndicesAndNoDefaultParts.mdp @@ -51,7 +51,7 @@ EXPLAIN SELECT * FROM date_parts WHERE year BETWEEN 2002 AND 2003; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartConstraint-WithOnlyDefaultPartInfo.mdp b/src/backend/gporca/data/dxl/minidump/PartConstraint-WithOnlyDefaultPartInfo.mdp index c4f1663879b..a1ca1417f19 100644 --- a/src/backend/gporca/data/dxl/minidump/PartConstraint-WithOnlyDefaultPartInfo.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartConstraint-WithOnlyDefaultPartInfo.mdp @@ -40,7 +40,7 @@ EXPLAIN SELECT * FROM date_parts WHERE month BETWEEN 1 AND 4; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartPredsWithRandom.mdp b/src/backend/gporca/data/dxl/minidump/PartPredsWithRandom.mdp index bfe628b88c2..26520a1e7fe 100644 --- a/src/backend/gporca/data/dxl/minidump/PartPredsWithRandom.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartPredsWithRandom.mdp @@ -32,7 +32,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -175,7 +175,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -430,9 +430,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide.mdp b/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide.mdp index 2d1053ed9fc..5268bff3f72 100644 --- a/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide.mdp @@ -48,7 +48,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -207,7 +207,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -369,7 +369,7 @@ - + @@ -423,7 +423,7 @@ - + @@ -477,7 +477,7 @@ - + @@ -531,7 +531,7 @@ - + @@ -585,7 +585,7 @@ - + @@ -1275,7 +1275,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide2.mdp b/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide2.mdp index 8fd501c1ea7..318112c7cae 100644 --- a/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartSelectorOnJoinSide2.mdp @@ -158,7 +158,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -317,7 +317,7 @@ - + @@ -371,7 +371,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -479,7 +479,7 @@ - + @@ -533,7 +533,7 @@ - + @@ -587,7 +587,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -695,7 +695,7 @@ - + @@ -1306,7 +1306,7 @@ - + @@ -1357,7 +1357,7 @@ - + @@ -1411,7 +1411,7 @@ - + @@ -1465,7 +1465,7 @@ - + @@ -1519,7 +1519,7 @@ - + @@ -1573,7 +1573,7 @@ - + @@ -1627,7 +1627,7 @@ - + @@ -1681,7 +1681,7 @@ - + @@ -1735,7 +1735,7 @@ - + @@ -1789,7 +1789,7 @@ - + @@ -1843,7 +1843,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-AggWithExistentialSubquery.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-AggWithExistentialSubquery.mdp index 01e322a01bc..2876bc2e8d1 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-AggWithExistentialSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-AggWithExistentialSubquery.mdp @@ -229,7 +229,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -309,7 +309,7 @@ - + @@ -363,7 +363,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayCoerce.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayCoerce.mdp index 239bde14d11..a95424a5db8 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayCoerce.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayCoerce.mdp @@ -58,7 +58,7 @@ select * from pt where gender in ( 'F', 'FM'); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayIn.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayIn.mdp index b6e8aaeaffa..cd0a81a2ea9 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayIn.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ArrayIn.mdp @@ -217,7 +217,7 @@ WHERE b in (1,2); - + @@ -271,7 +271,7 @@ WHERE b in (1,2); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-AsymmetricRangePredicate.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-AsymmetricRangePredicate.mdp index d2932ec5860..918102549f8 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-AsymmetricRangePredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-AsymmetricRangePredicate.mdp @@ -228,7 +228,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-AvoidRangePred-DPE.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-AvoidRangePred-DPE.mdp index 1e885e1f316..64ada6a709b 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-AvoidRangePred-DPE.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-AvoidRangePred-DPE.mdp @@ -632,7 +632,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -689,7 +689,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -737,7 +737,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -785,7 +785,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -833,7 +833,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -881,7 +881,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -929,7 +929,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -977,7 +977,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1025,7 +1025,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1073,7 +1073,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1121,7 +1121,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1169,7 +1169,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1217,7 +1217,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1265,7 +1265,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1313,7 +1313,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1361,7 +1361,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1409,7 +1409,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1457,7 +1457,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1505,7 +1505,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1553,7 +1553,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1601,7 +1601,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1649,7 +1649,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1697,7 +1697,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1748,7 +1748,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + @@ -1782,7 +1782,7 @@ FROM abuela JOIN bar ON a = c AND b BETWEEN d - 1 AND d + 4 - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-NonPartKey.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-NonPartKey.mdp index 0fb0f834227..c96ecd4bb51 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-NonPartKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-NonPartKey.mdp @@ -243,7 +243,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -351,7 +351,7 @@ - + @@ -405,7 +405,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -608,7 +608,7 @@ - + @@ -628,7 +628,7 @@ - + @@ -709,7 +709,7 @@ - + @@ -756,9 +756,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-PartKey.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-PartKey.mdp index 5cf4c9dc4f8..e981b5a373a 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-PartKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-CSQ-PartKey.mdp @@ -243,7 +243,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -351,7 +351,7 @@ - + @@ -405,7 +405,7 @@ - + @@ -459,7 +459,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate1.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate1.mdp index dfc498cc07f..d0e547b03e9 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate1.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate1.mdp @@ -197,7 +197,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -248,7 +248,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -299,7 +299,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -350,7 +350,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -401,7 +401,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -452,7 +452,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -503,7 +503,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -554,7 +554,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -605,7 +605,7 @@ explain select * from foo where b = 25 or b = 35; - + @@ -656,7 +656,7 @@ explain select * from foo where b = 25 or b = 35; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate2.mdp index 59bda37ed09..19b60233845 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate2.mdp @@ -197,7 +197,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -248,7 +248,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -299,7 +299,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -350,7 +350,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -401,7 +401,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -452,7 +452,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -503,7 +503,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -554,7 +554,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -605,7 +605,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + @@ -656,7 +656,7 @@ explain select * from foo where (b = 25 and a > 10) or b<15; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate3.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate3.mdp index 7b008a794c8..63df885018e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate3.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate3.mdp @@ -197,7 +197,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -248,7 +248,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -299,7 +299,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -350,7 +350,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -401,7 +401,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -452,7 +452,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -503,7 +503,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -554,7 +554,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -605,7 +605,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + @@ -656,7 +656,7 @@ explain select * from foo where (b = 25 and a > 10) or (b<15 and a>5); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate4.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate4.mdp index 31e2d64ad99..45a7d73241e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate4.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate4.mdp @@ -197,7 +197,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -248,7 +248,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -299,7 +299,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -350,7 +350,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -401,7 +401,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -452,7 +452,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -503,7 +503,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -554,7 +554,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -605,7 +605,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + @@ -656,7 +656,7 @@ explain select * from foo where ((b = 25 or b=35) and a > 10) or (b<15 and a>5); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate5.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate5.mdp index fc80fb6b6c7..148db337439 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate5.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexPredicate5.mdp @@ -185,7 +185,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -236,7 +236,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -287,7 +287,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -338,7 +338,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -389,7 +389,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -440,7 +440,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -491,7 +491,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -542,7 +542,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -593,7 +593,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + @@ -644,7 +644,7 @@ explain select * from foo where (b > 25 and b<35 and a > 10) or (b<15 and a>5); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-DefaultPart.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-DefaultPart.mdp index 1a535bce2b0..c797efd1253 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-DefaultPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-DefaultPart.mdp @@ -223,7 +223,7 @@ - + @@ -277,7 +277,7 @@ - + @@ -331,7 +331,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-NoDefaultPart.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-NoDefaultPart.mdp index 2cac6da74f2..890edd8d88b 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-NoDefaultPart.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-ComplexRangePredicate-NoDefaultPart.mdp @@ -200,7 +200,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -296,7 +296,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Correlated-NLOuter.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Correlated-NLOuter.mdp index 50b20fa5d38..adb16db6827 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Correlated-NLOuter.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Correlated-NLOuter.mdp @@ -125,7 +125,7 @@ select (select h.i from t2) from h where h.j = 1; - + @@ -162,7 +162,7 @@ select (select h.i from t2) from h where h.j = 1; - + @@ -202,7 +202,7 @@ select (select h.i from t2) from h where h.j = 1; - + @@ -253,7 +253,7 @@ select (select h.i from t2) from h where h.j = 1; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-GroupBy.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-GroupBy.mdp index becfc3a198c..17207539435 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-GroupBy.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-GroupBy.mdp @@ -305,7 +305,7 @@ - + @@ -362,7 +362,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -476,7 +476,7 @@ - + @@ -533,7 +533,7 @@ - + @@ -821,10 +821,10 @@ - + - + @@ -847,7 +847,7 @@ - + @@ -876,7 +876,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Limit.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Limit.mdp index f28445857a9..046d15cee7e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Limit.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-Limit.mdp @@ -268,7 +268,7 @@ - + @@ -325,7 +325,7 @@ - + @@ -382,7 +382,7 @@ - + @@ -439,7 +439,7 @@ - + @@ -496,7 +496,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-WindowFunction.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-WindowFunction.mdp index 20abda2e172..6973bc8ac40 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-WindowFunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE-WindowFunction.mdp @@ -572,7 +572,7 @@ - + @@ -620,7 +620,7 @@ - + @@ -668,7 +668,7 @@ - + @@ -716,7 +716,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE.mdp index b4b5326b42b..95b7e8feaea 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DPE.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DPE.mdp @@ -198,7 +198,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -348,7 +348,7 @@ - + @@ -398,7 +398,7 @@ - + @@ -448,7 +448,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DTS.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DTS.mdp index 07bd5311398..3d1e4c26189 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DTS.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DTS.mdp @@ -155,7 +155,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -347,7 +347,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DTSEq.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DTSEq.mdp index a38bf11a539..5fc646209b7 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DTSEq.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DTSEq.mdp @@ -163,7 +163,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -307,7 +307,7 @@ - + @@ -355,7 +355,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DTSLessThan.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DTSLessThan.mdp index 911ce6c1330..c1b184b8813 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DTSLessThan.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DTSLessThan.mdp @@ -166,7 +166,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -358,7 +358,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DateTime.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DateTime.mdp index 309dfe92cfd..ab1c90ea730 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DateTime.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DateTime.mdp @@ -296,7 +296,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -476,7 +476,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelection.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelection.mdp index a202db193d5..e0373d2be55 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelection.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelection.mdp @@ -167,7 +167,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -359,7 +359,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelectionJoin.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelectionJoin.mdp index 7f455371889..280ba608b7a 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelectionJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-DisablePartSelectionJoin.mdp @@ -513,7 +513,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -609,7 +609,7 @@ - + @@ -657,7 +657,7 @@ - + @@ -705,7 +705,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-Disjunction.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-Disjunction.mdp index b2c2be86336..3b035961aab 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-Disjunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-Disjunction.mdp @@ -218,7 +218,7 @@ WHERE b = 1 or b = 2; - + @@ -272,7 +272,7 @@ WHERE b = 1 or b = 2; - + @@ -326,7 +326,7 @@ WHERE b = 1 or b = 2; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-EqPredicateWithCastRange.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-EqPredicateWithCastRange.mdp index a1eea42923d..5029458abf4 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-EqPredicateWithCastRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-EqPredicateWithCastRange.mdp @@ -35,7 +35,7 @@ explain select * from R where b::int8=5::int8; - + @@ -73,7 +73,7 @@ explain select * from R where b::int8=5::int8; - + @@ -121,7 +121,7 @@ explain select * from R where b::int8=5::int8; - + @@ -169,7 +169,7 @@ explain select * from R where b::int8=5::int8; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ1.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ1.mdp index 8d937f47841..abbf8d487d4 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ1.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ1.mdp @@ -163,7 +163,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -307,7 +307,7 @@ - + @@ -355,7 +355,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ2.mdp index ffe3715c9c6..673521b1d9b 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ2.mdp @@ -304,7 +304,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -400,7 +400,7 @@ - + @@ -448,7 +448,7 @@ - + @@ -496,7 +496,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ3.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ3.mdp index be95c5c447d..da49991b718 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ3.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ3.mdp @@ -172,7 +172,7 @@ - + @@ -220,7 +220,7 @@ - + @@ -268,7 +268,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -364,7 +364,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ4.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ4.mdp index 4335ede6ff9..5f4c504a6d3 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ4.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ4.mdp @@ -196,7 +196,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -286,7 +286,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -504,7 +504,7 @@ - + @@ -549,7 +549,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -639,7 +639,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ5.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ5.mdp index 5431d1b901c..a77d61434d5 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-HJ5.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-HJ5.mdp @@ -120,7 +120,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -168,7 +168,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -289,7 +289,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -337,7 +337,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -385,7 +385,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -433,7 +433,7 @@ select * from s,t where s.b=t.a and t.b=35; - + @@ -481,7 +481,7 @@ select * from s,t where s.b=t.a and t.b=35; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFList.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFList.mdp index b605c083a57..402fd58cd13 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFList.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFList.mdp @@ -164,7 +164,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + @@ -207,7 +207,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + @@ -254,7 +254,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + @@ -301,7 +301,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + @@ -348,7 +348,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + @@ -389,7 +389,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM 2; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFNull.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFNull.mdp index 4866221b4f8..4eb8cc2aaa4 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFNull.mdp @@ -140,7 +140,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + @@ -183,7 +183,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + @@ -230,7 +230,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + @@ -277,7 +277,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + @@ -324,7 +324,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + @@ -365,7 +365,7 @@ EXPLAIN SELECT * FROM listfoo WHERE b IS DISTINCT FROM NULL; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFWithCast.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFWithCast.mdp index f03fe2cf6e9..e38d1128480 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IDFWithCast.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IDFWithCast.mdp @@ -25,7 +25,7 @@ explain select * from L where 2::numeric is distinct from b::numeric; - + @@ -63,7 +63,7 @@ explain select * from L where 2::numeric is distinct from b::numeric; - + @@ -107,7 +107,7 @@ explain select * from L where 2::numeric is distinct from b::numeric; - + @@ -151,7 +151,7 @@ explain select * from L where 2::numeric is distinct from b::numeric; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IndexOnDefPartOnly.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IndexOnDefPartOnly.mdp index d3794129456..de1a16ba1da 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IndexOnDefPartOnly.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IndexOnDefPartOnly.mdp @@ -151,7 +151,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -214,7 +214,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -277,7 +277,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -340,7 +340,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -403,7 +403,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -466,7 +466,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -634,7 +634,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -697,7 +697,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -760,7 +760,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -823,7 +823,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -886,7 +886,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + @@ -949,7 +949,7 @@ SELECT * FROM pt_lt_tab WHERE col2 = 15 ORDER BY col2,col3 LIMIT 5; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IsNotNullPredicate.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IsNotNullPredicate.mdp index 1e96f59e972..dd10a897ff8 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IsNotNullPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IsNotNullPredicate.mdp @@ -154,7 +154,7 @@ explain select * from foo where b is not null; - + @@ -205,7 +205,7 @@ explain select * from foo where b is not null; - + @@ -256,7 +256,7 @@ explain select * from foo where b is not null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-IsNullPredicate.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-IsNullPredicate.mdp index 1074e37cf17..10d4f39589b 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-IsNullPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-IsNullPredicate.mdp @@ -189,7 +189,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + @@ -240,7 +240,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + @@ -291,7 +291,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + @@ -342,7 +342,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + @@ -393,7 +393,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + @@ -444,7 +444,7 @@ explain select * from dd_part_singlecol where a is null and b is null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverExcept.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverExcept.mdp index 4e183fdda04..064e32cb392 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverExcept.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverExcept.mdp @@ -440,7 +440,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -488,7 +488,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -536,7 +536,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -584,7 +584,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -632,7 +632,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -1261,7 +1261,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -1309,7 +1309,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -1357,7 +1357,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -1405,7 +1405,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + @@ -1453,7 +1453,7 @@ select * from (select * from p1 except select * from p2) as p, tt where p.b=tt.b - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg-2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg-2.mdp index d771f10c64f..801e516eff1 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg-2.mdp @@ -628,7 +628,7 @@ - + @@ -679,7 +679,7 @@ - + @@ -730,7 +730,7 @@ - + @@ -781,7 +781,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -924,7 +924,7 @@ - + @@ -975,7 +975,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg.mdp index 90c505e5172..893091bab41 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverGbAgg.mdp @@ -203,7 +203,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -347,7 +347,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -488,7 +488,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -584,7 +584,7 @@ - + @@ -632,7 +632,7 @@ - + @@ -680,7 +680,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverIntersect.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverIntersect.mdp index 4d521c5e482..b5f934a42a6 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverIntersect.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverIntersect.mdp @@ -440,7 +440,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -488,7 +488,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -536,7 +536,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -584,7 +584,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -632,7 +632,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -1261,7 +1261,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -1309,7 +1309,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -1357,7 +1357,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -1405,7 +1405,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + @@ -1453,7 +1453,7 @@ select * from (select * from p1 intersect select * from p2) as p, tt where p.b=t - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-1.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-1.mdp index 6c7793c2d69..e5d904431f3 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-1.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-1.mdp @@ -440,7 +440,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -488,7 +488,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -536,7 +536,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -584,7 +584,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -632,7 +632,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -1261,7 +1261,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -1309,7 +1309,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -1357,7 +1357,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -1405,7 +1405,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + @@ -1453,7 +1453,7 @@ select * from (select * from p1 union all select * from p2) as p, tt where p.b=t - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-2.mdp index 943acc081a2..69a4862f108 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-JoinOverUnion-2.mdp @@ -616,7 +616,7 @@ select * from (select * from tt union all select * from p2) as p, tt where p.b=t - + @@ -664,7 +664,7 @@ select * from (select * from tt union all select * from p2) as p, tt where p.b=t - + @@ -712,7 +712,7 @@ select * from (select * from tt union all select * from p2) as p, tt where p.b=t - + @@ -760,7 +760,7 @@ select * from (select * from tt union all select * from p2) as p, tt where p.b=t - + @@ -808,7 +808,7 @@ select * from (select * from tt union all select * from p2) as p, tt where p.b=t - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-LASJ.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-LASJ.mdp index 3e84697543d..ac2a9220aaf 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-LASJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-LASJ.mdp @@ -545,7 +545,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -639,7 +639,7 @@ - + @@ -686,7 +686,7 @@ - + @@ -733,7 +733,7 @@ - + @@ -780,7 +780,7 @@ - + @@ -930,7 +930,7 @@ - + @@ -948,7 +948,7 @@ - + @@ -959,7 +959,7 @@ - + @@ -975,7 +975,7 @@ - + @@ -986,9 +986,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterHashJoin-DPE-IsNull.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterHashJoin-DPE-IsNull.mdp index 2a633a2d790..9a7588ad409 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterHashJoin-DPE-IsNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterHashJoin-DPE-IsNull.mdp @@ -118,7 +118,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -152,7 +152,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -189,7 +189,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -237,7 +237,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterNLJoin-DPE-IsNull.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterNLJoin-DPE-IsNull.mdp index 2cbd43f00fb..b2afe6725d9 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterNLJoin-DPE-IsNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-LeftOuterNLJoin-DPE-IsNull.mdp @@ -25,7 +25,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -62,7 +62,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -110,7 +110,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + @@ -280,7 +280,7 @@ select * from t2 left outer join t1 on t1.b = t2.d where t1.b is null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Int-Predicates.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Int-Predicates.mdp index 86aac33b17f..9f9f59c690d 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Int-Predicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Int-Predicates.mdp @@ -133,7 +133,7 @@ select * from foo where b is not null; - + @@ -171,7 +171,7 @@ select * from foo where b is not null; - + @@ -218,7 +218,7 @@ select * from foo where b is not null; - + @@ -265,7 +265,7 @@ select * from foo where b is not null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Varchar-Predicates.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Varchar-Predicates.mdp index 6f3e34d481a..0bd5faa264d 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Varchar-Predicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-List-DPE-Varchar-Predicates.mdp @@ -180,7 +180,7 @@ select * from pt where gender is null; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoin.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoin.mdp index 090059b0b14..b271286d690 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoin.mdp @@ -215,7 +215,7 @@ explain select count(*) from r_p, s c, s d, s e where r_p.a = c.c and r_p.a = d. - + @@ -258,7 +258,7 @@ explain select count(*) from r_p, s c, s d, s e where r_p.a = c.c and r_p.a = d. - + @@ -308,7 +308,7 @@ explain select count(*) from r_p, s c, s d, s e where r_p.a = c.c and r_p.a = d. - + @@ -377,7 +377,7 @@ explain select count(*) from r_p, s c, s d, s e where r_p.a = c.c and r_p.a = d. - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE-2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE-2.mdp index 8579f58cc7b..0548ae46691 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE-2.mdp @@ -779,7 +779,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -1001,7 +1001,7 @@ - + @@ -1112,7 +1112,7 @@ - + @@ -1223,7 +1223,7 @@ - + @@ -1453,7 +1453,7 @@ - + @@ -1579,7 +1579,7 @@ - + @@ -1705,7 +1705,7 @@ - + @@ -1831,7 +1831,7 @@ - + @@ -1957,7 +1957,7 @@ - + @@ -2557,7 +2557,7 @@ - + @@ -2718,7 +2718,7 @@ - + @@ -2883,9 +2883,9 @@ - + - + @@ -3003,7 +3003,7 @@ - + @@ -3099,7 +3099,7 @@ - + @@ -3191,7 +3191,7 @@ - + @@ -3289,7 +3289,7 @@ - + @@ -3379,9 +3379,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE.mdp index debe678863d..a0f1e6d5a32 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-MultiWayJoinWithDPE.mdp @@ -126,7 +126,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -1501,7 +1501,7 @@ - + @@ -1629,7 +1629,7 @@ - + @@ -2405,7 +2405,7 @@ - + @@ -2459,7 +2459,7 @@ - + @@ -2513,7 +2513,7 @@ - + @@ -2567,7 +2567,7 @@ - + @@ -2621,7 +2621,7 @@ - + @@ -2812,7 +2812,7 @@ - + @@ -2956,7 +2956,7 @@ - + @@ -3100,7 +3100,7 @@ - + @@ -3244,7 +3244,7 @@ - + @@ -3388,7 +3388,7 @@ - + @@ -4746,7 +4746,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-MultipleEqPredicates.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-MultipleEqPredicates.mdp index ba68045909d..76b459f715f 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-MultipleEqPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-MultipleEqPredicates.mdp @@ -3772,7 +3772,7 @@ - + @@ -3865,7 +3865,7 @@ - + @@ -3958,7 +3958,7 @@ - + @@ -4051,7 +4051,7 @@ - + @@ -4144,7 +4144,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-NEqPredicate.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-NEqPredicate.mdp index 40881639046..16c167d6cd9 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-NEqPredicate.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-NEqPredicate.mdp @@ -134,7 +134,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -437,7 +437,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-NLJ.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-NLJ.mdp index abc3d6c194c..81b677e5c8e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-NLJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-NLJ.mdp @@ -311,7 +311,7 @@ - + @@ -359,7 +359,7 @@ - + @@ -407,7 +407,7 @@ - + @@ -455,7 +455,7 @@ - + @@ -503,7 +503,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-NonConstSelect.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-NonConstSelect.mdp index adbe5995fae..e2ed79778f0 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-NonConstSelect.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-NonConstSelect.mdp @@ -293,7 +293,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -473,7 +473,7 @@ - + @@ -563,7 +563,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCast.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCast.mdp index 44bb007a209..8c93089b08e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCast.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCast.mdp @@ -35,7 +35,7 @@ explain select * from R where b::int8=5::int8; - + @@ -73,7 +73,7 @@ explain select * from R where b::int8=5::int8; - + @@ -121,7 +121,7 @@ explain select * from R where b::int8=5::int8; - + @@ -169,7 +169,7 @@ explain select * from R where b::int8=5::int8; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastList.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastList.mdp index 35901453c21..dfb59619219 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastList.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastList.mdp @@ -25,7 +25,7 @@ explain select * from L where b::numeric < 3::numeric; - + @@ -63,7 +63,7 @@ explain select * from L where b::numeric < 3::numeric; - + @@ -107,7 +107,7 @@ explain select * from L where b::numeric < 3::numeric; - + @@ -151,7 +151,7 @@ explain select * from L where b::numeric < 3::numeric; - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastMultiLevelList.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastMultiLevelList.mdp index cf2acd99f1b..170ed529216 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastMultiLevelList.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-PredicateWithCastMultiLevelList.mdp @@ -25,7 +25,7 @@ EXPLAIN SELECT * FROM pt_complex WHERE k::numeric = 2::numeric AND j::numeric = - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-RightOuterHashJoin-DPE-IsNull.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-RightOuterHashJoin-DPE-IsNull.mdp index 77c755323a0..9fdf6b97173 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-RightOuterHashJoin-DPE-IsNull.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-RightOuterHashJoin-DPE-IsNull.mdp @@ -149,7 +149,7 @@ - + @@ -214,7 +214,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost1.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost1.mdp index d36e85603dd..ef0a0fb99ce 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost1.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost1.mdp @@ -49,7 +49,7 @@ - + @@ -1084,7 +1084,7 @@ - + @@ -1130,7 +1130,7 @@ - + @@ -1194,7 +1194,7 @@ - + @@ -1250,7 +1250,7 @@ - + @@ -1306,7 +1306,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost2.mdp index 6877904210c..00b93d4b844 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost2.mdp @@ -53,7 +53,7 @@ - + @@ -1088,7 +1088,7 @@ - + @@ -1134,7 +1134,7 @@ - + @@ -1198,7 +1198,7 @@ - + @@ -1254,7 +1254,7 @@ - + @@ -1310,7 +1310,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost3.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost3.mdp index 4444335c87c..bc908a1c91e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost3.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost3.mdp @@ -54,7 +54,7 @@ - + @@ -1089,7 +1089,7 @@ - + @@ -1135,7 +1135,7 @@ - + @@ -1199,7 +1199,7 @@ - + @@ -1255,7 +1255,7 @@ - + @@ -1311,7 +1311,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost4.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost4.mdp index 8fae2a669e5..a3732f1b45a 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost4.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost4.mdp @@ -59,7 +59,7 @@ - + @@ -1094,7 +1094,7 @@ - + @@ -1140,7 +1140,7 @@ - + @@ -1204,7 +1204,7 @@ - + @@ -1260,7 +1260,7 @@ - + @@ -1316,7 +1316,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost5.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost5.mdp index 9b49a884c51..d9b11d41e91 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost5.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-List-Cost5.mdp @@ -53,7 +53,7 @@ - + @@ -1088,7 +1088,7 @@ - + @@ -1134,7 +1134,7 @@ - + @@ -1198,7 +1198,7 @@ - + @@ -1254,7 +1254,7 @@ - + @@ -1310,7 +1310,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost1.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost1.mdp index 7088e769624..f7bf15a4758 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost1.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost1.mdp @@ -55,7 +55,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -257,7 +257,7 @@ - + @@ -324,7 +324,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -549,7 +549,7 @@ - + @@ -603,7 +603,7 @@ - + @@ -657,7 +657,7 @@ - + @@ -711,7 +711,7 @@ - + @@ -1573,7 +1573,7 @@ - + @@ -1627,7 +1627,7 @@ - + @@ -1681,7 +1681,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost2.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost2.mdp index 4f261ee576d..6928df8a65e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost2.mdp @@ -61,7 +61,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -276,7 +276,7 @@ - + @@ -343,7 +343,7 @@ - + @@ -414,7 +414,7 @@ - + @@ -568,7 +568,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -676,7 +676,7 @@ - + @@ -730,7 +730,7 @@ - + @@ -1592,7 +1592,7 @@ - + @@ -1646,7 +1646,7 @@ - + @@ -1700,7 +1700,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost3.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost3.mdp index 3e87582d390..d275722956e 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost3.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost3.mdp @@ -69,7 +69,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -426,7 +426,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -651,7 +651,7 @@ - + @@ -705,7 +705,7 @@ - + @@ -759,7 +759,7 @@ - + @@ -1617,7 +1617,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1725,7 +1725,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost4.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost4.mdp index 4596e51629b..1c20831dd20 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost4.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost4.mdp @@ -165,7 +165,7 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost5.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost5.mdp index 0fcd6cf6a8c..604cd0c64b9 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost5.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SPE-DynamicTableScan-Range-Cost5.mdp @@ -71,7 +71,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -273,7 +273,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -394,7 +394,7 @@ - + @@ -565,7 +565,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -673,7 +673,7 @@ - + @@ -734,7 +734,7 @@ - + @@ -1592,7 +1592,7 @@ - + @@ -1646,7 +1646,7 @@ - + @@ -1700,7 +1700,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SQAll.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SQAll.mdp index 725d935ca65..4600d873220 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SQAll.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SQAll.mdp @@ -260,7 +260,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -356,7 +356,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -491,7 +491,7 @@ - + @@ -539,7 +539,7 @@ - + @@ -587,7 +587,7 @@ - + @@ -635,7 +635,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SQAny.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SQAny.mdp index 1f00d09dcfd..75ebeb1e031 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SQAny.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SQAny.mdp @@ -259,7 +259,7 @@ - + @@ -307,7 +307,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -538,7 +538,7 @@ - + @@ -586,7 +586,7 @@ - + @@ -634,7 +634,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SQExists.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SQExists.mdp index 646ace2ba00..4ec13c6924c 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SQExists.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SQExists.mdp @@ -228,7 +228,7 @@ - + @@ -276,7 +276,7 @@ - + @@ -324,7 +324,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -507,7 +507,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -603,7 +603,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SQNotExists.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SQNotExists.mdp index bc6543e6a02..a25d2d51d2c 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SQNotExists.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SQNotExists.mdp @@ -220,7 +220,7 @@ - + @@ -268,7 +268,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -451,7 +451,7 @@ - + @@ -499,7 +499,7 @@ - + @@ -547,7 +547,7 @@ - + @@ -595,7 +595,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SQScalar.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SQScalar.mdp index b9aa8cf9301..5f49eab912f 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SQScalar.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SQScalar.mdp @@ -220,7 +220,7 @@ - + @@ -268,7 +268,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -451,7 +451,7 @@ - + @@ -499,7 +499,7 @@ - + @@ -547,7 +547,7 @@ - + @@ -595,7 +595,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-SubqueryOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-SubqueryOuterRef.mdp index 17c87e18722..327e556eab3 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-SubqueryOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-SubqueryOuterRef.mdp @@ -319,7 +319,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -355,7 +355,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -391,7 +391,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -427,7 +427,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -463,7 +463,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -499,7 +499,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -535,7 +535,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -571,7 +571,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -607,7 +607,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -643,7 +643,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + @@ -818,7 +818,7 @@ explain select * from t1 where a = 1 and b in (select b from t2); - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-VolatileFunc.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-VolatileFunc.mdp index bc7fd7f8e6c..e2eb0512ca7 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-VolatileFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-VolatileFunc.mdp @@ -199,7 +199,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -295,7 +295,7 @@ - + @@ -343,7 +343,7 @@ - + @@ -391,7 +391,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoDisjunctPredPushDown.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoDisjunctPredPushDown.mdp index 55903376ad7..e3937b360fa 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoDisjunctPredPushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoDisjunctPredPushDown.mdp @@ -36,7 +36,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoPredPushDown.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoPredPushDown.mdp index 15acbd21a6c..f0f257c5b82 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoPredPushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncNoPredPushDown.mdp @@ -159,7 +159,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPartialPredPushDown.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPartialPredPushDown.mdp index a5bb817eb31..7b554ceea9a 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPartialPredPushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPartialPredPushDown.mdp @@ -159,7 +159,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPredPushDown.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPredPushDown.mdp index e7fd9080281..4f40c1463a8 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPredPushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncPredPushDown.mdp @@ -172,7 +172,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncSinglePredPushDown.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncSinglePredPushDown.mdp index ce353845366..d23608fbb0c 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncSinglePredPushDown.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFuncSinglePredPushDown.mdp @@ -36,7 +36,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFunction.mdp b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFunction.mdp index be3cf8ed7e9..03bb0356611 100644 --- a/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/PartTbl-WindowFunction.mdp @@ -572,7 +572,7 @@ - + @@ -620,7 +620,7 @@ - + @@ -668,7 +668,7 @@ - + @@ -716,7 +716,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsAndDisjuncts.mdp b/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsAndDisjuncts.mdp index 4b1edd529b2..968e2d3e6f6 100644 --- a/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsAndDisjuncts.mdp +++ b/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsAndDisjuncts.mdp @@ -2167,7 +2167,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsOfDisjuncts.mdp b/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsOfDisjuncts.mdp index 5a447b1895c..bc96eac2726 100644 --- a/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsOfDisjuncts.mdp +++ b/src/backend/gporca/data/dxl/minidump/PredicateWithConjunctsOfDisjuncts.mdp @@ -36,7 +36,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PredicateWithLongConjunction.mdp b/src/backend/gporca/data/dxl/minidump/PredicateWithLongConjunction.mdp index 432c7942089..48283d4ad70 100644 --- a/src/backend/gporca/data/dxl/minidump/PredicateWithLongConjunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/PredicateWithLongConjunction.mdp @@ -2564,7 +2564,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Project-With-NonScalar-Func.mdp b/src/backend/gporca/data/dxl/minidump/Project-With-NonScalar-Func.mdp index 284b0da028b..2d3ec2f44a3 100644 --- a/src/backend/gporca/data/dxl/minidump/Project-With-NonScalar-Func.mdp +++ b/src/backend/gporca/data/dxl/minidump/Project-With-NonScalar-Func.mdp @@ -195,7 +195,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -262,44 +262,41 @@ - + - + - - - - - - - - - - - - - - - + - - + - + - - - - - + + + + + + + + + + + + + + + + + @@ -423,8 +420,8 @@ - - + + diff --git a/src/backend/gporca/data/dxl/minidump/ProjectSetFunction.mdp b/src/backend/gporca/data/dxl/minidump/ProjectSetFunction.mdp index f5ac33f1075..7bf0b5b0004 100644 --- a/src/backend/gporca/data/dxl/minidump/ProjectSetFunction.mdp +++ b/src/backend/gporca/data/dxl/minidump/ProjectSetFunction.mdp @@ -151,7 +151,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-1.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-1.mdp new file mode 100644 index 00000000000..7400462db68 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-1.mdp @@ -0,0 +1,489 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t2.c >= t1.a) AND (t2.c <= t1.b)) + -> Seq Scan on t1 + Filter: ((a <= 2) AND (b >= 2)) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t2 + Filter: (c = 2) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-10.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-10.mdp new file mode 100644 index 00000000000..87e99768aac --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-10.mdp @@ -0,0 +1,671 @@ + + + Nested Loop + Join Filter: ((t1.a >= t2.a) AND (t1.a <= t2.b) AND (t3.a >= t1.a) AND (t3.a <= t1.b)) + -> Nested Loop + Join Filter: true + -> Broadcast Motion 3:3 (slice3; segments: 3) + -> Seq Scan on t2 + Filter: ((a <= 42) AND (b >= 42)) + -> Materialize + -> Seq Scan on t3 + Filter: (a = b) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t1 + Filter: (a = 42) + Optimizer: Pivotal Optimizer (GPORCA) + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-2.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-2.mdp new file mode 100644 index 00000000000..2e7e3a61974 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-2.mdp @@ -0,0 +1,620 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Left Join + Hash Cond: (t2.c = t3.e) + -> Redistribute Motion 3:3 (slice2; segments: 3) + Hash Key: t2.c + -> Nested Loop + Join Filter: ((t2.c >= t1.a) AND (t2.c <= t1.b)) + -> Seq Scan on t1 + Filter: ((a <= 2) AND (b >= 2)) + -> Materialize + -> Broadcast Motion 3:3 (slice3; segments: 3) + -> Seq Scan on t2 + Filter: (c = 2) + -> Hash + -> Seq Scan on t3 + Filter: (e = 2) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-3.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-3.mdp new file mode 100644 index 00000000000..79e52fe2b2c --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-3.mdp @@ -0,0 +1,503 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t2.c >= t1.a) AND (t2.c <= t1.b)) + -> Seq Scan on t1 + Filter: ((a <= 2) AND (b >= 2)) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t2 + Filter: ((c = 2) AND (d = 5)) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-4.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-4.mdp new file mode 100644 index 00000000000..727007163b3 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-4.mdp @@ -0,0 +1,479 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t2.c >= t1.a) AND (t2.c <= t1.b)) + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t2 + Filter: ((c = 2) OR (d = 5)) + -> Seq Scan on t1 + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-5.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-5.mdp new file mode 100644 index 00000000000..c8813d29b3d --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-5.mdp @@ -0,0 +1,488 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t2.c >= t1.a) AND (t2.c <= t1.b)) + -> Seq Scan on t1 + Filter: ((a <= 2) AND (b >= 2)) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t2 + Filter: (c = 2) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-6.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-6.mdp new file mode 100644 index 00000000000..d279eef62e0 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-6.mdp @@ -0,0 +1,656 @@ + + + Nested Loop + Join Filter: ((t1.a >= t2.a) AND (t1.a <= t2.b) AND (t3.a >= t2.a) AND (t3.a <= t2.b)) + -> Nested Loop + Join Filter: true + -> Seq Scan on t3 + Filter: (a = 24) + -> Materialize + -> Broadcast Motion 3:3 (slice3; segments: 3) + -> Seq Scan on t1 + Filter: (a = 42) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t2 + Filter: ((a <= 42) AND (b >= 42) AND (a <= 24) AND (b >= 24)) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-7.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-7.mdp new file mode 100644 index 00000000000..37c05c0f942 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-7.mdp @@ -0,0 +1,487 @@ + + + Nested Loop + Join Filter: ((int4(t1.a) >= t2.a) AND (int4(t1.a) <= t2.b)) + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t1 + Filter: (int4(a) = 42) + -> Materialize + -> Seq Scan on t2 + Filter: ((a <= 42) AND (b >= 42)) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-8.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-8.mdp new file mode 100644 index 00000000000..21e2694b308 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-8.mdp @@ -0,0 +1,532 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t1.a >= t2.x) AND (t1.a <= t2.y)) + -> Seq Scan on t2 + Filter: ((x <= 5) AND (y >= 5) AND ((x = 0) OR (x = 10))) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on t1 + Filter: ((a = 5) AND (b = 7)) + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-9.mdp b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-9.mdp new file mode 100644 index 00000000000..d5c738aabb7 --- /dev/null +++ b/src/backend/gporca/data/dxl/minidump/PushConstantSelectPredicateThruJoin-9.mdp @@ -0,0 +1,996 @@ + + + Gather Motion 3:1 (slice1; segments: 3) + -> Nested Loop + Join Filter: ((t1.a >= t2.d) AND (t1.a <= t2.e) AND (t1.a >= t3.g) AND (t1.a <= t3.h)) + -> Nested Loop + Join Filter: true + -> Broadcast Motion 3:3 (slice5; segments: 3) + -> Seq Scan on t2 + Filter: ((d <= 5) AND (e >= 5)) + -> Materialize + -> Seq Scan on t3 + Filter: ((g <= 5) AND (h >= 5)) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Nested Loop Left Join + Join Filter: ((t1.a >= t5.m) AND (t1.a <= t5.n)) + -> Nested Loop Left Join + Join Filter: ((t1.a >= t4.j) AND (t1.a <= t4.k)) + -> Seq Scan on t1 + Filter: (a = 5) + -> Materialize + -> Broadcast Motion 3:3 (slice4; segments: 3) + -> Seq Scan on t4 + -> Materialize + -> Broadcast Motion 3:3 (slice3; segments: 3) + -> Seq Scan on t5 + Optimizer: Pivotal Optimizer (GPORCA) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/gporca/data/dxl/minidump/PushFilterToSemiJoinLeftChild.mdp b/src/backend/gporca/data/dxl/minidump/PushFilterToSemiJoinLeftChild.mdp index ebb237476be..227949b54d1 100644 --- a/src/backend/gporca/data/dxl/minidump/PushFilterToSemiJoinLeftChild.mdp +++ b/src/backend/gporca/data/dxl/minidump/PushFilterToSemiJoinLeftChild.mdp @@ -168,7 +168,7 @@ - + @@ -199,7 +199,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PushGbBelowJoin-NegativeCase.mdp b/src/backend/gporca/data/dxl/minidump/PushGbBelowJoin-NegativeCase.mdp index af82c0aea21..64bd0f3826f 100644 --- a/src/backend/gporca/data/dxl/minidump/PushGbBelowJoin-NegativeCase.mdp +++ b/src/backend/gporca/data/dxl/minidump/PushGbBelowJoin-NegativeCase.mdp @@ -405,10 +405,10 @@ - + - + @@ -419,7 +419,7 @@ - + @@ -436,7 +436,7 @@ - + @@ -455,7 +455,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -546,7 +546,7 @@ - + @@ -623,7 +623,7 @@ - + @@ -701,7 +701,7 @@ - + @@ -780,30 +780,41 @@ - + - + - + - - + - - + + + + + + + + + + + + + + - + diff --git a/src/backend/gporca/data/dxl/minidump/PushGbBelowNaryUnion-2.mdp b/src/backend/gporca/data/dxl/minidump/PushGbBelowNaryUnion-2.mdp index 526e019de6c..5d45a14fba5 100644 --- a/src/backend/gporca/data/dxl/minidump/PushGbBelowNaryUnion-2.mdp +++ b/src/backend/gporca/data/dxl/minidump/PushGbBelowNaryUnion-2.mdp @@ -935,7 +935,7 @@ - + @@ -972,7 +972,7 @@ - + @@ -1411,7 +1411,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/PushSelectWithOuterRefBelowUnion.mdp b/src/backend/gporca/data/dxl/minidump/PushSelectWithOuterRefBelowUnion.mdp index 6d04a3a037c..e34db65d873 100644 --- a/src/backend/gporca/data/dxl/minidump/PushSelectWithOuterRefBelowUnion.mdp +++ b/src/backend/gporca/data/dxl/minidump/PushSelectWithOuterRefBelowUnion.mdp @@ -4014,7 +4014,7 @@ - + @@ -4107,7 +4107,7 @@ - + @@ -4200,7 +4200,7 @@ - + @@ -4293,7 +4293,7 @@ - + @@ -4386,7 +4386,7 @@ - + @@ -5451,7 +5451,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution-DynamicIndexScan.mdp b/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution-DynamicIndexScan.mdp index 4e153baac58..e31ebe49a1f 100644 --- a/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution-DynamicIndexScan.mdp +++ b/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution-DynamicIndexScan.mdp @@ -190,7 +190,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -243,7 +243,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -296,7 +296,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -349,7 +349,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -402,7 +402,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -500,7 +500,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -553,7 +553,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -606,7 +606,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -659,7 +659,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + @@ -712,7 +712,7 @@ explain select i, count(j) from pt2 where k=5 group by i; - + diff --git a/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution.mdp b/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution.mdp index 5bb3178d7e1..af377e32b7b 100644 --- a/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution.mdp +++ b/src/backend/gporca/data/dxl/minidump/QueryMismatchedDistribution.mdp @@ -187,7 +187,7 @@ explain select i, count(j) from pt2 group by i; - + @@ -238,7 +238,7 @@ explain select i, count(j) from pt2 group by i; - + @@ -289,7 +289,7 @@ explain select i, count(j) from pt2 group by i; - + @@ -340,7 +340,7 @@ explain select i, count(j) from pt2 group by i; - + @@ -391,7 +391,7 @@ explain select i, count(j) from pt2 group by i; - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqInPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqInPartitionRange.mdp index 862942feaa9..90756a7981a 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqInPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqInPartitionRange.mdp @@ -33,7 +33,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -285,7 +285,7 @@ - + @@ -336,7 +336,7 @@ - + @@ -387,7 +387,7 @@ - + @@ -438,7 +438,7 @@ - + @@ -489,7 +489,7 @@ - + @@ -540,7 +540,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqOnEndPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqOnEndPartitionRange.mdp index e7dabad7ece..ce067f7650e 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqOnEndPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastEqOnEndPartitionRange.mdp @@ -155,7 +155,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -356,7 +356,7 @@ - + @@ -407,7 +407,7 @@ - + @@ -458,7 +458,7 @@ - + @@ -509,7 +509,7 @@ - + @@ -560,7 +560,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -662,7 +662,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqInPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqInPartitionRange.mdp index ecc948b124e..7040a08cfe1 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqInPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqInPartitionRange.mdp @@ -144,7 +144,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -396,7 +396,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -498,7 +498,7 @@ - + @@ -549,7 +549,7 @@ - + @@ -600,7 +600,7 @@ - + @@ -651,7 +651,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqOnEndPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqOnEndPartitionRange.mdp index ff209317408..4cdd002eec2 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqOnEndPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTEqOnEndPartitionRange.mdp @@ -143,7 +143,7 @@ - + @@ -191,7 +191,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -293,7 +293,7 @@ - + @@ -344,7 +344,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -446,7 +446,7 @@ - + @@ -497,7 +497,7 @@ - + @@ -548,7 +548,7 @@ - + @@ -599,7 +599,7 @@ - + @@ -650,7 +650,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTInPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTInPartitionRange.mdp index 00348f6967f..825a4a9f3a1 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTInPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTInPartitionRange.mdp @@ -131,7 +131,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -332,7 +332,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -587,7 +587,7 @@ - + @@ -638,7 +638,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTOnEndPartitionRange.mdp b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTOnEndPartitionRange.mdp index 016fd1dc5d3..e232ed2e2a2 100644 --- a/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTOnEndPartitionRange.mdp +++ b/src/backend/gporca/data/dxl/minidump/RangePartLossyCastLTOnEndPartitionRange.mdp @@ -131,7 +131,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -332,7 +332,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -587,7 +587,7 @@ - + @@ -638,7 +638,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Remove-Distinct-From-Subquery.mdp b/src/backend/gporca/data/dxl/minidump/Remove-Distinct-From-Subquery.mdp index f338f0d2208..0b057bddd82 100644 --- a/src/backend/gporca/data/dxl/minidump/Remove-Distinct-From-Subquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/Remove-Distinct-From-Subquery.mdp @@ -167,7 +167,7 @@ select * from bar where c not in (select distinct a from foo); - + @@ -243,7 +243,7 @@ select * from bar where c not in (select distinct a from foo); - + diff --git a/src/backend/gporca/data/dxl/minidump/RemoveImpliedPredOnBCCPredicates.mdp b/src/backend/gporca/data/dxl/minidump/RemoveImpliedPredOnBCCPredicates.mdp index 2316dd84ea1..c167dc6c91d 100644 --- a/src/backend/gporca/data/dxl/minidump/RemoveImpliedPredOnBCCPredicates.mdp +++ b/src/backend/gporca/data/dxl/minidump/RemoveImpliedPredOnBCCPredicates.mdp @@ -45,7 +45,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedHashJoinReplicated.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedHashJoinReplicated.mdp index 9130811270f..59d1a1cf07d 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedHashJoinReplicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedHashJoinReplicated.mdp @@ -84,7 +84,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinHashDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinHashDistributedTable.mdp index 57eeed7e0fe..a8ca3c4c935 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinHashDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinHashDistributedTable.mdp @@ -114,7 +114,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinPartitionedTable.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinPartitionedTable.mdp index b05ef6116dd..3c9170d5146 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinPartitionedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinPartitionedTable.mdp @@ -115,7 +115,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -347,7 +347,7 @@ - + @@ -396,7 +396,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinRandomDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinRandomDistributedTable.mdp index d064d026650..e826cbc91c9 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedJoinRandomDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedJoinRandomDistributedTable.mdp @@ -114,7 +114,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJHashDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJHashDistributedTable.mdp index b36fbd0ba96..4b2063b4c55 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJHashDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJHashDistributedTable.mdp @@ -114,7 +114,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJRandomDistributedTable.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJRandomDistributedTable.mdp index eee3c5fe438..bc6e8c182d6 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJRandomDistributedTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJRandomDistributedTable.mdp @@ -114,7 +114,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJReplicated.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJReplicated.mdp index 7b50dbe963f..9bfe93024cb 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedLOJReplicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedLOJReplicated.mdp @@ -84,7 +84,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedNLJReplicated.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedNLJReplicated.mdp index d8d9bc3e215..a134470d37b 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedNLJReplicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedNLJReplicated.mdp @@ -96,7 +96,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableAggregate.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableAggregate.mdp index e86073e3677..38bcd5b76fc 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableAggregate.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableAggregate.mdp @@ -127,7 +127,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableCTE.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableCTE.mdp index e20254c4bfb..af22cf52d5d 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableCTE.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableCTE.mdp @@ -114,7 +114,7 @@ - + @@ -148,7 +148,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableGroupBy.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableGroupBy.mdp index 3340775558d..85db8ace768 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableGroupBy.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableGroupBy.mdp @@ -127,7 +127,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableInClause.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableInClause.mdp index b36d4e6d771..573e9cebc29 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableInClause.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableInClause.mdp @@ -154,7 +154,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableInsert.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableInsert.mdp index 0c5c77510da..da28c0b21de 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableInsert.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableInsert.mdp @@ -110,7 +110,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableSelect.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableSelect.mdp index 5123c952235..5a8c4235051 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableSelect.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableSelect.mdp @@ -37,7 +37,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableSequenceInsert.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableSequenceInsert.mdp index 57462c6fbad..4e969019480 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableSequenceInsert.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableSequenceInsert.mdp @@ -36,7 +36,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ReplicatedTableWithAggNoMotion.mdp b/src/backend/gporca/data/dxl/minidump/ReplicatedTableWithAggNoMotion.mdp index fd990ec7e75..6f5eac6f188 100644 --- a/src/backend/gporca/data/dxl/minidump/ReplicatedTableWithAggNoMotion.mdp +++ b/src/backend/gporca/data/dxl/minidump/ReplicatedTableWithAggNoMotion.mdp @@ -36,7 +36,7 @@ - + @@ -66,7 +66,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinBothReplicated.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinBothReplicated.mdp index 7c4951676ac..c8b501bf668 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinBothReplicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinBothReplicated.mdp @@ -597,7 +597,7 @@ - + @@ -631,7 +631,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinDPS.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinDPS.mdp index 434bd383967..65532610694 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinDPS.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinDPS.mdp @@ -140,7 +140,7 @@ - + @@ -232,7 +232,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinHashed.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinHashed.mdp index 51fa7b2d20e..b3e190d1372 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinHashed.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinHashed.mdp @@ -138,7 +138,7 @@ - + @@ -175,7 +175,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinNoDPSNonDistKey.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinNoDPSNonDistKey.mdp index be60373eb37..c4f7ec0bf38 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinNoDPSNonDistKey.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinNoDPSNonDistKey.mdp @@ -180,7 +180,7 @@ - + @@ -674,7 +674,7 @@ - + @@ -722,7 +722,7 @@ - + @@ -773,7 +773,7 @@ - + @@ -824,7 +824,7 @@ - + @@ -875,7 +875,7 @@ - + @@ -926,7 +926,7 @@ - + @@ -977,7 +977,7 @@ - + @@ -1028,7 +1028,7 @@ - + @@ -1079,7 +1079,7 @@ - + @@ -1130,7 +1130,7 @@ - + @@ -1181,7 +1181,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinRedistribute.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinRedistribute.mdp index 7e627860cc2..2d8a60fbd62 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinRedistribute.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinRedistribute.mdp @@ -546,7 +546,7 @@ - + @@ -583,7 +583,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinReplicated.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinReplicated.mdp index 4b30146f320..50253cf8a67 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinReplicated.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinReplicated.mdp @@ -540,7 +540,7 @@ - + @@ -577,7 +577,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/RightJoinTVF.mdp b/src/backend/gporca/data/dxl/minidump/RightJoinTVF.mdp index 291495bd7d8..a582af39301 100644 --- a/src/backend/gporca/data/dxl/minidump/RightJoinTVF.mdp +++ b/src/backend/gporca/data/dxl/minidump/RightJoinTVF.mdp @@ -47,7 +47,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ScSubqueryWithOuterRef.mdp b/src/backend/gporca/data/dxl/minidump/ScSubqueryWithOuterRef.mdp index 037dc9a8a7e..c14c1e94266 100644 --- a/src/backend/gporca/data/dxl/minidump/ScSubqueryWithOuterRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScSubqueryWithOuterRef.mdp @@ -125,7 +125,7 @@ select (select b from bar) from foo; - + @@ -162,7 +162,7 @@ select (select b from bar) from foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/ScalarCorrelatedSubqueryCountStar.mdp b/src/backend/gporca/data/dxl/minidump/ScalarCorrelatedSubqueryCountStar.mdp index a88425e38f4..cb822ac4d37 100644 --- a/src/backend/gporca/data/dxl/minidump/ScalarCorrelatedSubqueryCountStar.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScalarCorrelatedSubqueryCountStar.mdp @@ -22,7 +22,7 @@ EXPLAIN SELECT (SELECT count(*) FROM bar where c = a) FROM foo; - + @@ -163,7 +163,7 @@ EXPLAIN SELECT (SELECT count(*) FROM bar where c = a) FROM foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/ScalarDQAWithNonScalarAgg.mdp b/src/backend/gporca/data/dxl/minidump/ScalarDQAWithNonScalarAgg.mdp index a9d0c77f505..4b059d7ad15 100644 --- a/src/backend/gporca/data/dxl/minidump/ScalarDQAWithNonScalarAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScalarDQAWithNonScalarAgg.mdp @@ -1355,7 +1355,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ScalarFuncPushedBelowGather.mdp b/src/backend/gporca/data/dxl/minidump/ScalarFuncPushedBelowGather.mdp index af063d4a14e..27e1f144c78 100644 --- a/src/backend/gporca/data/dxl/minidump/ScalarFuncPushedBelowGather.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScalarFuncPushedBelowGather.mdp @@ -41,7 +41,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStar.mdp b/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStar.mdp index f7eec2b946f..6b9b3187e5a 100644 --- a/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStar.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStar.mdp @@ -131,7 +131,7 @@ EXPLAIN SELECT (SELECT COUNT(*) FROM bar GROUP BY c LIMIT 1) FROM foo; - + @@ -170,7 +170,7 @@ EXPLAIN SELECT (SELECT COUNT(*) FROM bar GROUP BY c LIMIT 1) FROM foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStarInJoin.mdp b/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStarInJoin.mdp index fb765bf2be8..17401056460 100644 --- a/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStarInJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/ScalarSubqueryCountStarInJoin.mdp @@ -34,7 +34,7 @@ SELECT (SELECT jazz.count FROM (SELECT count(*) FROM bar GROUP BY c LIMIT 1) AS - + @@ -175,7 +175,7 @@ SELECT (SELECT jazz.count FROM (SELECT count(*) FROM bar GROUP BY c LIMIT 1) AS - + @@ -216,7 +216,7 @@ SELECT (SELECT jazz.count FROM (SELECT count(*) FROM bar GROUP BY c LIMIT 1) AS - + diff --git a/src/backend/gporca/data/dxl/minidump/Select-Over-PartTbl.mdp b/src/backend/gporca/data/dxl/minidump/Select-Over-PartTbl.mdp index c97d5023bad..ad77fa9caba 100644 --- a/src/backend/gporca/data/dxl/minidump/Select-Over-PartTbl.mdp +++ b/src/backend/gporca/data/dxl/minidump/Select-Over-PartTbl.mdp @@ -374,7 +374,7 @@ - + @@ -464,7 +464,7 @@ - + @@ -554,7 +554,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -2977,7 +2977,7 @@ - + @@ -3031,9 +3031,9 @@ - + - + diff --git a/src/backend/gporca/data/dxl/minidump/Select-Proj-OuterJoin.mdp b/src/backend/gporca/data/dxl/minidump/Select-Proj-OuterJoin.mdp index ae3eac819c0..d051da8eb25 100644 --- a/src/backend/gporca/data/dxl/minidump/Select-Proj-OuterJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/Select-Proj-OuterJoin.mdp @@ -887,7 +887,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SelfJoinDampedPredJoinCardinality.mdp b/src/backend/gporca/data/dxl/minidump/SelfJoinDampedPredJoinCardinality.mdp index 30499a19a91..05ff13c5a52 100644 --- a/src/backend/gporca/data/dxl/minidump/SelfJoinDampedPredJoinCardinality.mdp +++ b/src/backend/gporca/data/dxl/minidump/SelfJoinDampedPredJoinCardinality.mdp @@ -137,7 +137,7 @@ where foo.a=bar.a and bar.b=jazz.b and foo.c=jazz.c; - + diff --git a/src/backend/gporca/data/dxl/minidump/SemiJoinWithWindowsFuncInSubquery.mdp b/src/backend/gporca/data/dxl/minidump/SemiJoinWithWindowsFuncInSubquery.mdp index 0d04abe5e44..fd2a0317856 100644 --- a/src/backend/gporca/data/dxl/minidump/SemiJoinWithWindowsFuncInSubquery.mdp +++ b/src/backend/gporca/data/dxl/minidump/SemiJoinWithWindowsFuncInSubquery.mdp @@ -206,7 +206,7 @@ - + @@ -237,7 +237,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Sequence-With-Universal-Outer.mdp b/src/backend/gporca/data/dxl/minidump/Sequence-With-Universal-Outer.mdp index 2ab4dc7ab4b..3b5c9a933e4 100644 --- a/src/backend/gporca/data/dxl/minidump/Sequence-With-Universal-Outer.mdp +++ b/src/backend/gporca/data/dxl/minidump/Sequence-With-Universal-Outer.mdp @@ -102,10 +102,10 @@ - + - + @@ -132,7 +132,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -166,30 +166,41 @@ - + - + - + - - + - - + + + + + + + + + + + + + + - + diff --git a/src/backend/gporca/data/dxl/minidump/SimplifyExistsSubquery2Limit.mdp b/src/backend/gporca/data/dxl/minidump/SimplifyExistsSubquery2Limit.mdp index db2002bc5bc..c588adee2e1 100644 --- a/src/backend/gporca/data/dxl/minidump/SimplifyExistsSubquery2Limit.mdp +++ b/src/backend/gporca/data/dxl/minidump/SimplifyExistsSubquery2Limit.mdp @@ -261,7 +261,7 @@ explain select * from foo where foo.a = 10 and exists (select * from bar); - + @@ -295,7 +295,7 @@ explain select * from foo where foo.a = 10 and exists (select * from bar); - + @@ -712,7 +712,7 @@ explain select * from foo where foo.a = 10 and exists (select * from bar); - + diff --git a/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-AO.mdp b/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-AO.mdp index f237d4b9997..ff477d7d78c 100644 --- a/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-AO.mdp +++ b/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-AO.mdp @@ -27,7 +27,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -250,7 +250,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-HEAP.mdp b/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-HEAP.mdp index 64ecddbf11a..e62fcf3fe27 100644 --- a/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-HEAP.mdp +++ b/src/backend/gporca/data/dxl/minidump/SingleColumnHomogenousIndexOnRoot-HEAP.mdp @@ -162,7 +162,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -257,7 +257,7 @@ - + @@ -327,7 +327,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SixWayDPv2.mdp b/src/backend/gporca/data/dxl/minidump/SixWayDPv2.mdp index 5b81d0ac18d..87aa32be3fe 100644 --- a/src/backend/gporca/data/dxl/minidump/SixWayDPv2.mdp +++ b/src/backend/gporca/data/dxl/minidump/SixWayDPv2.mdp @@ -36,7 +36,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -208,7 +208,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SpoolShouldInvalidateUnresolvedDynamicScans.mdp b/src/backend/gporca/data/dxl/minidump/SpoolShouldInvalidateUnresolvedDynamicScans.mdp index 7d3c4bf9148..f29e5c519c6 100644 --- a/src/backend/gporca/data/dxl/minidump/SpoolShouldInvalidateUnresolvedDynamicScans.mdp +++ b/src/backend/gporca/data/dxl/minidump/SpoolShouldInvalidateUnresolvedDynamicScans.mdp @@ -267,7 +267,7 @@ And instead have a plan like - + @@ -301,7 +301,7 @@ And instead have a plan like - + @@ -499,7 +499,7 @@ And instead have a plan like - + @@ -537,7 +537,7 @@ And instead have a plan like - + @@ -585,7 +585,7 @@ And instead have a plan like - + @@ -633,7 +633,7 @@ And instead have a plan like - + diff --git a/src/backend/gporca/data/dxl/minidump/SqlFuncDmlScalar.mdp b/src/backend/gporca/data/dxl/minidump/SqlFuncDmlScalar.mdp index 1315a7aea67..51dda8be5ca 100644 --- a/src/backend/gporca/data/dxl/minidump/SqlFuncDmlScalar.mdp +++ b/src/backend/gporca/data/dxl/minidump/SqlFuncDmlScalar.mdp @@ -170,7 +170,7 @@ LIMIT 999 - + @@ -204,7 +204,7 @@ LIMIT 999 - + diff --git a/src/backend/gporca/data/dxl/minidump/SqlFuncDmlTvf.mdp b/src/backend/gporca/data/dxl/minidump/SqlFuncDmlTvf.mdp index b4f3407f446..931b552a52e 100644 --- a/src/backend/gporca/data/dxl/minidump/SqlFuncDmlTvf.mdp +++ b/src/backend/gporca/data/dxl/minidump/SqlFuncDmlTvf.mdp @@ -176,7 +176,7 @@ LIMIT 999 - + @@ -213,7 +213,7 @@ LIMIT 999 - + diff --git a/src/backend/gporca/data/dxl/minidump/SqlFuncNullReject.mdp b/src/backend/gporca/data/dxl/minidump/SqlFuncNullReject.mdp index 1ae812b2f27..050f1d5365c 100644 --- a/src/backend/gporca/data/dxl/minidump/SqlFuncNullReject.mdp +++ b/src/backend/gporca/data/dxl/minidump/SqlFuncNullReject.mdp @@ -45,7 +45,7 @@ yolo(c) = 16 - + @@ -82,7 +82,7 @@ yolo(c) = 16 - + diff --git a/src/backend/gporca/data/dxl/minidump/SqlFuncPredFactorize.mdp b/src/backend/gporca/data/dxl/minidump/SqlFuncPredFactorize.mdp index 3523d8753ae..a0119156afd 100644 --- a/src/backend/gporca/data/dxl/minidump/SqlFuncPredFactorize.mdp +++ b/src/backend/gporca/data/dxl/minidump/SqlFuncPredFactorize.mdp @@ -122,7 +122,7 @@ WHERE a = c AND - + @@ -191,7 +191,7 @@ WHERE a = c AND - + diff --git a/src/backend/gporca/data/dxl/minidump/StatsFilter-AnyWithNewColStats.mdp b/src/backend/gporca/data/dxl/minidump/StatsFilter-AnyWithNewColStats.mdp index 22f67e93af4..09d6ef6ffec 100644 --- a/src/backend/gporca/data/dxl/minidump/StatsFilter-AnyWithNewColStats.mdp +++ b/src/backend/gporca/data/dxl/minidump/StatsFilter-AnyWithNewColStats.mdp @@ -205,7 +205,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq-With-OuterRefCol.mdp b/src/backend/gporca/data/dxl/minidump/Subq-With-OuterRefCol.mdp index 113d87c2603..6b71e077292 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq-With-OuterRefCol.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq-With-OuterRefCol.mdp @@ -48,7 +48,7 @@ pivotal=# explain select a, c from r, s where a in (select c from r) order by a, - + @@ -82,7 +82,7 @@ pivotal=# explain select a, c from r, s where a in (select c from r) order by a, - + @@ -530,7 +530,7 @@ pivotal=# explain select a, c from r, s where a in (select c from r) order by a, - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq2CorrSQInLOJOn.mdp b/src/backend/gporca/data/dxl/minidump/Subq2CorrSQInLOJOn.mdp index ceed4cbbe71..e71545842e2 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq2CorrSQInLOJOn.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq2CorrSQInLOJOn.mdp @@ -888,7 +888,7 @@ - + @@ -937,7 +937,7 @@ - + @@ -1071,7 +1071,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq2NotInWhereLOJ.mdp b/src/backend/gporca/data/dxl/minidump/Subq2NotInWhereLOJ.mdp index 931e0398867..9674e46df6d 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq2NotInWhereLOJ.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq2NotInWhereLOJ.mdp @@ -110,7 +110,7 @@ - + @@ -197,7 +197,7 @@ - + @@ -335,7 +335,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq2OuterRef2InJoin.mdp b/src/backend/gporca/data/dxl/minidump/Subq2OuterRef2InJoin.mdp index 5c3799b5612..1f097d867f3 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq2OuterRef2InJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq2OuterRef2InJoin.mdp @@ -68,7 +68,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -454,7 +454,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq2OuterRefMultiLevelInOn.mdp b/src/backend/gporca/data/dxl/minidump/Subq2OuterRefMultiLevelInOn.mdp index c2b0b168451..c8224628ce8 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq2OuterRefMultiLevelInOn.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq2OuterRefMultiLevelInOn.mdp @@ -219,7 +219,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -289,7 +289,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subq2PartialDecorrelate.mdp b/src/backend/gporca/data/dxl/minidump/Subq2PartialDecorrelate.mdp index 2594892c250..36acbc042db 100644 --- a/src/backend/gporca/data/dxl/minidump/Subq2PartialDecorrelate.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subq2PartialDecorrelate.mdp @@ -86,7 +86,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -269,7 +269,7 @@ - + @@ -431,7 +431,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqAll-InsideScalarExpression.mdp b/src/backend/gporca/data/dxl/minidump/SubqAll-InsideScalarExpression.mdp index c7d975cc37d..6586ae829b7 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqAll-InsideScalarExpression.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqAll-InsideScalarExpression.mdp @@ -27,7 +27,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -383,7 +383,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqAny-InsideScalarExpression.mdp b/src/backend/gporca/data/dxl/minidump/SubqAny-InsideScalarExpression.mdp index 3a87187d452..0c2ba1716e9 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqAny-InsideScalarExpression.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqAny-InsideScalarExpression.mdp @@ -29,7 +29,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -379,10 +379,10 @@ - + - + @@ -399,7 +399,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -437,7 +437,7 @@ - + @@ -486,7 +486,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -557,7 +557,7 @@ - + @@ -586,7 +586,7 @@ - + @@ -635,7 +635,7 @@ - + @@ -673,7 +673,7 @@ - + @@ -773,30 +773,33 @@ - + - + - + - - + - + + + + + @@ -833,8 +836,8 @@ - - + + diff --git a/src/backend/gporca/data/dxl/minidump/SubqEnforceSubplan.mdp b/src/backend/gporca/data/dxl/minidump/SubqEnforceSubplan.mdp index a0556e8f9ac..667d847da00 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqEnforceSubplan.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqEnforceSubplan.mdp @@ -22,7 +22,7 @@ explain select * from foo,bar where b = (select min(b) from bar where a = b); - + @@ -53,7 +53,7 @@ explain select * from foo,bar where b = (select min(b) from bar where a = b); - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqExists-With-External-Corrs.mdp b/src/backend/gporca/data/dxl/minidump/SubqExists-With-External-Corrs.mdp index b85dedb004d..bb07ee272c7 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqExists-With-External-Corrs.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqExists-With-External-Corrs.mdp @@ -453,7 +453,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqInIndexPred.mdp b/src/backend/gporca/data/dxl/minidump/SubqInIndexPred.mdp index 1c54aada290..3e3a709cd0b 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqInIndexPred.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqInIndexPred.mdp @@ -39,7 +39,7 @@ ON a = c - + @@ -73,7 +73,7 @@ ON a = c - + @@ -107,7 +107,7 @@ ON a = c - + @@ -394,7 +394,7 @@ ON a = c - + @@ -516,7 +516,7 @@ ON a = c - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqOuterReferenceInClause.mdp b/src/backend/gporca/data/dxl/minidump/SubqOuterReferenceInClause.mdp index d8458ef08b2..ee9a20d0d0a 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqOuterReferenceInClause.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqOuterReferenceInClause.mdp @@ -22,7 +22,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/Subquery-AnyAllAggregates.mdp b/src/backend/gporca/data/dxl/minidump/Subquery-AnyAllAggregates.mdp index d028545a687..56acf5037ec 100644 --- a/src/backend/gporca/data/dxl/minidump/Subquery-AnyAllAggregates.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subquery-AnyAllAggregates.mdp @@ -142,7 +142,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -522,10 +522,10 @@ - + - + @@ -553,7 +553,7 @@ - + @@ -567,7 +567,7 @@ - + @@ -727,7 +727,7 @@ - + @@ -772,7 +772,7 @@ - + @@ -803,7 +803,7 @@ - + @@ -837,7 +837,7 @@ - + @@ -863,7 +863,7 @@ - + @@ -908,7 +908,7 @@ - + @@ -939,7 +939,7 @@ - + @@ -974,7 +974,7 @@ - + @@ -1044,13 +1044,13 @@ - + - + - + @@ -1060,12 +1060,14 @@ - - + - + + + + @@ -1074,6 +1076,7 @@ + @@ -1116,8 +1119,8 @@ - - + + diff --git a/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregates.mdp b/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregates.mdp index a056b349069..a84dc1ef1d7 100644 --- a/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregates.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregates.mdp @@ -148,7 +148,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -595,10 +595,10 @@ - + - + @@ -626,7 +626,7 @@ - + @@ -640,7 +640,7 @@ - + @@ -800,7 +800,7 @@ - + @@ -845,7 +845,7 @@ - + @@ -876,7 +876,7 @@ - + @@ -910,7 +910,7 @@ - + @@ -936,7 +936,7 @@ - + @@ -981,7 +981,7 @@ - + @@ -1012,7 +1012,7 @@ - + @@ -1047,7 +1047,7 @@ - + @@ -1111,30 +1111,33 @@ - + - + - + - - + - + + + + + @@ -1170,8 +1173,8 @@ - - + + diff --git a/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregatesWithDisjuncts.mdp b/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregatesWithDisjuncts.mdp index daecdf240ef..7a823b32a51 100644 --- a/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregatesWithDisjuncts.mdp +++ b/src/backend/gporca/data/dxl/minidump/Subquery-ExistsAllAggregatesWithDisjuncts.mdp @@ -159,7 +159,7 @@ - + @@ -309,7 +309,7 @@ - + @@ -343,7 +343,7 @@ - + @@ -662,10 +662,10 @@ - + - + @@ -693,7 +693,7 @@ - + @@ -707,7 +707,7 @@ - + @@ -946,7 +946,7 @@ - + @@ -991,7 +991,7 @@ - + @@ -1022,7 +1022,7 @@ - + @@ -1056,7 +1056,7 @@ - + @@ -1082,7 +1082,7 @@ - + @@ -1127,7 +1127,7 @@ - + @@ -1158,7 +1158,7 @@ - + @@ -1193,7 +1193,7 @@ - + @@ -1257,30 +1257,33 @@ - + - + - + - - + - + + + + + @@ -1317,8 +1320,8 @@ - - + + diff --git a/src/backend/gporca/data/dxl/minidump/SubqueryInsideScalarIf.mdp b/src/backend/gporca/data/dxl/minidump/SubqueryInsideScalarIf.mdp index d0007f35e74..af53df03461 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqueryInsideScalarIf.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqueryInsideScalarIf.mdp @@ -49,7 +49,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -2459,7 +2459,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqueryNullTest.mdp b/src/backend/gporca/data/dxl/minidump/SubqueryNullTest.mdp index 233b0bdc819..4e1bcb03759 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqueryNullTest.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqueryNullTest.mdp @@ -26,7 +26,7 @@ - + @@ -63,7 +63,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefLimit.mdp b/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefLimit.mdp index 44c610a688d..a364fc17ebc 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefLimit.mdp @@ -146,7 +146,7 @@ - + @@ -180,7 +180,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefTVF.mdp b/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefTVF.mdp index 86aaf018220..ecbb2aa79e0 100644 --- a/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefTVF.mdp +++ b/src/backend/gporca/data/dxl/minidump/SubqueryOuterRefTVF.mdp @@ -136,7 +136,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TPCH-Partitioned-256GB.mdp b/src/backend/gporca/data/dxl/minidump/TPCH-Partitioned-256GB.mdp index 821b1add749..cbb1eefd432 100644 --- a/src/backend/gporca/data/dxl/minidump/TPCH-Partitioned-256GB.mdp +++ b/src/backend/gporca/data/dxl/minidump/TPCH-Partitioned-256GB.mdp @@ -2452,7 +2452,7 @@ - + @@ -2542,7 +2542,7 @@ - + @@ -2632,7 +2632,7 @@ - + @@ -2722,7 +2722,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TPCH-Q5.mdp b/src/backend/gporca/data/dxl/minidump/TPCH-Q5.mdp deleted file mode 100644 index 63f063017fd..00000000000 --- a/src/backend/gporca/data/dxl/minidump/TPCH-Q5.mdp +++ /dev/null @@ -1,6997 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/TVFCorrelatedExecution.mdp b/src/backend/gporca/data/dxl/minidump/TVFCorrelatedExecution.mdp index f9140ad0dca..fc32e58cf57 100644 --- a/src/backend/gporca/data/dxl/minidump/TVFCorrelatedExecution.mdp +++ b/src/backend/gporca/data/dxl/minidump/TVFCorrelatedExecution.mdp @@ -91,7 +91,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -173,55 +173,77 @@ - + - + - + - - + - - + + + + + + + + + + + + + + - + - + - + - + - - + - - + + + + + + + + + + + + + + - + @@ -231,7 +253,7 @@ - + @@ -242,7 +264,7 @@ - + @@ -256,7 +278,7 @@ - + @@ -272,7 +294,7 @@ - + @@ -295,55 +317,77 @@ - + - + - + - - + - - + + + + + + + + + + + + + + - + - + - + - + - - + - - + + + + + + + + + + + + + + - + diff --git a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedAgg.mdp b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedAgg.mdp index 9cd9fed7e02..22d1578ac9f 100644 --- a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedAgg.mdp @@ -100,7 +100,7 @@ - + @@ -163,7 +163,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedFilter.mdp b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedFilter.mdp index d9af14ab639..bd1bf77709d 100644 --- a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedFilter.mdp @@ -32,7 +32,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedLimit.mdp b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedLimit.mdp index e94658571a0..b52496809f1 100644 --- a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedLimit.mdp +++ b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedLimit.mdp @@ -50,7 +50,7 @@ - + @@ -115,7 +115,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedTablesCTE.mdp b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedTablesCTE.mdp index 1da96f258b8..976a719683e 100644 --- a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedTablesCTE.mdp +++ b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedTablesCTE.mdp @@ -216,7 +216,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedWindowAgg.mdp b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedWindowAgg.mdp index dc464a6e397..0e489e22ddc 100644 --- a/src/backend/gporca/data/dxl/minidump/TaintedReplicatedWindowAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/TaintedReplicatedWindowAgg.mdp @@ -101,7 +101,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityEquals.mdp b/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityEquals.mdp index ad395e85693..dc400f44abf 100644 --- a/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityEquals.mdp +++ b/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityEquals.mdp @@ -69,7 +69,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityGreaterThan.mdp b/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityGreaterThan.mdp index 2ddfe401899..87d3a724125 100644 --- a/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityGreaterThan.mdp +++ b/src/backend/gporca/data/dxl/minidump/TextMCVCardinalityGreaterThan.mdp @@ -69,7 +69,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TimeTypeStatsNotComparable.mdp b/src/backend/gporca/data/dxl/minidump/TimeTypeStatsNotComparable.mdp deleted file mode 100644 index f6dbec6c366..00000000000 --- a/src/backend/gporca/data/dxl/minidump/TimeTypeStatsNotComparable.mdp +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/Tpcds-10TB-Q37-NoIndexJoin.mdp b/src/backend/gporca/data/dxl/minidump/Tpcds-10TB-Q37-NoIndexJoin.mdp index 86561e1e588..d2c2370e639 100644 --- a/src/backend/gporca/data/dxl/minidump/Tpcds-10TB-Q37-NoIndexJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/Tpcds-10TB-Q37-NoIndexJoin.mdp @@ -156,7 +156,7 @@ select i_item_id - + @@ -286,7 +286,7 @@ select i_item_id - + @@ -416,7 +416,7 @@ select i_item_id - + @@ -546,7 +546,7 @@ select i_item_id - + @@ -676,7 +676,7 @@ select i_item_id - + @@ -928,7 +928,7 @@ select i_item_id - + @@ -1058,7 +1058,7 @@ select i_item_id - + @@ -1188,7 +1188,7 @@ select i_item_id - + @@ -1318,7 +1318,7 @@ select i_item_id - + @@ -1448,7 +1448,7 @@ select i_item_id - + @@ -8578,7 +8578,7 @@ select i_item_id - + @@ -8733,7 +8733,7 @@ select i_item_id - + @@ -8888,7 +8888,7 @@ select i_item_id - + @@ -9043,7 +9043,7 @@ select i_item_id - + @@ -9198,7 +9198,7 @@ select i_item_id - + @@ -9521,7 +9521,7 @@ select i_item_id - + @@ -9676,7 +9676,7 @@ select i_item_id - + @@ -9831,7 +9831,7 @@ select i_item_id - + @@ -9986,7 +9986,7 @@ select i_item_id - + @@ -10141,7 +10141,7 @@ select i_item_id - + @@ -15098,7 +15098,7 @@ select i_item_id - + @@ -15157,7 +15157,7 @@ select i_item_id - + @@ -15216,7 +15216,7 @@ select i_item_id - + @@ -15275,7 +15275,7 @@ select i_item_id - + @@ -15334,7 +15334,7 @@ select i_item_id - + @@ -15456,7 +15456,7 @@ select i_item_id - + @@ -15515,7 +15515,7 @@ select i_item_id - + @@ -15574,7 +15574,7 @@ select i_item_id - + @@ -15633,7 +15633,7 @@ select i_item_id - + @@ -15692,7 +15692,7 @@ select i_item_id - + diff --git a/src/backend/gporca/data/dxl/minidump/TranslateFilterDisjunctQuals.mdp b/src/backend/gporca/data/dxl/minidump/TranslateFilterDisjunctQuals.mdp index b5a2ed165dd..7aa5bd43340 100644 --- a/src/backend/gporca/data/dxl/minidump/TranslateFilterDisjunctQuals.mdp +++ b/src/backend/gporca/data/dxl/minidump/TranslateFilterDisjunctQuals.mdp @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -119,7 +119,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TranslateFilterWithCTEAndTableScanIntoFilterAndOneTimeFilter.mdp b/src/backend/gporca/data/dxl/minidump/TranslateFilterWithCTEAndTableScanIntoFilterAndOneTimeFilter.mdp index 3c95ac3b94a..42edd562277 100644 --- a/src/backend/gporca/data/dxl/minidump/TranslateFilterWithCTEAndTableScanIntoFilterAndOneTimeFilter.mdp +++ b/src/backend/gporca/data/dxl/minidump/TranslateFilterWithCTEAndTableScanIntoFilterAndOneTimeFilter.mdp @@ -82,7 +82,7 @@ - + @@ -116,7 +116,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TranslateOneTimeFilterConjunctQuals.mdp b/src/backend/gporca/data/dxl/minidump/TranslateOneTimeFilterConjunctQuals.mdp index 58079fafbc8..b6d56b30e4d 100644 --- a/src/backend/gporca/data/dxl/minidump/TranslateOneTimeFilterConjunctQuals.mdp +++ b/src/backend/gporca/data/dxl/minidump/TranslateOneTimeFilterConjunctQuals.mdp @@ -54,7 +54,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -122,7 +122,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/TypeModifierArrayRef.mdp b/src/backend/gporca/data/dxl/minidump/TypeModifierArrayRef.mdp index c25ee6b66bb..5b2f0270ce6 100644 --- a/src/backend/gporca/data/dxl/minidump/TypeModifierArrayRef.mdp +++ b/src/backend/gporca/data/dxl/minidump/TypeModifierArrayRef.mdp @@ -142,7 +142,7 @@ SELECT b[1] AS typmod_in_array_ref FROM foo; - + diff --git a/src/backend/gporca/data/dxl/minidump/TypeModifierCast.mdp b/src/backend/gporca/data/dxl/minidump/TypeModifierCast.mdp index ec4e5cece28..368ad2c9a11 100644 --- a/src/backend/gporca/data/dxl/minidump/TypeModifierCast.mdp +++ b/src/backend/gporca/data/dxl/minidump/TypeModifierCast.mdp @@ -131,7 +131,7 @@ EXPLAIN SELECT b::varchar(40) FROM tab1; - + diff --git a/src/backend/gporca/data/dxl/minidump/TypeModifierColumn.mdp b/src/backend/gporca/data/dxl/minidump/TypeModifierColumn.mdp index 863105c78fa..952b73c202d 100644 --- a/src/backend/gporca/data/dxl/minidump/TypeModifierColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/TypeModifierColumn.mdp @@ -127,7 +127,7 @@ select b from tab1; - + diff --git a/src/backend/gporca/data/dxl/minidump/Union-NOT-Plus-OR-Constraint.mdp b/src/backend/gporca/data/dxl/minidump/Union-NOT-Plus-OR-Constraint.mdp index 182bdaae6dc..3bb68f41897 100644 --- a/src/backend/gporca/data/dxl/minidump/Union-NOT-Plus-OR-Constraint.mdp +++ b/src/backend/gporca/data/dxl/minidump/Union-NOT-Plus-OR-Constraint.mdp @@ -21,7 +21,7 @@ explain SELECT a.f3 FROM tb a JOIN tb b ON a.f1 = b.f1 AND NOT ( a.f2 = 0 OR a.f - + diff --git a/src/backend/gporca/data/dxl/minidump/Union-On-HJNs.mdp b/src/backend/gporca/data/dxl/minidump/Union-On-HJNs.mdp deleted file mode 100644 index d8426d86b96..00000000000 --- a/src/backend/gporca/data/dxl/minidump/Union-On-HJNs.mdp +++ /dev/null @@ -1,3603 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/backend/gporca/data/dxl/minidump/UnionWithCTE.mdp b/src/backend/gporca/data/dxl/minidump/UnionWithCTE.mdp index e6229e1696e..92150d88a35 100644 --- a/src/backend/gporca/data/dxl/minidump/UnionWithCTE.mdp +++ b/src/backend/gporca/data/dxl/minidump/UnionWithCTE.mdp @@ -27,7 +27,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateDistKeyMismatchedDistribution.mdp b/src/backend/gporca/data/dxl/minidump/UpdateDistKeyMismatchedDistribution.mdp index a7f7d3d3015..3e892428db1 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateDistKeyMismatchedDistribution.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateDistKeyMismatchedDistribution.mdp @@ -16,7 +16,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -296,7 +296,7 @@ - + @@ -368,7 +368,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateDistKeyWithNestedJoin.mdp b/src/backend/gporca/data/dxl/minidump/UpdateDistKeyWithNestedJoin.mdp index 5df46e1d83a..6958ce324a7 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateDistKeyWithNestedJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateDistKeyWithNestedJoin.mdp @@ -143,7 +143,7 @@ WHERE t1.id1 = t2.id1; - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateDroppedCols.mdp b/src/backend/gporca/data/dxl/minidump/UpdateDroppedCols.mdp index 561443810e9..051263db850 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateDroppedCols.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateDroppedCols.mdp @@ -195,7 +195,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -348,7 +348,7 @@ - + @@ -399,7 +399,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateNoDistKeyMismatchedDistribution.mdp b/src/backend/gporca/data/dxl/minidump/UpdateNoDistKeyMismatchedDistribution.mdp index ed944ed42e0..b93e00aa366 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateNoDistKeyMismatchedDistribution.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateNoDistKeyMismatchedDistribution.mdp @@ -170,7 +170,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -325,7 +325,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -489,7 +489,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateNoEnforceConstraints.mdp b/src/backend/gporca/data/dxl/minidump/UpdateNoEnforceConstraints.mdp index c1fa481fd83..ecd8c17f898 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateNoEnforceConstraints.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateNoEnforceConstraints.mdp @@ -82,7 +82,7 @@ update constraints_tab SET notnullcol = NULL, positivecol =-1; - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdatePartTable.mdp b/src/backend/gporca/data/dxl/minidump/UpdatePartTable.mdp index b4c23cfdaa6..6e66d30ab01 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdatePartTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdatePartTable.mdp @@ -195,7 +195,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -348,7 +348,7 @@ - + @@ -399,7 +399,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateWindowGatherMerge.mdp b/src/backend/gporca/data/dxl/minidump/UpdateWindowGatherMerge.mdp index 3721bc2a742..0e5b3a782cc 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateWindowGatherMerge.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateWindowGatherMerge.mdp @@ -156,7 +156,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdateWithHashJoin.mdp b/src/backend/gporca/data/dxl/minidump/UpdateWithHashJoin.mdp index c33cb82b145..fafb23b9144 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdateWithHashJoin.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdateWithHashJoin.mdp @@ -28,7 +28,7 @@ - + @@ -62,7 +62,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdatingDistributionColumn.mdp b/src/backend/gporca/data/dxl/minidump/UpdatingDistributionColumn.mdp index 0d2d2e5275a..dcea05d6826 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdatingDistributionColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdatingDistributionColumn.mdp @@ -29,7 +29,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdatingMultipleColumn.mdp b/src/backend/gporca/data/dxl/minidump/UpdatingMultipleColumn.mdp index 1edf6088993..c332d8240bb 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdatingMultipleColumn.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdatingMultipleColumn.mdp @@ -113,7 +113,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdatingNonDistColSameTable.mdp b/src/backend/gporca/data/dxl/minidump/UpdatingNonDistColSameTable.mdp index 5ecf8e9b3a3..d8ee9e4aaff 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdatingNonDistColSameTable.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdatingNonDistColSameTable.mdp @@ -36,7 +36,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/UpdatingNonDistributionColumnFunc.mdp b/src/backend/gporca/data/dxl/minidump/UpdatingNonDistributionColumnFunc.mdp index 53f4c8e2445..df31048c9a3 100644 --- a/src/backend/gporca/data/dxl/minidump/UpdatingNonDistributionColumnFunc.mdp +++ b/src/backend/gporca/data/dxl/minidump/UpdatingNonDistributionColumnFunc.mdp @@ -26,7 +26,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityEquals.mdp b/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityEquals.mdp index 5a1b5e46a1c..fe45683293d 100644 --- a/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityEquals.mdp +++ b/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityEquals.mdp @@ -186,7 +186,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityGreaterThan.mdp b/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityGreaterThan.mdp index 1a7fef03459..49096c2dcd3 100644 --- a/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityGreaterThan.mdp +++ b/src/backend/gporca/data/dxl/minidump/VarcharMCVCardinalityGreaterThan.mdp @@ -199,7 +199,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/VolatileFunctionsBelowScalarAgg.mdp b/src/backend/gporca/data/dxl/minidump/VolatileFunctionsBelowScalarAgg.mdp index 41fd4fe524c..e2b5bff8fc7 100644 --- a/src/backend/gporca/data/dxl/minidump/VolatileFunctionsBelowScalarAgg.mdp +++ b/src/backend/gporca/data/dxl/minidump/VolatileFunctionsBelowScalarAgg.mdp @@ -32,7 +32,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/WindowFrame-SingleEdged.mdp b/src/backend/gporca/data/dxl/minidump/WindowFrame-SingleEdged.mdp index 9b81a4c4104..8772187907f 100644 --- a/src/backend/gporca/data/dxl/minidump/WindowFrame-SingleEdged.mdp +++ b/src/backend/gporca/data/dxl/minidump/WindowFrame-SingleEdged.mdp @@ -165,7 +165,7 @@ - + diff --git a/src/backend/gporca/data/dxl/minidump/window-count-gpdb6.mdp b/src/backend/gporca/data/dxl/minidump/window-count-gpdb6.mdp index 3fa39ccad3f..1ed3aa20260 100644 --- a/src/backend/gporca/data/dxl/minidump/window-count-gpdb6.mdp +++ b/src/backend/gporca/data/dxl/minidump/window-count-gpdb6.mdp @@ -21,7 +21,7 @@ explain select b,c, count(c) over (partition by b) from (select * from foo) s; - + diff --git a/src/backend/gporca/data/dxl/parse_tests/q26-Metadata.xml b/src/backend/gporca/data/dxl/parse_tests/q26-Metadata.xml index c4de1785ad0..6a4bd2046bd 100644 --- a/src/backend/gporca/data/dxl/parse_tests/q26-Metadata.xml +++ b/src/backend/gporca/data/dxl/parse_tests/q26-Metadata.xml @@ -16,7 +16,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -127,20 +127,8 @@ - - - - - - - - - - - - - + @@ -156,7 +144,7 @@ - + @@ -174,7 +162,7 @@ - + @@ -262,20 +250,8 @@ - - - - - - - - - - - - - + @@ -314,7 +290,7 @@ - + @@ -344,7 +320,7 @@ - + @@ -374,7 +350,7 @@ - + @@ -407,7 +383,7 @@ - + diff --git a/src/backend/gporca/gporca.mk b/src/backend/gporca/gporca.mk index 78a6c788331..5aa2c88887c 100644 --- a/src/backend/gporca/gporca.mk +++ b/src/backend/gporca/gporca.mk @@ -5,3 +5,8 @@ override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libgpdbcost/include $(CP # Do not omit frame pointer. Even with RELEASE builds, it is used for # backtracing. override CXXFLAGS := -Werror -Wextra -Wpedantic -fno-omit-frame-pointer $(CXXFLAGS) + +# orca is not accessed in JIT (executor stage), avoid the generation of .bc here +# NOTE: accordingly we MUST avoid them in install step (install-postgres-bitcode +# in src/backend/Makefile) +with_llvm = no diff --git a/src/backend/gporca/libgpdbcost/src/CCostModelGPDB.cpp b/src/backend/gporca/libgpdbcost/src/CCostModelGPDB.cpp index cd98eb078ee..fbd818b0098 100644 --- a/src/backend/gporca/libgpdbcost/src/CCostModelGPDB.cpp +++ b/src/backend/gporca/libgpdbcost/src/CCostModelGPDB.cpp @@ -991,6 +991,19 @@ CCostModelGPDB::CostHashJoin(CMemoryPool *mp, CExpressionHandle &exprhdl, CDouble skew_ratio = 1; ULONG arity = exprhdl.Arity(); + if (GPOS_FTRACE(EopttraceDiscardRedistributeHashJoin)) + { + for (ULONG ul = 0; ul < arity - 1; ul++) + { + COperator *popChild = exprhdl.Pop(ul); + if (nullptr != popChild && + COperator::EopPhysicalMotionHashDistribute == popChild->Eopid()) + { + return CCost(GPOS_FP_ABS_MAX); + } + } + } + // Hashjoin with skewed HashRedistribute below them are expensive // find out if there is a skewed redistribute child of this HashJoin. if (!GPOS_FTRACE(EopttracePenalizeSkewedHashJoin)) diff --git a/src/backend/gporca/libgpopt/include/gpopt/base/CDistributionSpecRandom.h b/src/backend/gporca/libgpopt/include/gpopt/base/CDistributionSpecRandom.h index 0c66926b0ee..4518d40cd9c 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/base/CDistributionSpecRandom.h +++ b/src/backend/gporca/libgpopt/include/gpopt/base/CDistributionSpecRandom.h @@ -65,6 +65,11 @@ class CDistributionSpecRandom : public CDistributionSpec return "RANDOM"; } + CColRef * + GetGpSegmentId() + { + return m_gp_segment_id; + } // is distribution duplicate sensitive BOOL IsDuplicateSensitive() const diff --git a/src/backend/gporca/libgpopt/include/gpopt/base/CReqdPropRelational.h b/src/backend/gporca/libgpopt/include/gpopt/base/CReqdPropRelational.h index e0e49cd49d8..03f440b1677 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/base/CReqdPropRelational.h +++ b/src/backend/gporca/libgpopt/include/gpopt/base/CReqdPropRelational.h @@ -39,9 +39,6 @@ class CReqdPropRelational : public CReqdProp // required stat columns CColRefSet *m_pcrsStat{nullptr}; - // predicate on partition key - CExpression *m_pexprPartPred{nullptr}; - public: CReqdPropRelational(const CReqdPropRelational &) = delete; @@ -51,9 +48,6 @@ class CReqdPropRelational : public CReqdProp // ctor explicit CReqdPropRelational(CColRefSet *pcrs); - // ctor - CReqdPropRelational(CColRefSet *pcrs, CExpression *pexprPartPred); - // dtor ~CReqdPropRelational() override; @@ -72,13 +66,6 @@ class CReqdPropRelational : public CReqdProp return m_pcrsStat; } - // partition predicate accessor - CExpression * - PexprPartPred() const - { - return m_pexprPartPred; - } - // required properties computation function void Compute(CMemoryPool *mp, CExpressionHandle &exprhdl, CReqdProp *prpInput, ULONG child_index, diff --git a/src/backend/gporca/libgpopt/include/gpopt/base/CUtils.h b/src/backend/gporca/libgpopt/include/gpopt/base/CUtils.h index 57995b858a5..d29b059b716 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/base/CUtils.h +++ b/src/backend/gporca/libgpopt/include/gpopt/base/CUtils.h @@ -22,6 +22,7 @@ #include "gpopt/operators/CScalarArrayCmp.h" #include "gpopt/operators/CScalarBoolOp.h" #include "gpopt/operators/CScalarConst.h" +#include "gpopt/operators/CScalarIdent.h" #include "gpopt/operators/CScalarProjectElement.h" #include "gpopt/xforms/CXform.h" @@ -998,6 +999,12 @@ class CUtils CExpressionArrays *input_exprs); static BOOL FScalarConstBoolNull(CExpression *pexpr); + + static CScalarIdent *PscalarIdent(CExpression *pexpr); + + static CScalarConst *PscalarConst(CExpression *pexpr); + + static BOOL FScalarConstOrBinaryCoercible(CExpression *pexpr); }; // class CUtils // hash set from expressions diff --git a/src/backend/gporca/libgpopt/include/gpopt/mdcache/CMDAccessor.h b/src/backend/gporca/libgpopt/include/gpopt/mdcache/CMDAccessor.h index d349e478d02..b8fad92319f 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/mdcache/CMDAccessor.h +++ b/src/backend/gporca/libgpopt/include/gpopt/mdcache/CMDAccessor.h @@ -21,6 +21,8 @@ #include "gpopt/engine/CStatisticsConfig.h" #include "gpopt/mdcache/CMDKey.h" #include "naucrates/md/CSystemId.h" +#include "naucrates/md/IMDExtStats.h" +#include "naucrates/md/IMDExtStatsInfo.h" #include "naucrates/md/IMDFunction.h" #include "naucrates/md/IMDId.h" #include "naucrates/md/IMDProvider.h" @@ -293,6 +295,12 @@ class CMDAccessor void RegisterProviders(const CSystemIdArray *pdrgpsysid, const CMDProviderArray *pdrgpmdp); + // interface to an extended stats object from the MD cache + const IMDExtStats *RetrieveExtStats(IMDId *mdid); + + // interface to an extended stats metadata object from the MD cache + const IMDExtStatsInfo *RetrieveExtStatsInfo(IMDId *mdid); + // interface to a relation object from the MD cache const IMDRelation *RetrieveRel(IMDId *mdid); diff --git a/src/backend/gporca/libgpopt/include/gpopt/metadata/CTableDescriptor.h b/src/backend/gporca/libgpopt/include/gpopt/metadata/CTableDescriptor.h index 96b1234901c..c5974aee264 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/metadata/CTableDescriptor.h +++ b/src/backend/gporca/libgpopt/include/gpopt/metadata/CTableDescriptor.h @@ -88,6 +88,12 @@ class CTableDescriptor : public CRefCount, // lockmode from the parser INT m_lockmode; + // identifier of query to which current table belongs. + // This field is used for assigning current table entry with + // target one within DML operation. If descriptor doesn't point + // to the target (result) relation it has value UNASSIGNED_QUERYID + ULONG m_assigned_query_id_for_target_rel; + public: CTableDescriptor(const CTableDescriptor &) = delete; @@ -96,7 +102,8 @@ class CTableDescriptor : public CRefCount, BOOL convert_hash_to_random, IMDRelation::Ereldistrpolicy rel_distr_policy, IMDRelation::Erelstoragetype erelstoragetype, - ULONG ulExecuteAsUser, INT lockmode); + ULONG ulExecuteAsUser, INT lockmode, + ULONG assigned_query_id_for_target_rel); // dtor ~CTableDescriptor() override; @@ -182,8 +189,6 @@ class CTableDescriptor : public CRefCount, return m_pdrgpbsKeys; } - // return the number of leaf partitions - ULONG PartitionCount() const; // distribution policy IMDRelation::Ereldistrpolicy @@ -231,6 +236,12 @@ class CTableDescriptor : public CRefCount, m_erelstoragetype == IMDRelation::ErelstorageAppendOnlyRows; } + ULONG + GetAssignedQueryIdForTargetRel() const + { + return m_assigned_query_id_for_target_rel; + } + }; // class CTableDescriptor } // namespace gpopt diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CExpression.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CExpression.h index a1888eab5f4..16b5d105f67 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CExpression.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CExpression.h @@ -108,11 +108,6 @@ class CExpression : public CRefCount, public gpos::DbgPrintMixin #endif // GPOS_DEBUG -#if 0 - // check if the expression satisfies partition enforcer condition - BOOL FValidPartEnforcers(CDrvdPropCtxtPlan *pdpctxtplan); -#endif - // check if the distributions of all children are compatible BOOL FValidChildrenDistribution(CDrvdPropCtxtPlan *pdpctxtplan); diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CExpressionPreprocessor.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CExpressionPreprocessor.h index 64b2f3c9a61..7b2f2f818cc 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CExpressionPreprocessor.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CExpressionPreprocessor.h @@ -16,14 +16,21 @@ #include "gpos/base.h" #include "gpopt/base/CColumnFactory.h" +#include "gpopt/base/CUtils.h" #include "gpopt/mdcache/CMDAccessor.h" #include "gpopt/operators/CExpression.h" #include "gpopt/operators/CScalarBoolOp.h" +#include "gpopt/operators/CScalarConst.h" +#include "gpopt/operators/CScalarIdent.h" namespace gpopt { using namespace gpos; +using ExprToConstantMap = + CHashMap, CleanupRelease>; + //--------------------------------------------------------------------------- // @class: // CExpressionPreprocessor @@ -154,6 +161,10 @@ class CExpressionPreprocessor static CExpression *PexprRemoveUnusedCTEs(CMemoryPool *mp, CExpression *pexpr); + static CExpression *PexprReplaceColWithConst( + CMemoryPool *mp, CExpression *pexpr, ExprToConstantMap *phmExprToConst, + BOOL checkFilterForConstants); + // collect CTE predicates from consumers static void CollectCTEPredicates(CMemoryPool *mp, CExpression *pexpr, CTEPredsMap *phm); diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CLogical.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CLogical.h index 280cf2c53dc..925115eb284 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CLogical.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CLogical.h @@ -277,12 +277,6 @@ class CLogical : public COperator CColRefSet *pcrsInput, ULONG child_index) const = 0; - // compute partition predicate to pass down to n-th child - virtual CExpression *PexprPartPred(CMemoryPool *mp, - CExpressionHandle &exprhdl, - CExpression *pexprInput, - ULONG child_index) const; - //------------------------------------------------------------------------------------- // Transformations //------------------------------------------------------------------------------------- diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CLogicalSelect.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CLogicalSelect.h index b1a69cdce80..db80c0f5757 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CLogicalSelect.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CLogicalSelect.h @@ -102,11 +102,6 @@ class CLogicalSelect : public CLogicalUnary return exprhdl.DeriveTableDescriptor(0); } - // compute partition predicate to pass down to n-th child - CExpression *PexprPartPred(CMemoryPool *mp, CExpressionHandle &exprhdl, - CExpression *pexprInput, - ULONG child_index) const override; - //------------------------------------------------------------------------------------- // Transformations //------------------------------------------------------------------------------------- diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CPredicateUtils.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CPredicateUtils.h index 0c5903864c2..3ca2f85c56d 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CPredicateUtils.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CPredicateUtils.h @@ -17,6 +17,7 @@ #include "gpopt/mdcache/CMDAccessor.h" #include "gpopt/operators/CExpression.h" #include "gpopt/operators/CScalarBoolOp.h" +#include "gpopt/operators/CScalarIdent.h" namespace gpopt { @@ -187,6 +188,9 @@ class CPredicateUtils // is the given expression a comparison between a scalar ident and a constant static BOOL FCompareIdentToConst(CExpression *pexpr); + static BOOL FCompareIdentToConst(CExpression *pexpr, + CExpression *&pexprIdent, + CExpression *&pexprConst); // is the given expression a comparison between a const and a const static BOOL FCompareConstToConstIgnoreCast(CExpression *pexpr); @@ -324,20 +328,6 @@ class CPredicateUtils // check if the given expression of the form "col is not null" static BOOL FNotNullCheckOnColumn(CExpression *pexpr, CColRef *colref); - // check if the given expression is a disjunction of scalar cmp - // expressions on the given column - static BOOL IsDisjunctionOfRangeComparison(CMemoryPool *mp, - CExpression *pexpr, - CColRef *colref, - CColRefSet *pcrsAllowedRefs, - BOOL allowNotEqualPreds); - - // check if the given comparison type is one of the range comparisons, i.e. - // LT, GT, LEq, GEq, Eq - static BOOL FRangeComparison(CExpression *expr, CColRef *colref, - CColRefSet *pcrsAllowedRefs, - BOOL allowNotEqualPreds); - // create disjunction static CExpression *PexprDisjunction(CMemoryPool *mp, CExpressionArray *Pdrgpexpr); diff --git a/src/backend/gporca/libgpopt/include/gpopt/operators/CScalarIdent.h b/src/backend/gporca/libgpopt/include/gpopt/operators/CScalarIdent.h index 6a53303d6e6..50af7161e36 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/operators/CScalarIdent.h +++ b/src/backend/gporca/libgpopt/include/gpopt/operators/CScalarIdent.h @@ -71,6 +71,18 @@ class CScalarIdent : public CScalar // operator specific hash function ULONG HashValue() const override; + static ULONG + HashValue(const CScalarIdent *pscalarIdent) + { + return CColRef::HashValue(pscalarIdent->Pcr()); + } + + static BOOL + Equals(const CScalarIdent *left, const CScalarIdent *right) + { + return CColRef::Equals(left->Pcr(), right->Pcr()); + } + // match function BOOL Matches(COperator *pop) const override; diff --git a/src/backend/gporca/libgpopt/include/gpopt/translate/CTranslatorExprToDXLUtils.h b/src/backend/gporca/libgpopt/include/gpopt/translate/CTranslatorExprToDXLUtils.h index 056823046e3..5c51de3d132 100644 --- a/src/backend/gporca/libgpopt/include/gpopt/translate/CTranslatorExprToDXLUtils.h +++ b/src/backend/gporca/libgpopt/include/gpopt/translate/CTranslatorExprToDXLUtils.h @@ -53,15 +53,6 @@ using namespace gpnaucrates; class CTranslatorExprToDXLUtils { private: - // construct a scalar comparison of the given type between the - // column with the given col id and the scalar expression - static CDXLNode *PdxlnCmp(CMemoryPool *mp, CMDAccessor *md_accessor, - ULONG ulPartLevel, BOOL fLowerBound, - CDXLNode *pdxlnScalar, IMDType::ECmpType cmp_type, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeExpr, - IMDId *pmdidTypeCastExpr, IMDId *mdid_cast_func); - - // create a column reference static CColRef *PcrCreate(CMemoryPool *mp, CMDAccessor *md_accessor, CColumnFactory *col_factory, IMDId *mdid, @@ -85,6 +76,12 @@ class CTranslatorExprToDXLUtils CMemoryPool *mp, CMDAccessor *md_accessor, CExpressionArray *pdrgpexprHashed, CConstraint *pcnstr); + // compute the direct dispatch info from the constraints + // for a randomly distributed table + static CDXLDirectDispatchInfo *GetDXLDirectDispatchInfoRandDist( + CMemoryPool *mp, CMDAccessor *md_accessor, const CColRef *pcrDistrCol, + CConstraint *pcnstrDistrCol); + // compute the direct dispatch info for a single distribution key from the constraints // on the distribution key static CDXLDirectDispatchInfo *PdxlddinfoSingleDistrKey( @@ -93,61 +90,14 @@ class CTranslatorExprToDXLUtils // check if the given constant value for a particular distribution column can be used // to identify which segment to direct dispatch to. - static BOOL FDirectDispatchable(const CColRef *pcrDistrCol, + static BOOL FDirectDispatchable(CMDAccessor *md_accessor, + const CColRef *pcrDistrCol, const CDXLDatum *dxl_datum); public: // construct a default properties container static CDXLPhysicalProperties *GetProperties(CMemoryPool *mp); - // create a scalar const value expression for the given bool value - static CDXLNode *PdxlnBoolConst(CMemoryPool *mp, CMDAccessor *md_accessor, - BOOL value); - - // create a scalar const value expression for the given int4 value - static CDXLNode *PdxlnInt4Const(CMemoryPool *mp, CMDAccessor *md_accessor, - INT val); - - // construct a filter node for a list partition predicate - static CDXLNode *PdxlnListFilterScCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnPartKey, - CDXLNode *pdxlnScalar, IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, - IMDType::ECmpType cmp_type, ULONG ulPartLevel, BOOL fHasDefaultPart); - - // construct a DXL node for the part key portion of the list partition filter - static CDXLNode *PdxlnListFilterPartKey(CMemoryPool *mp, - CMDAccessor *md_accessor, - CExpression *pexprPartKey, - IMDId *pmdidTypePartKey, - ULONG ulPartLevel); - - // construct a filter node for a range predicate - static CDXLNode *PdxlnRangeFilterScCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, - IMDId *pmdidTypeCastExpr, IMDId *mdid_cast_func, - IMDType::ECmpType cmp_type, ULONG ulPartLevel); - - // construct a range filter for an equality comparison - static CDXLNode *PdxlnRangeFilterEqCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, - IMDId *pmdidTypeCastExpr, IMDId *mdid_cast_func, ULONG ulPartLevel); - - // construct a predicate for the lower or upper bound of a partition - static CDXLNode *PdxlnRangeFilterPartBound( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, - IMDId *pmdidTypeCastExpr, IMDId *mdid_cast_func, ULONG ulPartLevel, - ULONG fLowerBound, IMDType::ECmpType cmp_type); - - // construct predicates to cover the cases of default partition and - // open-ended partitions if necessary - static CDXLNode *PdxlnRangeFilterDefaultAndOpenEnded( - CMemoryPool *mp, ULONG ulPartLevel, BOOL fLTComparison, - BOOL fGTComparison, BOOL fEQComparison, BOOL fDefaultPart); - - // check if the DXL Node is a scalar const TRUE static BOOL FScalarConstTrue(CMDAccessor *md_accessor, CDXLNode *dxlnode); diff --git a/src/backend/gporca/libgpopt/src/base/CConstraint.cpp b/src/backend/gporca/libgpopt/src/base/CConstraint.cpp index 9e9acb938e6..d71385a91cd 100644 --- a/src/backend/gporca/libgpopt/src/base/CConstraint.cpp +++ b/src/backend/gporca/libgpopt/src/base/CConstraint.cpp @@ -438,8 +438,10 @@ CConstraint::PcnstrFromScalarCmp( const CColRef *pcrLeft = popScIdLeft->Pcr(); const CColRef *pcrRight = popScIdRight->Pcr(); - if (!CUtils::FConstrainableType(pcrLeft->RetrieveType()->MDId()) || - !CUtils::FConstrainableType(pcrRight->RetrieveType()->MDId())) + IMDId *left_mdid = pcrLeft->RetrieveType()->MDId(); + IMDId *right_mdid = pcrRight->RetrieveType()->MDId(); + if (!CUtils::FConstrainableType(left_mdid) || + !CUtils::FConstrainableType(right_mdid)) { return nullptr; } @@ -450,12 +452,22 @@ CConstraint::PcnstrFromScalarCmp( CScalarCmp *sc_cmp = CScalarCmp::PopConvert(pexpr->Pop()); const IMDScalarOp *op = mda->RetrieveScOp(sc_cmp->MdIdOp()); - IMDId *left_mdid = - CScalar::PopConvert(pexprLeft->Pop())->MdidType(); + // The left type and right type are both scalar ident types + // In case of casting, such as + // --CScalarCast + // +--CScalarIdent "a" (0) + // We look at the data type before casting, instead of after + // This is because equivalent classes are built with columns + // based on their input types + + // Eg. foo.a -- varchar, bar.b -- char + // Joining foo and bar on foo.a = bar.b requires casting + // foo.a to bpchar. But since hash of varchar (before cast) + // and hash of char don't belong to the same opfamily, we + // cannot generate equivalent classes with foo.a and bar.b + const IMDType *left_type = mda->RetrieveType(left_mdid); - IMDId *right_mdid = - CScalar::PopConvert(pexprRight->Pop())->MdidType(); const IMDType *right_type = mda->RetrieveType(right_mdid); // Build constraint (e.g for equivalent classes) only when the hash families diff --git a/src/backend/gporca/libgpopt/src/base/CConstraintInterval.cpp b/src/backend/gporca/libgpopt/src/base/CConstraintInterval.cpp index fc0f4c3b3bd..7a4c0915726 100644 --- a/src/backend/gporca/libgpopt/src/base/CConstraintInterval.cpp +++ b/src/backend/gporca/libgpopt/src/base/CConstraintInterval.cpp @@ -454,38 +454,20 @@ CConstraintInterval::PciIntervalFromScalarCmp(CMemoryPool *mp, GPOS_ASSERT(nullptr != pexpr); GPOS_ASSERT(CUtils::FScalarCmp(pexpr) || CUtils::FScalarArrayCmp(pexpr)); - // TODO: - May 28, 2012; add support for other expression forms - // besides (column relop const) - if (CPredicateUtils::FCompareIdentToConst(pexpr)) + // Currently we support expression of the form + // (column relop const) + // (const reolop column) + CExpression *pexprIdent, *pexprConst; + if (CPredicateUtils::FCompareIdentToConst(pexpr, pexprIdent, pexprConst)) { // column #ifdef GPOS_DEBUG - CScalarIdent *popScId; - CExpression *pexprLeft = (*pexpr)[0]; - if (CUtils::FScalarIdent((*pexpr)[0])) - { - popScId = CScalarIdent::PopConvert(pexprLeft->Pop()); - } - else - { - GPOS_ASSERT(CCastUtils::FBinaryCoercibleCastedScId(pexprLeft)); - popScId = CScalarIdent::PopConvert((*pexprLeft)[0]->Pop()); - } + CScalarIdent *popScId = CUtils::PscalarIdent(pexprIdent); GPOS_ASSERT(colref == (CColRef *) popScId->Pcr()); #endif // GPOS_DEBUG // constant - CExpression *pexprRight = (*pexpr)[1]; - CScalarConst *popScConst; - if (CUtils::FScalarConst(pexprRight)) - { - popScConst = CScalarConst::PopConvert(pexprRight->Pop()); - } - else - { - GPOS_ASSERT(CCastUtils::FBinaryCoercibleCastedConst(pexprRight)); - popScConst = CScalarConst::PopConvert((*pexprRight)[0]->Pop()); - } + CScalarConst *popScConst = CUtils::PscalarConst(pexprConst); CScalarCmp *popScCmp = CScalarCmp::PopConvert(pexpr->Pop()); return PciIntervalFromColConstCmp(mp, colref, popScCmp->ParseCmpType(), diff --git a/src/backend/gporca/libgpopt/src/base/CDefaultComparator.cpp b/src/backend/gporca/libgpopt/src/base/CDefaultComparator.cpp index 11be5f18eff..fc33632dbda 100644 --- a/src/backend/gporca/libgpopt/src/base/CDefaultComparator.cpp +++ b/src/backend/gporca/libgpopt/src/base/CDefaultComparator.cpp @@ -124,7 +124,7 @@ CDefaultComparator::FUseInternalEvaluator(const IDatum *datum1, return true; } - if (!can_use_external_evaluator) + if (!*can_use_external_evaluator) { GPOS_RAISE(gpopt::ExmaGPOPT, gpopt::ExmiUnsupportedOp, GPOS_WSZ_LIT("Unsupported comparator evaluator for types")); diff --git a/src/backend/gporca/libgpopt/src/base/CReqdPropRelational.cpp b/src/backend/gporca/libgpopt/src/base/CReqdPropRelational.cpp index a0c7b8642c9..e2e77a0bb6f 100644 --- a/src/backend/gporca/libgpopt/src/base/CReqdPropRelational.cpp +++ b/src/backend/gporca/libgpopt/src/base/CReqdPropRelational.cpp @@ -48,22 +48,6 @@ CReqdPropRelational::CReqdPropRelational(CColRefSet *pcrs) : m_pcrsStat(pcrs) GPOS_ASSERT(nullptr != pcrs); } -//--------------------------------------------------------------------------- -// @function: -// CReqdPropRelational::CReqdPropRelational -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CReqdPropRelational::CReqdPropRelational(CColRefSet *pcrs, - CExpression *pexprPartPred) - : m_pcrsStat(pcrs), m_pexprPartPred(pexprPartPred) -{ - GPOS_ASSERT(nullptr != pcrs); - GPOS_ASSERT_IMP(nullptr != pexprPartPred, pexprPartPred->Pop()->FScalar()); -} - //--------------------------------------------------------------------------- // @function: // CReqdPropRelational::~CReqdPropRelational @@ -75,7 +59,6 @@ CReqdPropRelational::CReqdPropRelational(CColRefSet *pcrs, CReqdPropRelational::~CReqdPropRelational() { CRefCount::SafeRelease(m_pcrsStat); - CRefCount::SafeRelease(m_pexprPartPred); } //--------------------------------------------------------------------------- @@ -101,9 +84,6 @@ CReqdPropRelational::Compute(CMemoryPool *mp, CExpressionHandle &exprhdl, m_pcrsStat = popLogical->PcrsStat(mp, exprhdl, prprelInput->PcrsStat(), child_index); - m_pexprPartPred = popLogical->PexprPartPred( - mp, exprhdl, prprelInput->PexprPartPred(), child_index); - exprhdl.DeriveProducerStats(child_index, m_pcrsStat); } @@ -170,10 +150,6 @@ IOstream & CReqdPropRelational::OsPrint(IOstream &os) const { os << "req stat columns: [" << *m_pcrsStat << "]"; - if (nullptr != m_pexprPartPred) - { - os << ", partition predicate: " << *m_pexprPartPred; - } return os; } diff --git a/src/backend/gporca/libgpopt/src/base/CUtils.cpp b/src/backend/gporca/libgpopt/src/base/CUtils.cpp index f1aef5cb764..6b64c353075 100644 --- a/src/backend/gporca/libgpopt/src/base/CUtils.cpp +++ b/src/backend/gporca/libgpopt/src/base/CUtils.cpp @@ -2530,6 +2530,45 @@ CUtils::FScalarConstBoolNull(CExpression *pexpr) return false; } +CScalarIdent * +CUtils::PscalarIdent(CExpression *pexpr) +{ + CScalarIdent *popScId; + if (CUtils::FScalarIdent(pexpr)) + { + popScId = CScalarIdent::PopConvert(pexpr->Pop()); + } + else + { + GPOS_ASSERT(CCastUtils::FBinaryCoercibleCastedScId(pexpr)); + popScId = CScalarIdent::PopConvert((*pexpr)[0]->Pop()); + } + return popScId; +} + +BOOL +CUtils::FScalarConstOrBinaryCoercible(CExpression *pexpr) +{ + return CUtils::FScalarConst(pexpr) || + CCastUtils::FBinaryCoercibleCastedConst(pexpr); +} + +CScalarConst * +CUtils::PscalarConst(CExpression *pexpr) +{ + CScalarConst *popScConst; + if (CUtils::FScalarConst(pexpr)) + { + popScConst = CScalarConst::PopConvert(pexpr->Pop()); + } + else + { + GPOS_ASSERT(CCastUtils::FBinaryCoercibleCastedConst(pexpr)); + popScConst = CScalarConst::PopConvert((*pexpr)[0]->Pop()); + } + return popScConst; +} + // checks to see if the expression is a scalar const TRUE BOOL CUtils::FScalarConstTrue(CExpression *pexpr) diff --git a/src/backend/gporca/libgpopt/src/mdcache/CMDAccessor.cpp b/src/backend/gporca/libgpopt/src/mdcache/CMDAccessor.cpp index c90f317bcf9..e6bce1e784a 100644 --- a/src/backend/gporca/libgpopt/src/mdcache/CMDAccessor.cpp +++ b/src/backend/gporca/libgpopt/src/mdcache/CMDAccessor.cpp @@ -21,6 +21,7 @@ #include "gpopt/base/CColRefSetIter.h" #include "gpopt/base/CColRefTable.h" +#include "gpopt/base/COptCtxt.h" #include "gpopt/exception.h" #include "gpopt/mdcache/CMDAccessorUtils.h" #include "naucrates/dxl/CDXLUtils.h" @@ -35,6 +36,7 @@ #include "naucrates/md/IMDCast.h" #include "naucrates/md/IMDCheckConstraint.h" #include "naucrates/md/IMDColStats.h" +#include "naucrates/md/IMDExtStatsInfo.h" #include "naucrates/md/IMDFunction.h" #include "naucrates/md/IMDIndex.h" #include "naucrates/md/IMDProvider.h" @@ -611,6 +613,35 @@ CMDAccessor::GetImdObj(IMDId *mdid, IMDCacheObject::Emdtype mdtype) return pimdobj; } +const IMDExtStats * +CMDAccessor::RetrieveExtStats(IMDId *mdid) +{ + const IMDCacheObject *pmdobj = + GetImdObj(mdid, IMDCacheObject::EmdtExtStats); + if (IMDCacheObject::EmdtExtStats != pmdobj->MDType()) + { + GPOS_RAISE(gpdxl::ExmaMD, gpdxl::ExmiMDCacheEntryNotFound, + mdid->GetBuffer()); + } + + return dynamic_cast(pmdobj); +} + +const IMDExtStatsInfo * +CMDAccessor::RetrieveExtStatsInfo(IMDId *mdid) +{ + const IMDCacheObject *pmdobj = + GetImdObj(mdid, IMDCacheObject::EmdtExtStatsInfo); + if (IMDCacheObject::EmdtExtStatsInfo != pmdobj->MDType()) + { + GPOS_RAISE(gpdxl::ExmaMD, gpdxl::ExmiMDCacheEntryNotFound, + mdid->GetBuffer()); + } + + return dynamic_cast(pmdobj); +} + + //--------------------------------------------------------------------------- // @function: // CMDAccessor::RetrieveRel @@ -1057,6 +1088,7 @@ CMDAccessor::Pstats(CMemoryPool *mp, IMDId *rel_mdid, CColRefSet *pcrsHist, UlongToHistogramMap *col_histogram_mapping = GPOS_NEW(mp) UlongToHistogramMap(mp); UlongToDoubleMap *colid_width_mapping = GPOS_NEW(mp) UlongToDoubleMap(mp); + UlongToIntMap *colid_to_attno_mapping = GPOS_NEW(m_mp) UlongToIntMap(m_mp); CColRefSetIter crsiHist(*pcrsHist); while (crsiHist.Advance()) @@ -1074,8 +1106,19 @@ CMDAccessor::Pstats(CMemoryPool *mp, IMDId *rel_mdid, CColRefSet *pcrsHist, RecordColumnStats(mp, rel_mdid, colid, ulPos, pcrtable->IsSystemCol(), fEmptyTable, col_histogram_mapping, colid_width_mapping, stats_config); + colid_to_attno_mapping->Insert(GPOS_NEW(m_mp) ULONG(colid), + GPOS_NEW(m_mp) INT(attno)); } + CMDIdGPDB *pmdid = GPOS_NEW(mp) CMDIdGPDB( + IMDId::EmdidExtStatsInfo, CMDIdGPDB::CastMdid(rel_mdid)->Oid()); + + const COptCtxt *poctxt = COptCtxt::PoctxtFromTLS(); + CMDAccessor *md_accessor = poctxt->Pmda(); + const IMDExtStatsInfo *extstats_info = + md_accessor->RetrieveExtStatsInfo(pmdid); + pmdid->Release(); + // extract column widths CColRefSetIter crsiWidth(*pcrsWidth); @@ -1100,7 +1143,8 @@ CMDAccessor::Pstats(CMemoryPool *mp, IMDId *rel_mdid, CColRefSet *pcrsHist, return GPOS_NEW(mp) CStatistics( mp, col_histogram_mapping, colid_width_mapping, rows, fEmptyTable, pmdRelStats->RelPages(), pmdRelStats->RelAllVisible(), - 1.0 /* default rebinds */, 0 /* default predicates*/); + 1.0 /* default rebinds */, 0 /* default predicates*/, extstats_info, + colid_to_attno_mapping); } diff --git a/src/backend/gporca/libgpopt/src/mdcache/CMDAccessorUtils.cpp b/src/backend/gporca/libgpopt/src/mdcache/CMDAccessorUtils.cpp index 8adf870ec6c..0e0a22be1e3 100644 --- a/src/backend/gporca/libgpopt/src/mdcache/CMDAccessorUtils.cpp +++ b/src/backend/gporca/libgpopt/src/mdcache/CMDAccessorUtils.cpp @@ -83,7 +83,7 @@ CMDAccessorUtils::FCmpExists(CMDAccessor *md_accessor, IMDId *left_mdid, { GPOS_ASSERT(nullptr != md_accessor); GPOS_ASSERT(nullptr != left_mdid); - GPOS_ASSERT(nullptr != left_mdid); + GPOS_ASSERT(nullptr != right_mdid); GPOS_ASSERT(IMDType::EcmptOther > cmp_type); GPOS_TRY @@ -113,7 +113,7 @@ CMDAccessorUtils::GetScCmpMdid(CMDAccessor *md_accessor, IMDId *left_mdid, { GPOS_ASSERT(nullptr != md_accessor); GPOS_ASSERT(nullptr != left_mdid); - GPOS_ASSERT(nullptr != left_mdid); + GPOS_ASSERT(nullptr != right_mdid); GPOS_ASSERT(IMDType::EcmptOther > cmp_type); IMDId *sc_cmp_mdid; @@ -331,7 +331,7 @@ CMDAccessorUtils::ApplyCastsForScCmp(CMemoryPool *mp, CMDAccessor *md_accessor, // CMDAccessorUtils::FCastExists // // @doc: -// Does if a cast object between given source and destination types exists +// Check if a cast object between given source and destination types exists // //--------------------------------------------------------------------------- BOOL diff --git a/src/backend/gporca/libgpopt/src/metadata/CTableDescriptor.cpp b/src/backend/gporca/libgpopt/src/metadata/CTableDescriptor.cpp index 2a7df98279b..e5843f771c6 100644 --- a/src/backend/gporca/libgpopt/src/metadata/CTableDescriptor.cpp +++ b/src/backend/gporca/libgpopt/src/metadata/CTableDescriptor.cpp @@ -38,7 +38,7 @@ CTableDescriptor::CTableDescriptor( CMemoryPool *mp, IMDId *mdid, const CName &name, BOOL convert_hash_to_random, IMDRelation::Ereldistrpolicy rel_distr_policy, IMDRelation::Erelstoragetype erelstoragetype, ULONG ulExecuteAsUser, - INT lockmode) + INT lockmode, ULONG assigned_query_id_for_target_rel) : m_mp(mp), m_mdid(mdid), m_name(mp, name), @@ -51,7 +51,8 @@ CTableDescriptor::CTableDescriptor( m_pdrgpulPart(nullptr), m_pdrgpbsKeys(nullptr), m_execute_as_user_id(ulExecuteAsUser), - m_lockmode(lockmode) + m_lockmode(lockmode), + m_assigned_query_id_for_target_rel(assigned_query_id_for_target_rel) { GPOS_ASSERT(nullptr != mp); GPOS_ASSERT(mdid->IsValid()); @@ -305,26 +306,5 @@ CTableDescriptor::IndexCount() return ulIndices; } -//--------------------------------------------------------------------------- -// @function: -// CTableDescriptor::PartitionCount -// -// @doc: -// Returns number of leaf partitions -// -// -//--------------------------------------------------------------------------- -ULONG -CTableDescriptor::PartitionCount() const -{ - GPOS_ASSERT(nullptr != m_mdid); - - CMDAccessor *md_accessor = COptCtxt::PoctxtFromTLS()->Pmda(); - const IMDRelation *pmdrel = md_accessor->RetrieveRel(m_mdid); - const ULONG ulPartitions = pmdrel->PartitionCount(); - - return ulPartitions; -} - // EOF diff --git a/src/backend/gporca/libgpopt/src/operators/CExpression.cpp b/src/backend/gporca/libgpopt/src/operators/CExpression.cpp index 8de663ffa70..641fb7f04ce 100644 --- a/src/backend/gporca/libgpopt/src/operators/CExpression.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CExpression.cpp @@ -1285,7 +1285,6 @@ CExpression::FValidPlan(const CReqdPropPlan *prpp, CDrvdPropRelational *pdprel = GetDrvdPropRelational(); - // GPDB_12_MERGE_FIXME: Also check FValidPartEnforcers() return prpp->FCompatible(exprhdl, CPhysical::PopConvert(m_pop), pdprel, pdpplan) && FValidChildrenDistribution(pdpctxtplan); @@ -1330,43 +1329,6 @@ CExpression::FValidChildrenDistribution(CDrvdPropCtxtPlan *pdpctxtplan) return true; } -#if 0 -//--------------------------------------------------------------------------- -// @function: -// CExpression::FValidPartEnforcers -// -// @doc: -// Check if the expression is valid with respect to the partition enforcers. -// -//--------------------------------------------------------------------------- -BOOL -CExpression::FValidPartEnforcers(CDrvdPropCtxtPlan *pdpctxtplan) -{ - GPOS_ASSERT(Pop()->FPhysical()); - - CPartInfo *ppartinfo = DerivePartitionInfo(); - GPOS_ASSERT(NULL != ppartinfo); - - if (0 == ppartinfo->UlConsumers()) - { - // no part consumers found - return true; - } - - // retrieve plan properties - CDrvdPropPlan *pdpplan = CDrvdPropPlan::Pdpplan(PdpDerive(pdpctxtplan)); - - if (CUtils::FPhysicalMotion(Pop()) && - pdpplan->Ppim()->FContainsUnresolved()) - { - // prohibit Motion on top of unresolved partition consumers - return false; - } - - return true; -} -#endif - CColRefSet * CExpression::DeriveOuterReferences() { diff --git a/src/backend/gporca/libgpopt/src/operators/CExpressionPreprocessor.cpp b/src/backend/gporca/libgpopt/src/operators/CExpressionPreprocessor.cpp index 1f9f061365d..ced12c64182 100644 --- a/src/backend/gporca/libgpopt/src/operators/CExpressionPreprocessor.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CExpressionPreprocessor.cpp @@ -45,7 +45,6 @@ #include "gpopt/operators/COrderedAggPreprocessor.h" #include "gpopt/operators/CPredicateUtils.h" #include "gpopt/operators/CScalarCmp.h" -#include "gpopt/operators/CScalarIdent.h" #include "gpopt/operators/CScalarNAryJoinPredList.h" #include "gpopt/operators/CScalarProjectElement.h" #include "gpopt/operators/CScalarProjectList.h" @@ -64,6 +63,13 @@ using namespace gpopt; +static void UpdateExprToConstantPredicateMapping( + CMemoryPool *mp, CExpression *pexprFilter, + ExprToConstantMap *phmExprToConst, BOOL doInsert); + +static CExpression *SubstituteConstantIdentifier( + CMemoryPool *mp, CExpression *pexpr, ExprToConstantMap *phmExprToConst); + // maximum number of equality predicates to be derived from existing equalities #define GPOPT_MAX_DERIVED_PREDS 50 @@ -1966,6 +1972,210 @@ CExpressionPreprocessor::PexprRemoveUnusedCTEs(CMemoryPool *mp, return GPOS_NEW(mp) CExpression(mp, pop, pdrgpexpr); } +// Create an identifier to constant map +// +// Given a select filter expression, map all conjunctive equality between an +// identifier and a constant value. +// +// NB: This function either inserts or deletes mapped values. Parameter +// 'doInsert' is used to indicate which of the two to perform. +static void +UpdateExprToConstantPredicateMapping(CMemoryPool *mp, CExpression *pexprFilter, + ExprToConstantMap *phmExprToConst, + BOOL doInsert) +{ + if (CPredicateUtils::IsEqualityOp(pexprFilter)) + { + // the following section handles predicates of the kind (a = 10) + if (!CUtils::FScalarConstOrBinaryCoercible((*pexprFilter)[0]) && + CUtils::FScalarConstOrBinaryCoercible((*pexprFilter)[1])) + { + if (doInsert) + { + (*pexprFilter)[0]->AddRef(); + (*pexprFilter)[1]->AddRef(); + phmExprToConst->Insert((*pexprFilter)[0], (*pexprFilter)[1]); + } + else + { + phmExprToConst->Delete((*pexprFilter)[0]); + } + } + // the following section handles predicates of the kind (10 = a) + else if (CUtils::FScalarConstOrBinaryCoercible((*pexprFilter)[0]) && + !CUtils::FScalarConstOrBinaryCoercible((*pexprFilter)[1])) + { + if (doInsert) + { + (*pexprFilter)[0]->AddRef(); + (*pexprFilter)[1]->AddRef(); + phmExprToConst->Insert((*pexprFilter)[1], (*pexprFilter)[0]); + } + else + { + phmExprToConst->Delete((*pexprFilter)[1]); + } + } + } + else if (CPredicateUtils::FAnd(pexprFilter)) + { + const ULONG ulChildren = pexprFilter->Arity(); + for (ULONG ul = 0; ul < ulChildren; ul++) + { + UpdateExprToConstantPredicateMapping(mp, (*pexprFilter)[ul], + phmExprToConst, doInsert); + } + } +} + +// Create a new expression from an exression and map of ident to const +static CExpression * +SubstituteConstantIdentifier(CMemoryPool *mp, CExpression *pexpr, + ExprToConstantMap *phmExprToConst) +{ + CExpressionArray *pdrgpexpr = GPOS_NEW(mp) CExpressionArray(mp); + + const ULONG ulChildren = pexpr->Arity(); + for (ULONG ul = 0; ul < ulChildren; ul++) + { + CExpression *pexprChild = nullptr; + if (COperator::EopScalarConst != (*pexpr)[ul]->Pop()->Eopid() && + phmExprToConst->Find((*pexpr)[ul]) != nullptr) + { + // substitute with constant + pexprChild = phmExprToConst->Find((*pexpr)[ul]); + pexprChild->AddRef(); + } + else + { + pexprChild = + SubstituteConstantIdentifier(mp, (*pexpr)[ul], phmExprToConst); + } + pdrgpexpr->Append(pexprChild); + } + + COperator *pop = pexpr->Pop(); + pop->AddRef(); + return GPOS_NEW(mp) CExpression(mp, pop, pdrgpexpr); +} + +// Apply filter that replaces constants used in join predicate +// +// This preprocessing step enables additional opportunities for predicate push +// down based on synergetic join conditions and select filters. For example, +// let's use query: +// +// SELECT count(*) FROM t2 INNER JOIN t1 ON t2.c BETWEEN t1.a AND t1.b WHERE t2.c = 2; +// +// Input: +// +--CLogicalSelect +// |--CLogicalNAryJoin +// | |--CLogicalGet "t2" ("t2"), Columns: ["c" (0), "d" (1),... +// | |--CLogicalGet "t1" ("t1"), Columns: ["a" (9), "b" (10),... +// | +--CScalarBoolOp (EboolopAnd) +// | |--CScalarCmp (>=) +// | | |--CScalarIdent "c" (0) +// | | +--CScalarIdent "a" (9) +// | +--CScalarCmp (<=) +// | |--CScalarIdent "c" (0) +// | +--CScalarIdent "b" (10) +// +--CScalarCmp (=) +// |--CScalarIdent "c" (0) +// +--CScalarConst (2) +// +// Notice that the join predicate references columns (a, b, and c) coming from +// both sides of the join. Typically this means the predicate cannot be pushed +// down. However, the select filter above the join predicate filters on c=2. +// We can utilize that in conjunction with the join condition to filter out +// more rows. We do that outputing: +// +// Output: +// +--CLogicalSelect +// +--CLogicalSelect +// | |--CLogicalNAryJoin +// | | |--CLogicalGet "t2" ("t2"), Columns: ["c" (0), "d" (1),... +// | | |--CLogicalGet "t1" ("t1"), Columns: ["a" (9), "b" (10),... +// | | +--CScalarBoolOp (EboolopAnd) +// | | |--CScalarCmp (>=) +// | | | |--CScalarIdent "c" (0) +// | | | +--CScalarIdent "a" (9) +// | | +--CScalarCmp (<=) +// | | |--CScalarIdent "c" (0) +// | | +--CScalarIdent "b" (10) +// | +--CScalarBoolOp (EboolopAnd) +// | |--CScalarCmp (>=) +// | | +--CScalarConst (2) +// | | +--CScalarIdent "a" (9) +// | +--CScalarCmp (<=) +// | | +--CScalarConst (2) +// | +--CScalarIdent "b" (10) +// +--CScalarCmp (=) +// |--CScalarIdent "c" (0) +// +--CScalarConst (2) +CExpression * +CExpressionPreprocessor::PexprReplaceColWithConst( + CMemoryPool *mp, CExpression *pexpr, ExprToConstantMap *phmExprToConst, + BOOL checkFilterForConstants) +{ + GPOS_ASSERT(nullptr != pexpr); + + COperator *pop = pexpr->Pop(); + // Here we check for following pattern: + // + // Select + // |-- NaryJoin/LeftOuterJoin + // |-- ... + // +-- Filter + // + // Notice that Select is processed twice with different values of + // checkFilterForConstants. First time is to create the constant mapping. + // The second time is to use the const mapping to process the node and + // children to add additional select filters. + if (checkFilterForConstants && + COperator::EopLogicalSelect == pexpr->Pop()->Eopid() && + (COperator::EopLogicalLeftOuterJoin == ((*pexpr)[0])->Pop()->Eopid() || + COperator::EopLogicalNAryJoin == ((*pexpr)[0])->Pop()->Eopid())) + { + UpdateExprToConstantPredicateMapping(mp, (*pexpr)[pexpr->Arity() - 1], + phmExprToConst, true); + + CExpression *pexprNew = + PexprReplaceColWithConst(mp, pexpr, phmExprToConst, false); + + // erase values from map... + UpdateExprToConstantPredicateMapping(mp, (*pexpr)[pexpr->Arity() - 1], + phmExprToConst, false); + + return pexprNew; + } + + // process children + CExpressionArray *pdrgpexpr = GPOS_NEW(mp) CExpressionArray(mp); + + const ULONG ulChildren = pexpr->Arity(); + for (ULONG ul = 0; ul < ulChildren; ul++) + { + CExpression *pexprChild = + PexprReplaceColWithConst(mp, (*pexpr)[ul], phmExprToConst, true); + pdrgpexpr->Append(pexprChild); + } + + if (COperator::EopLogicalNAryJoin == pexpr->Pop()->Eopid() && + phmExprToConst->Size() > 0) + { + CExpression *pexprFilter = SubstituteConstantIdentifier( + mp, (*pexpr)[pexpr->Arity() - 1], phmExprToConst); + + pop->AddRef(); + return GPOS_NEW(mp) CExpression( + mp, GPOS_NEW(mp) CLogicalSelect(mp), + GPOS_NEW(mp) CExpression(mp, pop, pdrgpexpr), pexprFilter); + } + + pop->AddRef(); + return GPOS_NEW(mp) CExpression(mp, pop, pdrgpexpr); +} + // for all consumers of the same CTE, collect all selection predicates // on top of these consumers, if any, and store them in hash map void @@ -2603,8 +2813,6 @@ CExpressionPreprocessor::PrunePartitions(CMemoryPool *mp, CExpression *expr) CConstraint::PcnstrFromScalarExpr(mp, filter_pred, &pdrgpcrsChild); CRefCount::SafeRelease(pdrgpcrsChild); - // GPDB_12_MERGE_FIXME: skip all this if pred_cnstr = NULL - IMdIdArray *selected_partition_mdids = GPOS_NEW(mp) IMdIdArray(mp); CConstraintArray *selected_partition_cnstrs = GPOS_NEW(mp) CConstraintArray(mp); @@ -3102,19 +3310,27 @@ CExpressionPreprocessor::PexprPreprocess( GPOS_CHECK_ABORT; pexprOuterRefsEleminated->Release(); - // (7) simplify quantified subqueries - CExpression *pexprSubqSimplified = - PexprSimplifyQuantifiedSubqueries(mp, pexprTrimmed2); + // (7) substitute constant predicates + ExprToConstantMap *phmExprToConst = GPOS_NEW(mp) ExprToConstantMap(mp); + CExpression *pexprPredWithConstReplaced = + PexprReplaceColWithConst(mp, pexprTrimmed2, phmExprToConst, true); GPOS_CHECK_ABORT; + phmExprToConst->Release(); pexprTrimmed2->Release(); - // (8) do preliminary unnesting of scalar subqueries + // (8) simplify quantified subqueries + CExpression *pexprSubqSimplified = + PexprSimplifyQuantifiedSubqueries(mp, pexprPredWithConstReplaced); + GPOS_CHECK_ABORT; + pexprPredWithConstReplaced->Release(); + + // (9) do preliminary unnesting of scalar subqueries CExpression *pexprSubqUnnested = PexprUnnestScalarSubqueries(mp, pexprSubqSimplified); GPOS_CHECK_ABORT; pexprSubqSimplified->Release(); - // (9) unnest AND/OR/NOT predicates + // (10) unnest AND/OR/NOT predicates CExpression *pexprUnnested = CExpressionUtils::PexprUnnest(mp, pexprSubqUnnested); GPOS_CHECK_ABORT; @@ -3127,128 +3343,128 @@ CExpressionPreprocessor::PexprPreprocess( // inefficient! Disable for noe. if (GPOS_FTRACE(EopttraceArrayConstraints) && false) { - // (9.5) ensure predicates are array IN or NOT IN where applicable + // (10.5) ensure predicates are array IN or NOT IN where applicable pexprConvert2In = PexprConvert2In(mp, pexprUnnested); GPOS_CHECK_ABORT; pexprUnnested->Release(); } - // (10) infer predicates from constraints + // (11) infer predicates from constraints CExpression *pexprInferredPreds = PexprInferPredicates(mp, pexprConvert2In); GPOS_CHECK_ABORT; pexprConvert2In->Release(); - // (11) eliminate self comparisons + // (12) eliminate self comparisons CExpression *pexprSelfCompEliminated = PexprEliminateSelfComparison( mp, pexprInferredPreds, pexprInferredPreds->DeriveNotNullColumns()); GPOS_CHECK_ABORT; pexprInferredPreds->Release(); - // (12) remove duplicate AND/OR children + // (13) remove duplicate AND/OR children CExpression *pexprDeduped = CExpressionUtils::PexprDedupChildren(mp, pexprSelfCompEliminated); GPOS_CHECK_ABORT; pexprSelfCompEliminated->Release(); - // (13) factorize common expressions + // (14) factorize common expressions CExpression *pexprFactorized = CExpressionFactorizer::PexprFactorize(mp, pexprDeduped); GPOS_CHECK_ABORT; pexprDeduped->Release(); - // (14) infer filters out of components of disjunctive filters + // (15) infer filters out of components of disjunctive filters CExpression *pexprPrefiltersExtracted = CExpressionFactorizer::PexprExtractInferredFilters(mp, pexprFactorized); GPOS_CHECK_ABORT; pexprFactorized->Release(); - // (15) pre-process ordered agg functions + // (16) pre-process ordered agg functions CExpression *pexprOrderedAggPreprocessed = COrderedAggPreprocessor::PexprPreprocess(mp, pexprPrefiltersExtracted); GPOS_CHECK_ABORT; pexprPrefiltersExtracted->Release(); - // (16) pre-process window functions + // (17) pre-process window functions CExpression *pexprWindowPreprocessed = CWindowPreprocessor::PexprPreprocess(mp, pexprOrderedAggPreprocessed); GPOS_CHECK_ABORT; pexprOrderedAggPreprocessed->Release(); - // (17) eliminate unused computed columns + // (18) eliminate unused computed columns CExpression *pexprNoUnusedPrEl = PexprPruneUnusedComputedCols( mp, pexprWindowPreprocessed, pcrsOutputAndOrderCols); GPOS_CHECK_ABORT; pexprWindowPreprocessed->Release(); - // (18) normalize expression + // (19) normalize expression CExpression *pexprNormalized1 = CNormalizer::PexprNormalize(mp, pexprNoUnusedPrEl); GPOS_CHECK_ABORT; pexprNoUnusedPrEl->Release(); - // (19) transform outer join into inner join whenever possible + // (20) transform outer join into inner join whenever possible CExpression *pexprLOJToIJ = PexprOuterJoinToInnerJoin(mp, pexprNormalized1); GPOS_CHECK_ABORT; pexprNormalized1->Release(); - // (20) collapse cascaded inner and left outer joins + // (21) collapse cascaded inner and left outer joins CExpression *pexprCollapsed = PexprCollapseJoins(mp, pexprLOJToIJ); GPOS_CHECK_ABORT; pexprLOJToIJ->Release(); - // (21) after transforming outer joins to inner joins, we may be able to generate more predicates from constraints + // (22) after transforming outer joins to inner joins, we may be able to generate more predicates from constraints CExpression *pexprWithPreds = PexprAddPredicatesFromConstraints(mp, pexprCollapsed); GPOS_CHECK_ABORT; pexprCollapsed->Release(); - // (22) eliminate empty subtrees + // (23) eliminate empty subtrees CExpression *pexprPruned = PexprPruneEmptySubtrees(mp, pexprWithPreds); GPOS_CHECK_ABORT; pexprWithPreds->Release(); - // (23) collapse cascade of projects + // (24) collapse cascade of projects CExpression *pexprCollapsedProjects = PexprCollapseProjects(mp, pexprPruned); GPOS_CHECK_ABORT; pexprPruned->Release(); - // (24) insert dummy project when the scalar subquery is under a project and returns an outer reference + // (25) insert dummy project when the scalar subquery is under a project and returns an outer reference CExpression *pexprSubquery = PexprProjBelowSubquery( mp, pexprCollapsedProjects, false /* fUnderPrList */); GPOS_CHECK_ABORT; pexprCollapsedProjects->Release(); - // (25) reorder the children of scalar cmp operator to ensure that left child is scalar ident and right child is scalar const + // (26) reorder the children of scalar cmp operator to ensure that left child is scalar ident and right child is scalar const CExpression *pexrReorderedScalarCmpChildren = PexprReorderScalarCmpChildren(mp, pexprSubquery); GPOS_CHECK_ABORT; pexprSubquery->Release(); - // (26) rewrite IN subquery to EXIST subquery with a predicate + // (27) rewrite IN subquery to EXIST subquery with a predicate CExpression *pexprExistWithPredFromINSubq = PexprExistWithPredFromINSubq(mp, pexrReorderedScalarCmpChildren); GPOS_CHECK_ABORT; pexrReorderedScalarCmpChildren->Release(); - // (27) prune partitions + // (28) prune partitions CExpression *pexprPrunedPartitions = PrunePartitions(mp, pexprExistWithPredFromINSubq); GPOS_CHECK_ABORT; pexprExistWithPredFromINSubq->Release(); - // (28) swap logical select over logical project + // (29) swap logical select over logical project CExpression *pexprTransposeSelectAndProject = PexprTransposeSelectAndProject(mp, pexprPrunedPartitions); pexprPrunedPartitions->Release(); - // (29) convert split update to inplace update + // (30) convert split update to inplace update CExpression *pexprSplitUpdateToInplace = ConvertSplitUpdateToInPlaceUpdate(mp, pexprTransposeSelectAndProject); GPOS_CHECK_ABORT; pexprTransposeSelectAndProject->Release(); - // (30) normalize expression again + // (31) normalize expression again CExpression *pexprNormalized2 = CNormalizer::PexprNormalize(mp, pexprSplitUpdateToInplace); GPOS_CHECK_ABORT; diff --git a/src/backend/gporca/libgpopt/src/operators/CLogical.cpp b/src/backend/gporca/libgpopt/src/operators/CLogical.cpp index f4885b1a7c7..87236da3b77 100644 --- a/src/backend/gporca/libgpopt/src/operators/CLogical.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CLogical.cpp @@ -1214,28 +1214,6 @@ CLogical::PstatsDeriveDummy(CMemoryPool *mp, CExpressionHandle &exprhdl, return stats; } -//--------------------------------------------------------------------------- -// @function: -// CLogical::PexprPartPred -// -// @doc: -// Compute partition predicate to pass down to n-th child -// -//--------------------------------------------------------------------------- -CExpression * -CLogical::PexprPartPred(CMemoryPool *, //mp, - CExpressionHandle &, //exprhdl, - CExpression *, //pexprInput, - ULONG //child_index -) const -{ - GPOS_CHECK_ABORT; - - // the default behavior is to never pass down any partition predicates - return nullptr; -} - - //--------------------------------------------------------------------------- // @function: // CLogical::PdpCreate diff --git a/src/backend/gporca/libgpopt/src/operators/CLogicalDynamicGet.cpp b/src/backend/gporca/libgpopt/src/operators/CLogicalDynamicGet.cpp index 5a4fe703b61..f0045993dd9 100644 --- a/src/backend/gporca/libgpopt/src/operators/CLogicalDynamicGet.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CLogicalDynamicGet.cpp @@ -266,10 +266,12 @@ CLogicalDynamicGet::PstatsDerive(CMemoryPool *mp, CExpressionHandle &exprhdl, IStatisticsArray * // not used ) const { - CReqdPropRelational *prprel = - CReqdPropRelational::GetReqdRelationalProps(exprhdl.Prp()); - IStatistics *stats = - PstatsDeriveFilter(mp, exprhdl, prprel->PexprPartPred()); + CExpression *expr = nullptr; + if (m_partition_cnstrs_disj) + { + expr = m_partition_cnstrs_disj->PexprScalar(mp); + } + IStatistics *stats = PstatsDeriveFilter(mp, exprhdl, expr); CColRefSet *pcrs = GPOS_NEW(mp) CColRefSet(mp, m_pdrgpcrOutput); CUpperBoundNDVs *upper_bound_NDVs = diff --git a/src/backend/gporca/libgpopt/src/operators/CLogicalSelect.cpp b/src/backend/gporca/libgpopt/src/operators/CLogicalSelect.cpp index 2516be9717f..91945beab6d 100644 --- a/src/backend/gporca/libgpopt/src/operators/CLogicalSelect.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CLogicalSelect.cpp @@ -178,88 +178,4 @@ CLogicalSelect::PstatsDerive(CMemoryPool *mp, CExpressionHandle &exprhdl, return stats; } -// compute partition predicate to pass down to n-th child. -// given an input scalar expression, find out the predicate -// in the scalar expression which is used for partitioning -// -// clang-format off -// Input Expr: -// +--CScalarBoolOp (EboolopAnd) -// |--CScalarArrayCmp Any (=) -// | |--CScalarIdent "risk_set_row_id" (2) -// | +--CScalarArray: {eleMDId: (23,1.0), arrayMDId: (1007,1.0) CScalarConst (32) CScalarConst (33) CScalarConst (43) CScalarConst (9) CScalarConst (10) CScalarConst (15) CScalarConst (16) CScalarConst (36) CScalarConst (11) CScalarConst (50) CScalarConst (46) CScalarConst (356) CScalarConst (468) CScalarConst (42)} -// +--CScalarCmp (=) -// |--CScalarIdent "value_date" (0) -// +--CScalarConst (559094400000000.000) -// -// Let's say the partition key is on value_date, then the extracted -// predicate is as below: -// Output Expr: -// +--CScalarCmp (=) -// |--CScalarIdent "value_date" (0) -// +--CScalarConst (559094400000000.000) -// clang-format on -CExpression * -CLogicalSelect::PexprPartPred(CMemoryPool *mp, CExpressionHandle &exprhdl, - CExpression *, //pexprInput - ULONG -#ifdef GPOS_DEBUG - child_index -#endif //GPOS_DEBUG -) const -{ - GPOS_ASSERT(0 == child_index); - - CExpression *pexprScalar = exprhdl.PexprScalarExactChild(1 /*child_index*/); - - if (nullptr == pexprScalar) - { - // no exact predicate is available (e.g. when we have a subquery in the predicate) - return nullptr; - } - - // get partition keys - CPartInfo *ppartinfo = exprhdl.DerivePartitionInfo(); - GPOS_ASSERT(nullptr != ppartinfo); - - // we assume that the select is right on top of the dynamic get, so there - // should be only one part consumer. If there is more, then we are higher up so - // we do not push down any predicates - if (1 != ppartinfo->UlConsumers()) - { - return nullptr; - } - - // check if a corresponding predicate has already been cached - CExpression *pexprPredOnPartKey = m_phmPexprPartPred->Find(pexprScalar); - if (pexprPredOnPartKey != nullptr) - { - // predicate on partition key found in cache - pexprPredOnPartKey->AddRef(); - return pexprPredOnPartKey; - } - - CPartKeysArray *pdrgppartkeys = ppartinfo->Pdrgppartkeys(0 /*ulPos*/); - const ULONG ulKeySets = pdrgppartkeys->Size(); - for (ULONG ul = 0; nullptr == pexprPredOnPartKey && ul < ulKeySets; ul++) - { - pexprPredOnPartKey = CPredicateUtils::PexprExtractPredicatesOnPartKeys( - mp, pexprScalar, (*pdrgppartkeys)[ul]->Pdrgpdrgpcr(), - nullptr, //pcrsAllowedRefs - true //fUseConstraints - ); - } - - if (pexprPredOnPartKey != nullptr) - { - // insert the scalar expression and the corresponding partitioning predicate - // in the hashmap - pexprPredOnPartKey->AddRef(); - pexprScalar->AddRef(); - m_phmPexprPartPred->Insert(pexprScalar, pexprPredOnPartKey); - } - - return pexprPredOnPartKey; -} - // EOF diff --git a/src/backend/gporca/libgpopt/src/operators/CPhysicalAgg.cpp b/src/backend/gporca/libgpopt/src/operators/CPhysicalAgg.cpp index b1ff9fdee9c..26331d55753 100644 --- a/src/backend/gporca/libgpopt/src/operators/CPhysicalAgg.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CPhysicalAgg.cpp @@ -392,17 +392,14 @@ CPhysicalAgg::PrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl, { GPOS_ASSERT(0 == child_index); - CRewindabilitySpec *prsChild = - PrsPassThru(mp, exprhdl, prsRequired, child_index); if (prsRequired->IsOriginNLJoin()) { - CRewindabilitySpec *prs = GPOS_NEW(mp) - CRewindabilitySpec(CRewindabilitySpec::ErtNone, prsChild->Emht()); - prsChild->Release(); + CRewindabilitySpec *prs = GPOS_NEW(mp) CRewindabilitySpec( + CRewindabilitySpec::ErtNone, prsRequired->Emht()); return prs; } - return prsChild; + return PrsPassThru(mp, exprhdl, prsRequired, child_index); } //--------------------------------------------------------------------------- diff --git a/src/backend/gporca/libgpopt/src/operators/CPhysicalComputeScalar.cpp b/src/backend/gporca/libgpopt/src/operators/CPhysicalComputeScalar.cpp index 39187afbffc..c5b71ce6c6d 100644 --- a/src/backend/gporca/libgpopt/src/operators/CPhysicalComputeScalar.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CPhysicalComputeScalar.cpp @@ -261,7 +261,12 @@ CPhysicalComputeScalar::PrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl, ) const { GPOS_ASSERT(0 == child_index); - + if (prsRequired->IsOriginNLJoin()) + { + CRewindabilitySpec *prs = GPOS_NEW(mp) CRewindabilitySpec( + CRewindabilitySpec::ErtNone, prsRequired->Emht()); + return prs; + } return PrsPassThru(mp, exprhdl, prsRequired, child_index); } @@ -454,6 +459,11 @@ CEnfdProp::EPropEnforcingType CPhysicalComputeScalar::EpetRewindability(CExpressionHandle &exprhdl, const CEnfdRewindability *per) const { + if (per->PrsRequired()->IsOriginNLJoin()) + { + return CEnfdProp::EpetRequired; + } + CColRefSet *pcrsUsed = exprhdl.DeriveUsedColumns(1); CColRefSet *pcrsCorrelatedApply = exprhdl.DeriveCorrelatedApplyColumns(); if (!pcrsUsed->IsDisjoint(pcrsCorrelatedApply)) diff --git a/src/backend/gporca/libgpopt/src/operators/CPhysicalFilter.cpp b/src/backend/gporca/libgpopt/src/operators/CPhysicalFilter.cpp index 6f429585a76..b50aeacdd72 100644 --- a/src/backend/gporca/libgpopt/src/operators/CPhysicalFilter.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CPhysicalFilter.cpp @@ -144,7 +144,12 @@ CPhysicalFilter::PrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl, ) const { GPOS_ASSERT(0 == child_index); - + if (prsRequired->IsOriginNLJoin()) + { + CRewindabilitySpec *prs = GPOS_NEW(mp) CRewindabilitySpec( + CRewindabilitySpec::ErtNone, prsRequired->Emht()); + return prs; + } return PrsPassThru(mp, exprhdl, prsRequired, child_index); } @@ -373,6 +378,11 @@ CEnfdProp::EPropEnforcingType CPhysicalFilter::EpetRewindability(CExpressionHandle &exprhdl, const CEnfdRewindability *per) const { + if (per->PrsRequired()->IsOriginNLJoin()) + { + return CEnfdProp::EpetRequired; + } + // get rewindability delivered by the Filter node CRewindabilitySpec *prs = CDrvdPropPlan::Pdpplan(exprhdl.Pdp())->Prs(); if (per->FCompatible(prs)) diff --git a/src/backend/gporca/libgpopt/src/operators/CPhysicalNLJoin.cpp b/src/backend/gporca/libgpopt/src/operators/CPhysicalNLJoin.cpp index a6d0c95f4d4..9b7c5bdfbb3 100644 --- a/src/backend/gporca/libgpopt/src/operators/CPhysicalNLJoin.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CPhysicalNLJoin.cpp @@ -109,9 +109,11 @@ CPhysicalNLJoin::PrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl, { if (FFirstChildToOptimize(child_index)) { - // for index nested loop joins, inner child is optimized first + // for index nested loop joins, inner child is optimized first. + // we should not force materialize inner child, as we use index + // on inner relation and reference variables from outer relation. return GPOS_NEW(mp) CRewindabilitySpec( - CRewindabilitySpec::ErtRewindable, prsRequired->Emht(), true); + CRewindabilitySpec::ErtRewindable, prsRequired->Emht(), false); } CRewindabilitySpec *prsOuter = diff --git a/src/backend/gporca/libgpopt/src/operators/CPredicateUtils.cpp b/src/backend/gporca/libgpopt/src/operators/CPredicateUtils.cpp index b975940110d..5910691f312 100644 --- a/src/backend/gporca/libgpopt/src/operators/CPredicateUtils.cpp +++ b/src/backend/gporca/libgpopt/src/operators/CPredicateUtils.cpp @@ -153,28 +153,6 @@ CPredicateUtils::FComparison( return false; } -// Is the given expression a range comparison only between the given column and -// an expression involving only the allowed columns. If the allowed columns set -// is NULL, then we only want constant comparisons. -// Also, the comparison type must be one of: LT, GT, LEq, GEq, Eq -// NEq is allowed only when requested by the caller -BOOL -CPredicateUtils::FRangeComparison( - CExpression *pexpr, CColRef *colref, - CColRefSet - *pcrsAllowedRefs, // other column references allowed in the comparison - BOOL allowNotEqualPreds) -{ - if (!FComparison(pexpr, colref, pcrsAllowedRefs)) - { - return false; - } - IMDType::ECmpType cmp_type = - CScalarCmp::PopConvert(pexpr->Pop())->ParseCmpType(); - return (IMDType::EcmptOther != cmp_type && - (allowNotEqualPreds || IMDType::EcmptNEq != cmp_type)); -} - BOOL CPredicateUtils::FIdentCompareOuterRefExprIgnoreCast( CExpression *pexpr, @@ -1018,6 +996,17 @@ CPredicateUtils::PexprINDFConjunction(CMemoryPool *mp, // is the given expression a comparison between a scalar ident and a constant BOOL CPredicateUtils::FCompareIdentToConst(CExpression *pexpr) +{ + CExpression *pexprIdent; + CExpression *pexprConst; + + return FCompareIdentToConst(pexpr, pexprIdent, pexprConst); +} + +BOOL +CPredicateUtils::FCompareIdentToConst(CExpression *pexpr, + CExpression *&pexprIdent, + CExpression *&pexprConst) { COperator *pop = pexpr->Pop(); @@ -1029,22 +1018,29 @@ CPredicateUtils::FCompareIdentToConst(CExpression *pexpr) CExpression *pexprLeft = (*pexpr)[0]; CExpression *pexprRight = (*pexpr)[1]; - // left side must be scalar ident - - if (!(CUtils::FScalarIdent(pexprLeft) || - CCastUtils::FBinaryCoercibleCastedScId(pexprLeft))) + // if left side scalar ident then right side must be a const + if ((CUtils::FScalarIdent(pexprLeft) || + CCastUtils::FBinaryCoercibleCastedScId(pexprLeft)) && + (CUtils::FScalarConst(pexprRight) || + CCastUtils::FBinaryCoercibleCastedConst(pexprRight))) { - return false; + pexprIdent = pexprLeft; + pexprConst = pexprRight; + return true; } - // right side must be a constant - if (!(CUtils::FScalarConst(pexprRight) || - CCastUtils::FBinaryCoercibleCastedConst(pexprRight))) + // if right side scalar ident then left side must be a const + if ((CUtils::FScalarIdent(pexprRight) || + CCastUtils::FBinaryCoercibleCastedScId(pexprRight)) && + (CUtils::FScalarConst(pexprLeft) || + CCastUtils::FBinaryCoercibleCastedConst(pexprLeft))) { - return false; + pexprIdent = pexprRight; + pexprConst = pexprLeft; + return true; } - return true; + return false; } // is the given expression of the form (col IS DISTINCT FROM const) @@ -1350,6 +1346,7 @@ CPredicateUtils::PexprPartPruningPredicate( CExpression *pexprCol, // predicate on pcrPartKey obtained from pcnstr CColRefSet *pcrsAllowedRefs, BOOL allow_not_equals_preds) { + GPOS_ASSERT(nullptr != pcrsAllowedRefs); CExpressionArray *pdrgpexprResult = GPOS_NEW(mp) CExpressionArray(mp); // Assert that pexprCol is an expr on pcrPartKey only and no other colref @@ -1361,45 +1358,17 @@ CPredicateUtils::PexprPartPruningPredicate( { CExpression *pexpr = (*pdrgpexpr)[ul]; - if (nullptr != pcrsAllowedRefs) - { - CExpression *canonical_expr = ValidatePartPruningExpr( - mp, pexpr, pcrPartKey, pcrsAllowedRefs, allow_not_equals_preds); - - if (nullptr != canonical_expr) - { - pdrgpexprResult->Append(canonical_expr); - } + CExpression *canonical_expr = ValidatePartPruningExpr( + mp, pexpr, pcrPartKey, pcrsAllowedRefs, allow_not_equals_preds); - // pexprCol contains a predicate only on partKey, which is useless for - // dynamic partition selection, so ignore it here - pexprCol = nullptr; - } - else + if (nullptr != canonical_expr) { - // This may look like dead code, but it is actually used in - // CLogicalSelect::PexprPredPart(). - // GPDB_12_MERGE_FIXME: Remove this & CLogicalSelect::PexprPredPart() - - // (NULL == pcrsAllowedRefs) implies static partition elimination, since - // the expressions we select can only contain the partition key - // If EopttraceAllowGeneralPredicatesforDPE is set, allow a larger set - // of partition predicates for DPE as well (see note above). - - if (FBoolPredicateOnColumn(pexpr, pcrPartKey) || - FNullCheckOnColumn(pexpr, pcrPartKey) || - IsDisjunctionOfRangeComparison(mp, pexpr, pcrPartKey, - pcrsAllowedRefs, - allow_not_equals_preds) || - (FRangeComparison(pexpr, pcrPartKey, pcrsAllowedRefs, - allow_not_equals_preds) && - !pexpr->DeriveScalarFunctionProperties() - ->NeedsSingletonExecution())) - { - pexpr->AddRef(); - pdrgpexprResult->Append(pexpr); - } + pdrgpexprResult->Append(canonical_expr); } + + // pexprCol contains a predicate only on partKey, which is useless for + // dynamic partition selection, so ignore it here + pexprCol = nullptr; } // Remove any redundant "IS NOT NULL" filter on the partition key that was derived @@ -1553,37 +1522,6 @@ CPredicateUtils::FScArrayCmpOnColumn(CExpression *pexpr, CColRef *colref, return fSupported; } -// check if the given expression is a disjunction of scalar cmp expression -// on the given column -BOOL -CPredicateUtils::IsDisjunctionOfRangeComparison(CMemoryPool *mp, - CExpression *pexpr, - CColRef *colref, - CColRefSet *pcrsAllowedRefs, - BOOL allowNotEqualPreds) -{ - if (!FOr(pexpr)) - { - return false; - } - - CExpressionArray *pdrgpexprDisjuncts = PdrgpexprDisjuncts(mp, pexpr); - const ULONG ulDisjuncts = pdrgpexprDisjuncts->Size(); - for (ULONG ulDisj = 0; ulDisj < ulDisjuncts; ulDisj++) - { - CExpression *pexprDisj = (*pdrgpexprDisjuncts)[ulDisj]; - if (!FRangeComparison(pexprDisj, colref, pcrsAllowedRefs, - allowNotEqualPreds)) - { - pdrgpexprDisjuncts->Release(); - return false; - } - } - - pdrgpexprDisjuncts->Release(); - return true; -} - // extract interesting expressions involving the partitioning keys; // the function Add-Refs the returned copy if not null. Relevant predicates // are those that compare the partition keys to expressions involving only diff --git a/src/backend/gporca/libgpopt/src/translate/CTranslatorDXLToExpr.cpp b/src/backend/gporca/libgpopt/src/translate/CTranslatorDXLToExpr.cpp index 861f4dccb94..92f446d2853 100644 --- a/src/backend/gporca/libgpopt/src/translate/CTranslatorDXLToExpr.cpp +++ b/src/backend/gporca/libgpopt/src/translate/CTranslatorDXLToExpr.cpp @@ -2120,7 +2120,7 @@ CTranslatorDXLToExpr::Ptabdesc(CDXLTableDescr *table_descr) CTableDescriptor *ptabdesc = GPOS_NEW(m_mp) CTableDescriptor( m_mp, mdid, CName(m_mp, &strName), pmdrel->ConvertHashToRandom(), rel_distr_policy, rel_storage_type, table_descr->GetExecuteAsUserId(), - table_descr->LockMode()); + table_descr->LockMode(), table_descr->GetAssignedQueryIdForTargetRel()); const ULONG ulColumns = table_descr->Arity(); for (ULONG ul = 0; ul < ulColumns; ul++) @@ -2318,9 +2318,9 @@ CTranslatorDXLToExpr::PtabdescFromCTAS(CDXLLogicalCTAS *pdxlopCTAS) CTableDescriptor *ptabdesc = GPOS_NEW(m_mp) CTableDescriptor( m_mp, mdid, CName(m_mp, &strName), pmdrel->ConvertHashToRandom(), rel_distr_policy, rel_storage_type, - 0, // TODO: - Mar 5, 2014; ulExecuteAsUser - -1 // GPDB_12_MERGE_FIXME: Extract the lockmode from CTE - ); + 0, // ulExecuteAsUser, use permissions of current user + 3, // CTEs always use a RowExclusiveLock on the table. See createas.c + UNASSIGNED_QUERYID); // populate column information from the dxl table descriptor CDXLColDescrArray *dxl_col_descr_array = diff --git a/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXL.cpp b/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXL.cpp index 382e8fae823..c129b04b262 100644 --- a/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXL.cpp +++ b/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXL.cpp @@ -157,9 +157,6 @@ #include "naucrates/dxl/operators/CDXLScalarOneTimeFilter.h" #include "naucrates/dxl/operators/CDXLScalarOpExpr.h" #include "naucrates/dxl/operators/CDXLScalarOpList.h" -#include "naucrates/dxl/operators/CDXLScalarPartBound.h" -#include "naucrates/dxl/operators/CDXLScalarPartDefault.h" -#include "naucrates/dxl/operators/CDXLScalarPartListNullTest.h" #include "naucrates/dxl/operators/CDXLScalarProjElem.h" #include "naucrates/dxl/operators/CDXLScalarProjList.h" #include "naucrates/dxl/operators/CDXLScalarRecheckCondFilter.h" @@ -1250,7 +1247,8 @@ CTranslatorExprToDXL::MakeTableDescForPart(const IMDRelation *part, m_mp, part_mdid, part->Mdname().GetMDName(), part->ConvertHashToRandom(), part->GetRelDistribution(), part->RetrieveRelStorageType(), root_table_desc->GetExecuteAsUserId(), - root_table_desc->LockMode()); + root_table_desc->LockMode(), + root_table_desc->GetAssignedQueryIdForTargetRel()); for (ULONG ul = 0; ul < part->ColumnCount(); ++ul) { @@ -1360,7 +1358,7 @@ CTranslatorExprToDXL::PdxlnDynamicTableScan( { const CBitSet *bs = pps_reqd->SelectorIds(popDTS->ScanId()); CBitSetIter bsi(*bs); - for (ULONG ul = 0; bsi.Advance(); ul++) + while (bsi.Advance()) { selector_ids->Append(GPOS_NEW(m_mp) ULONG(bsi.Bit())); } @@ -1460,7 +1458,7 @@ CTranslatorExprToDXL::PdxlnDynamicBitmapTableScan( { const CBitSet *bs = pps_reqd->SelectorIds(pop->ScanId()); CBitSetIter bsi(*bs); - for (ULONG ul = 0; bsi.Advance(); ul++) + while (bsi.Advance()) { selector_ids->Append(GPOS_NEW(m_mp) ULONG(bsi.Bit())); } @@ -1563,7 +1561,7 @@ CTranslatorExprToDXL::PdxlnDynamicIndexScan( { const CBitSet *bs = pps_reqd->SelectorIds(popDIS->ScanId()); CBitSetIter bsi(*bs); - for (ULONG ul = 0; bsi.Advance(); ul++) + while (bsi.Advance()) { selector_ids->Append(GPOS_NEW(m_mp) ULONG(bsi.Bit())); } @@ -4826,7 +4824,7 @@ CTranslatorExprToDXL::PdxlnPartitionSelector( GPOS_ASSERT(nullptr != bs); ULongPtrArray *parts = GPOS_NEW(m_mp) ULongPtrArray(m_mp); CBitSetIter bsi(*bs); - for (ULONG ul = 0; bsi.Advance(); ul++) + while (bsi.Advance()) { parts->Append(GPOS_NEW(m_mp) ULONG(bsi.Bit())); } @@ -6581,9 +6579,9 @@ CTranslatorExprToDXL::MakeDXLTableDescr( CMDIdGPDB *mdid = CMDIdGPDB::CastMdid(ptabdesc->MDId()); mdid->AddRef(); - CDXLTableDescr *table_descr = GPOS_NEW(m_mp) - CDXLTableDescr(m_mp, mdid, pmdnameTbl, ptabdesc->GetExecuteAsUserId(), - ptabdesc->LockMode()); + CDXLTableDescr *table_descr = GPOS_NEW(m_mp) CDXLTableDescr( + m_mp, mdid, pmdnameTbl, ptabdesc->GetExecuteAsUserId(), + ptabdesc->LockMode(), ptabdesc->GetAssignedQueryIdForTargetRel()); const ULONG ulColumns = ptabdesc->ColumnCount(); // translate col descriptors diff --git a/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp b/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp index 373769580ea..27f5cb688fe 100644 --- a/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp +++ b/src/backend/gporca/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp @@ -36,11 +36,6 @@ #include "naucrates/dxl/operators/CDXLScalarArrayComp.h" #include "naucrates/dxl/operators/CDXLScalarCast.h" #include "naucrates/dxl/operators/CDXLScalarIdent.h" -#include "naucrates/dxl/operators/CDXLScalarPartBound.h" -#include "naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h" -#include "naucrates/dxl/operators/CDXLScalarPartBoundOpen.h" -#include "naucrates/dxl/operators/CDXLScalarPartDefault.h" -#include "naucrates/dxl/operators/CDXLScalarPartListValues.h" #include "naucrates/dxl/operators/CDXLScalarProjElem.h" #include "naucrates/dxl/operators/CDXLScalarProjList.h" #include "naucrates/dxl/operators/CDXLScalarValuesList.h" @@ -58,417 +53,6 @@ using namespace gpdxl; using namespace gpopt; using namespace gpnaucrates; -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnInt4Const -// -// @doc: -// Construct a scalar const value expression for the given INT value -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnInt4Const(CMemoryPool *mp, - CMDAccessor *md_accessor, INT val) -{ - GPOS_ASSERT(nullptr != mp); - - const IMDTypeInt4 *pmdtypeint4 = md_accessor->PtMDType(); - pmdtypeint4->MDId()->AddRef(); - - CDXLDatumInt4 *dxl_datum = GPOS_NEW(mp) - CDXLDatumInt4(mp, pmdtypeint4->MDId(), false /*is_null*/, val); - CDXLScalarConstValue *pdxlConst = - GPOS_NEW(mp) CDXLScalarConstValue(mp, dxl_datum); - - return GPOS_NEW(mp) CDXLNode(mp, pdxlConst); -} - -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnBoolConst -// -// @doc: -// Construct a scalar const value expression for the given BOOL value -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnBoolConst(CMemoryPool *mp, - CMDAccessor *md_accessor, BOOL value) -{ - GPOS_ASSERT(nullptr != mp); - - const IMDTypeBool *pmdtype = md_accessor->PtMDType(); - pmdtype->MDId()->AddRef(); - - CDXLDatumBool *dxl_datum = GPOS_NEW(mp) - CDXLDatumBool(mp, pmdtype->MDId(), false /*is_null*/, value); - CDXLScalarConstValue *pdxlConst = - GPOS_NEW(mp) CDXLScalarConstValue(mp, dxl_datum); - - return GPOS_NEW(mp) CDXLNode(mp, pdxlConst); -} - - - -// construct a DXL node for the part key portion of the list partition filter -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnListFilterPartKey(CMemoryPool *mp, - CMDAccessor *md_accessor, - CExpression *pexprPartKey, - IMDId *pmdidTypePartKey, - ULONG ulPartLevel) -{ - GPOS_ASSERT(nullptr != pexprPartKey); - GPOS_ASSERT(nullptr != pmdidTypePartKey); - GPOS_ASSERT(CScalar::PopConvert(pexprPartKey->Pop()) - ->MdidType() - ->Equals(pmdidTypePartKey)); - - CDXLNode *pdxlnPartKey = nullptr; - - if (CUtils::FScalarIdent(pexprPartKey)) - { - // Simple Scalar Ident - create a ScalarPartListValues from the partition key - IMDId *pmdidResultArray = - md_accessor->RetrieveType(pmdidTypePartKey)->GetArrayTypeMdid(); - pmdidResultArray->AddRef(); - pmdidTypePartKey->AddRef(); - - pdxlnPartKey = GPOS_NEW(mp) CDXLNode( - mp, GPOS_NEW(mp) CDXLScalarPartListValues( - mp, ulPartLevel, pmdidResultArray, pmdidTypePartKey)); - } - else if (CScalarIdent::FCastedScId(pexprPartKey) || - CScalarIdent::FAllowedFuncScId(pexprPartKey)) - { - IMDId *pmdidDestElem = nullptr; - IMDId *pmdidArrayCastFunc = nullptr; - ExtractCastFuncMdids(pexprPartKey->Pop(), &pmdidDestElem, - &pmdidArrayCastFunc); - IMDId *pmdidDestArray = - md_accessor->RetrieveType(pmdidDestElem)->GetArrayTypeMdid(); - - CScalarIdent *pexprScalarIdent = - CScalarIdent::PopConvert((*pexprPartKey)[0]->Pop()); - IMDId *pmdidSrcElem = pexprScalarIdent->MdidType(); - IMDId *pmdidSrcArray = - md_accessor->RetrieveType(pmdidSrcElem)->GetArrayTypeMdid(); - pmdidSrcArray->AddRef(); - pmdidSrcElem->AddRef(); - CDXLNode *pdxlnPartKeyIdent = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartListValues( - mp, ulPartLevel, pmdidSrcArray, pmdidSrcElem)); - - pmdidDestArray->AddRef(); - pmdidArrayCastFunc->AddRef(); - pdxlnPartKey = GPOS_NEW(mp) - CDXLNode(mp, - GPOS_NEW(mp) CDXLScalarArrayCoerceExpr( - mp, pmdidArrayCastFunc, pmdidDestArray, - default_type_modifier, true, /* is_explicit */ - EdxlcfDontCare, -1 /* location */ - ), - pdxlnPartKeyIdent); - } - else - { - // Not supported - should be unreachable. - CWStringDynamic *str = GPOS_NEW(mp) CWStringDynamic(mp); - str->AppendFormat( - GPOS_WSZ_LIT( - "Unsupported part filter operator for list partitions : %ls"), - pexprPartKey->Pop()->SzId()); - GPOS_THROW_EXCEPTION(gpopt::ExmaGPOPT, gpopt::ExmiUnsupportedOp, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != pdxlnPartKey); - - return pdxlnPartKey; -} - - -// Construct a predicate node for a list partition filter -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnListFilterScCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnPartKey, - CDXLNode *pdxlnOther, IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, - IMDType::ECmpType cmp_type, ULONG ulPartLevel, BOOL fHasDefaultPart) -{ - IMDId *pmdidScCmp = nullptr; - - pmdidScCmp = CMDAccessorUtils::GetScCmpMdIdConsiderCasts( - md_accessor, pmdidTypeOther, pmdidTypePartKey, cmp_type); - - const IMDScalarOp *md_scalar_op = md_accessor->RetrieveScOp(pmdidScCmp); - const CWStringConst *pstrScCmp = md_scalar_op->Mdname().GetMDName(); - - pmdidScCmp->AddRef(); - CDXLNode *pdxlnScCmp = GPOS_NEW(mp) - CDXLNode(mp, - GPOS_NEW(mp) CDXLScalarArrayComp( - mp, pmdidScCmp, - GPOS_NEW(mp) CWStringConst(mp, pstrScCmp->GetBuffer()), - Edxlarraycomptypeany), - pdxlnOther, pdxlnPartKey); - - if (fHasDefaultPart) - { - CDXLNode *pdxlnDefault = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartDefault(mp, ulPartLevel)); - return GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxlor), - pdxlnScCmp, pdxlnDefault); - } - else - { - return pdxlnScCmp; - } -} - -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnRangeFilterScCmp -// -// @doc: -// Construct a Result node for a filter min <= Scalar or max >= Scalar -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnRangeFilterScCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, IMDId *pmdidTypeCastExpr, - IMDId *mdid_cast_func, IMDType::ECmpType cmp_type, ULONG ulPartLevel) -{ - if (IMDType::EcmptEq == cmp_type) - { - return PdxlnRangeFilterEqCmp( - mp, md_accessor, pdxlnScalar, pmdidTypePartKey, pmdidTypeOther, - pmdidTypeCastExpr, mdid_cast_func, ulPartLevel); - } - - BOOL fLowerBound = false; - IMDType::ECmpType ecmptScCmp = IMDType::EcmptOther; - - if (IMDType::EcmptLEq == cmp_type || IMDType::EcmptL == cmp_type) - { - // partkey />= other: construct condition max > other - ecmptScCmp = IMDType::EcmptG; - } - else - { - GPOS_ASSERT(IMDType::EcmptNEq == cmp_type); - ecmptScCmp = IMDType::EcmptNEq; - } - - if (IMDType::EcmptLEq != cmp_type && IMDType::EcmptGEq != cmp_type) - { - // scalar comparison does not include equality: no need to consider part constraint boundaries - CDXLNode *pdxlnPredicateExclusive = - PdxlnCmp(mp, md_accessor, ulPartLevel, fLowerBound, pdxlnScalar, - ecmptScCmp, pmdidTypePartKey, pmdidTypeOther, - pmdidTypeCastExpr, mdid_cast_func); - return pdxlnPredicateExclusive; - // This is also correct for lossy casts. when we have predicate such as - // float::int < 2, we dont want to select values such as 1.7 which cast to 2. - // So, in this case, we should check lower bound::int < 2 - } - - CDXLNode *pdxlnInclusiveCmp = PdxlnCmp( - mp, md_accessor, ulPartLevel, fLowerBound, pdxlnScalar, cmp_type, - pmdidTypePartKey, pmdidTypeOther, pmdidTypeCastExpr, mdid_cast_func); - - if (nullptr != mdid_cast_func && mdid_cast_func->IsValid() && - md_accessor->RetrieveFunc(mdid_cast_func) - ->IsAllowedForPS()) // is a lossy cast - { - // In case of lossy casts, we don't want to eliminate partitions with - // exclusive ends when the predicate is on that end - // A partition such as [1,2) should be selected for float::int = 2, - // but shouldn't be selected for float = 2.0 - return pdxlnInclusiveCmp; - } - - pdxlnScalar->AddRef(); - CDXLNode *pdxlnPredicateExclusive = PdxlnCmp( - mp, md_accessor, ulPartLevel, fLowerBound, pdxlnScalar, ecmptScCmp, - pmdidTypePartKey, pmdidTypeOther, pmdidTypeCastExpr, mdid_cast_func); - - CDXLNode *pdxlnInclusiveBoolPredicate = - GPOS_NEW(mp) CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartBoundInclusion( - mp, ulPartLevel, fLowerBound)); - - CDXLNode *pdxlnPredicateInclusive = - GPOS_NEW(mp) CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxland), - pdxlnInclusiveCmp, pdxlnInclusiveBoolPredicate); - - // return the final predicate in the form "(point <= col and colIncluded) or point < col" / "(point >= col and colIncluded) or point > col" - return GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxlor), - pdxlnPredicateInclusive, pdxlnPredicateExclusive); -} - -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnRangeFilterEqCmp -// -// @doc: -// Construct a predicate node for a filter min <= Scalar and max >= Scalar -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnRangeFilterEqCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, IMDId *pmdidTypeCastExpr, - IMDId *mdid_cast_func, ULONG ulPartLevel) -{ - CDXLNode *pdxlnPredicateMin = PdxlnRangeFilterPartBound( - mp, md_accessor, pdxlnScalar, pmdidTypePartKey, pmdidTypeOther, - pmdidTypeCastExpr, mdid_cast_func, ulPartLevel, true /*fLowerBound*/, - IMDType::EcmptL); - pdxlnScalar->AddRef(); - CDXLNode *pdxlnPredicateMax = PdxlnRangeFilterPartBound( - mp, md_accessor, pdxlnScalar, pmdidTypePartKey, pmdidTypeOther, - pmdidTypeCastExpr, mdid_cast_func, ulPartLevel, false /*fLowerBound*/, - IMDType::EcmptG); - - // return the conjunction of the predicate for the lower and upper bounds - return GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxland), - pdxlnPredicateMin, pdxlnPredicateMax); -} - -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnRangeFilterPartBound -// -// @doc: -// Construct a predicate for a partition bound of one of the two forms -// (min <= Scalar and minincl) or min < Scalar -// (max >= Scalar and maxinc) or Max > Scalar -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnRangeFilterPartBound( - CMemoryPool *mp, CMDAccessor *md_accessor, CDXLNode *pdxlnScalar, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeOther, IMDId *pmdidTypeCastExpr, - IMDId *mdid_cast_func, ULONG ulPartLevel, ULONG fLowerBound, - IMDType::ECmpType cmp_type) -{ - GPOS_ASSERT(IMDType::EcmptL == cmp_type || IMDType::EcmptG == cmp_type); - - IMDType::ECmpType ecmptInc = IMDType::EcmptLEq; - if (IMDType::EcmptG == cmp_type) - { - ecmptInc = IMDType::EcmptGEq; - } - - CDXLNode *pdxlnInclusiveCmp = PdxlnCmp( - mp, md_accessor, ulPartLevel, fLowerBound, pdxlnScalar, ecmptInc, - pmdidTypePartKey, pmdidTypeOther, pmdidTypeCastExpr, mdid_cast_func); - - if (nullptr != mdid_cast_func && mdid_cast_func->IsValid() && - md_accessor->RetrieveFunc(mdid_cast_func) - ->IsAllowedForPS()) // is a lossy cast - { - // In case of lossy casts, we don't want to eliminate partitions with - // exclusive ends when the predicate is on that end - // A partition such as [1,2) should be selected for float::int = 2 - // but shouldn't be selected for float = 2.0 - return pdxlnInclusiveCmp; - } - - pdxlnScalar->AddRef(); - - CDXLNode *pdxlnPredicateExclusive = PdxlnCmp( - mp, md_accessor, ulPartLevel, fLowerBound, pdxlnScalar, cmp_type, - pmdidTypePartKey, pmdidTypeOther, pmdidTypeCastExpr, mdid_cast_func); - - CDXLNode *pdxlnInclusiveBoolPredicate = - GPOS_NEW(mp) CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartBoundInclusion( - mp, ulPartLevel, fLowerBound)); - - CDXLNode *pdxlnPredicateInclusive = - GPOS_NEW(mp) CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxland), - pdxlnInclusiveCmp, pdxlnInclusiveBoolPredicate); - - // return the final predicate in the form "(point <= col and colIncluded) or point < col" / "(point >= col and colIncluded) or point > col" - return GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxlor), - pdxlnPredicateInclusive, pdxlnPredicateExclusive); -} - - -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnRangeFilterDefaultAndOpenEnded -// -// @doc: -// Construct predicates to cover the cases of default partition and -// open-ended partitions if necessary -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnRangeFilterDefaultAndOpenEnded( - CMemoryPool *mp, ULONG ulPartLevel, BOOL fLTComparison, BOOL fGTComparison, - BOOL fEQComparison, BOOL fDefaultPart) -{ - CDXLNode *pdxlnResult = nullptr; - if (fLTComparison || fEQComparison) - { - // add a condition to cover the cases of open-ended interval (-inf, x) - pdxlnResult = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartBoundOpen( - mp, ulPartLevel, true /*is_lower_bound*/)); - } - - if (fGTComparison || fEQComparison) - { - // add a condition to cover the cases of open-ended interval (x, inf) - CDXLNode *pdxlnOpenMax = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartBoundOpen( - mp, ulPartLevel, false /*is_lower_bound*/)); - - // construct a boolean OR expression over the two expressions - if (nullptr != pdxlnResult) - { - pdxlnResult = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxlor), - pdxlnResult, pdxlnOpenMax); - } - else - { - pdxlnResult = pdxlnOpenMax; - } - } - - if (fDefaultPart) - { - // add a condition to cover the cases of default partition - CDXLNode *pdxlnDefault = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartDefault(mp, ulPartLevel)); - - if (nullptr != pdxlnResult) - { - pdxlnResult = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarBoolExpr(mp, Edxlor), - pdxlnDefault, pdxlnResult); - } - else - { - pdxlnResult = pdxlnDefault; - } - } - - return pdxlnResult; -} - //--------------------------------------------------------------------------- // @function: @@ -503,66 +87,6 @@ CTranslatorExprToDXLUtils::PdxlpropCopy(CMemoryPool *mp, CDXLNode *dxlnode) } -//--------------------------------------------------------------------------- -// @function: -// CTranslatorExprToDXLUtils::PdxlnCmp -// -// @doc: -// Construct a scalar comparison of the given type between the column with -// the given col id and the scalar expression -// -//--------------------------------------------------------------------------- -CDXLNode * -CTranslatorExprToDXLUtils::PdxlnCmp( - CMemoryPool *mp, CMDAccessor *md_accessor, ULONG ulPartLevel, - BOOL fLowerBound, CDXLNode *pdxlnScalar, IMDType::ECmpType cmp_type, - IMDId *pmdidTypePartKey, IMDId *pmdidTypeExpr, IMDId *pmdidTypeCastExpr, - IMDId *mdid_cast_func) -{ - IMDId *pmdidScCmp = nullptr; - - if (IMDId::IsValid(pmdidTypeCastExpr)) - { - pmdidScCmp = CMDAccessorUtils::GetScCmpMdIdConsiderCasts( - md_accessor, pmdidTypeCastExpr, pmdidTypeExpr, cmp_type); - } - else - { - pmdidScCmp = CMDAccessorUtils::GetScCmpMdIdConsiderCasts( - md_accessor, pmdidTypePartKey, pmdidTypeExpr, cmp_type); - } - - const IMDScalarOp *md_scalar_op = md_accessor->RetrieveScOp(pmdidScCmp); - const CWStringConst *pstrScCmp = md_scalar_op->Mdname().GetMDName(); - - pmdidScCmp->AddRef(); - - CDXLScalarComp *pdxlopCmp = GPOS_NEW(mp) CDXLScalarComp( - mp, pmdidScCmp, GPOS_NEW(mp) CWStringConst(mp, pstrScCmp->GetBuffer())); - CDXLNode *pdxlnScCmp = GPOS_NEW(mp) CDXLNode(mp, pdxlopCmp); - - pmdidTypePartKey->AddRef(); - CDXLNode *pdxlnPartBound = GPOS_NEW(mp) - CDXLNode(mp, GPOS_NEW(mp) CDXLScalarPartBound( - mp, ulPartLevel, pmdidTypePartKey, fLowerBound)); - - if (IMDId::IsValid(pmdidTypeCastExpr)) - { - GPOS_ASSERT(nullptr != mdid_cast_func); - pmdidTypeCastExpr->AddRef(); - mdid_cast_func->AddRef(); - - pdxlnPartBound = GPOS_NEW(mp) CDXLNode( - mp, - GPOS_NEW(mp) CDXLScalarCast(mp, pmdidTypeCastExpr, mdid_cast_func), - pdxlnPartBound); - } - pdxlnScCmp->AddChild(pdxlnPartBound); - pdxlnScCmp->AddChild(pdxlnScalar); - - return pdxlnScCmp; -} - //--------------------------------------------------------------------------- // @function: // CTranslatorExprToDXLUtils::PcrCreate @@ -1234,25 +758,64 @@ CTranslatorExprToDXLUtils::SetDirectDispatchInfo( // |--CScalarIdent "non_dist_key" // +--CScalarConst (5) - if (CDistributionSpec::EdtHashed == pds->Edt()) + if (CDistributionSpec::EdtHashed == pds->Edt() || + CDistributionSpec::EdtRandom == pds->Edt()) { - // direct dispatch only supported for scans over hash distributed tables + // direct dispatch supported for scans over + // hash & random distributed tables for (ULONG i = 0; i < size; i++) { CExpression *pexprFilter = (*pexprFilterArray)[i]; CPropConstraint *ppc = pexprFilter->DerivePropertyConstraint(); + CDXLDirectDispatchInfo *dxl_direct_dispatch_info = nullptr; if (nullptr != ppc->Pcnstr()) { GPOS_ASSERT(nullptr != ppc->Pcnstr()); - CDistributionSpecHashed *pdsHashed = - CDistributionSpecHashed::PdsConvert(pds); - CExpressionArray *pdrgpexprHashed = pdsHashed->Pdrgpexpr(); + if (CDistributionSpec::EdtHashed == pds->Edt()) + { + CDistributionSpecHashed *pdsHashed = + CDistributionSpecHashed::PdsConvert(pds); + CExpressionArray *pdrgpexprHashed = pdsHashed->Pdrgpexpr(); - CDXLDirectDispatchInfo *dxl_direct_dispatch_info = - GetDXLDirectDispatchInfo(mp, md_accessor, pdrgpexprHashed, - ppc->Pcnstr()); + dxl_direct_dispatch_info = GetDXLDirectDispatchInfo( + mp, md_accessor, pdrgpexprHashed, ppc->Pcnstr()); + } + else if (CDistributionSpec::EdtRandom == pds->Edt()) + { + CConstraint *pcnstr = ppc->Pcnstr(); + + CDistributionSpecRandom *pdsRandom = + CDistributionSpecRandom::PdsConvert(pds); + + // Extracting GpSegmentID for RandDist Table + const CColRef *pcrDistrCol = pdsRandom->GetGpSegmentId(); + + if (pcrDistrCol == nullptr) + { + // Direct Dispatch not feasible for this scenario as + // pcrDistrCol might not exist if gp_segment_id is not defined + continue; + } + + CConstraint *pcnstrDistrCol = + pcnstr->Pcnstr(mp, pcrDistrCol); + + if (pcnstrDistrCol == nullptr) + { + // Direct Dispatch not feasible for this scenario + // as no constraint found on the gp_segment_id + // Eg: In a query on a random distribute table, if we don't + // have a condition on gp_segment_id, but we have a condition + // on another column, in that case this condition + // shall arise.(select * from bar_randDistr where colm1=5;) + continue; + } + + dxl_direct_dispatch_info = GetDXLDirectDispatchInfoRandDist( + mp, md_accessor, pcrDistrCol, pcnstrDistrCol); + } if (nullptr != dxl_direct_dispatch_info) { @@ -1263,7 +826,60 @@ CTranslatorExprToDXLUtils::SetDirectDispatchInfo( } } } +//--------------------------------------------------------------------------- +// @function: +// CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfoRandDist +// +// @doc: +// Compute the direct dispatch info spec if the table is randomly +// distributed. Returns NULL if this is not possible +// +//--------------------------------------------------------------------------- +CDXLDirectDispatchInfo * +CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfoRandDist( + CMemoryPool *mp, CMDAccessor *md_accessor, const CColRef *pcrDistrCol, + CConstraint *pcnstrDistrCol) +{ + // For a random distributed table, we get direct gp_segment_id + // value in the expression, so we use it as is. + const BOOL useRawValues = true; + + CDXLDatum2dArray *pdrgpdrgpdxldatum = nullptr; + + if (CPredicateUtils::FConstColumn(pcnstrDistrCol, pcrDistrCol)) + { + CDXLDatum *dxl_datum = PdxldatumFromPointConstraint( + mp, md_accessor, pcrDistrCol, pcnstrDistrCol); + GPOS_ASSERT(nullptr != dxl_datum); + + if (FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) + { + CDXLDatumArray *pdrgpdxldatum = GPOS_NEW(mp) CDXLDatumArray(mp); + + dxl_datum->AddRef(); + pdrgpdxldatum->Append(dxl_datum); + + pdrgpdrgpdxldatum = GPOS_NEW(mp) CDXLDatum2dArray(mp); + pdrgpdrgpdxldatum->Append(pdrgpdxldatum); + } + + dxl_datum->Release(); + } + else if (CPredicateUtils::FColumnDisjunctionOfConst(pcnstrDistrCol, + pcrDistrCol)) + { + pdrgpdrgpdxldatum = PdrgpdrgpdxldatumFromDisjPointConstraint( + mp, md_accessor, pcrDistrCol, pcnstrDistrCol); + } + CRefCount::SafeRelease(pcnstrDistrCol); + + if (nullptr == pdrgpdrgpdxldatum) + { + return nullptr; + } + return GPOS_NEW(mp) CDXLDirectDispatchInfo(pdrgpdrgpdxldatum, useRawValues); +} //--------------------------------------------------------------------------- // @function: // CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfo @@ -1284,6 +900,7 @@ CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfo( const ULONG ulHashExpr = pdrgpexprHashed->Size(); GPOS_ASSERT(0 < ulHashExpr); + // If we have single distribution key for table if (1 == ulHashExpr) { CExpression *pexprHashed = (*pdrgpexprHashed)[0]; @@ -1293,6 +910,7 @@ CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfo( BOOL fSuccess = true; CDXLDatumArray *pdrgpdxldatum = GPOS_NEW(mp) CDXLDatumArray(mp); + // If we have multiple distribution keys for the table for (ULONG ul = 0; ul < ulHashExpr && fSuccess; ul++) { CExpression *pexpr = (*pdrgpexprHashed)[ul]; @@ -1311,7 +929,8 @@ CTranslatorExprToDXLUtils::GetDXLDirectDispatchInfo( mp, md_accessor, pcrDistrCol, pcnstrDistrCol); CRefCount::SafeRelease(pcnstrDistrCol); - if (nullptr != dxl_datum && FDirectDispatchable(pcrDistrCol, dxl_datum)) + if (nullptr != dxl_datum && + FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) { pdrgpdxldatum->Append(dxl_datum); } @@ -1388,7 +1007,8 @@ CTranslatorExprToDXLUtils::PdxlddinfoSingleDistrKey(CMemoryPool *mp, mp, md_accessor, pcrDistrCol, pcnstrDistrCol); GPOS_ASSERT(nullptr != dxl_datum); - if (FDirectDispatchable(pcrDistrCol, dxl_datum)) + if (FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) + { CDXLDatumArray *pdrgpdxldatum = GPOS_NEW(mp) CDXLDatumArray(mp); @@ -1429,7 +1049,8 @@ CTranslatorExprToDXLUtils::PdxlddinfoSingleDistrKey(CMemoryPool *mp, // //--------------------------------------------------------------------------- BOOL -CTranslatorExprToDXLUtils::FDirectDispatchable(const CColRef *pcrDistrCol, +CTranslatorExprToDXLUtils::FDirectDispatchable(CMDAccessor *md_accessor, + const CColRef *pcrDistrCol, const CDXLDatum *dxl_datum) { GPOS_ASSERT(nullptr != pcrDistrCol); @@ -1445,7 +1066,66 @@ CTranslatorExprToDXLUtils::FDirectDispatchable(const CColRef *pcrDistrCol, BOOL fBothInt = CUtils::FIntType(pmdidDistrCol) && CUtils::FIntType(pmdidDatum); - return fBothInt || (pmdidDatum->Equals(pmdidDistrCol)); + if (fBothInt || (pmdidDatum->Equals(pmdidDistrCol))) + { + return true; + } + else + { + // if both the IMDId have different oids, + // then we check if a cast exist between them + // and if that cast is binary coercible. + // Eg if datum oid id 25(Text) and DistCol oid is 1043(VarChar) + // then since a cast is possible and + // cast is binary coercible, we go ahead with direct dispatch + + const IMDCast *pmdcast_datumToDistrCol; + const IMDCast *pmdcast_distrColToDatum; + + // Checking if cast exist from datum to distribution column + GPOS_TRY + { + // Pmdcast(,) generates an exception + // whenever cast is not possible. + pmdcast_datumToDistrCol = + md_accessor->Pmdcast(pmdidDatum, pmdidDistrCol); + + if ((pmdcast_datumToDistrCol->IsBinaryCoercible())) + { + // cast exist and is between coercible type + return true; + } + } + GPOS_CATCH_EX(ex) + { + GPOS_RESET_EX; + } + GPOS_CATCH_END; + + // Checking if cast exist from distribution column to datum + // eg:explain select gp_segment_id, * from t1_varchar + // where col1_varchar = 'a'::char; + GPOS_TRY + { + // Pmdcast(,) generates an exception + // whenever cast is not possible. + pmdcast_distrColToDatum = + md_accessor->Pmdcast(pmdidDistrCol, pmdidDatum); + + if ((pmdcast_distrColToDatum->IsBinaryCoercible())) + { + // cast exist and is between coercible type + return true; + } + } + GPOS_CATCH_EX(ex) + { + GPOS_RESET_EX; + } + GPOS_CATCH_END; + + return false; + } } //--------------------------------------------------------------------------- @@ -1512,7 +1192,7 @@ CTranslatorExprToDXLUtils::PdrgpdrgpdxldatumFromDisjPointConstraint( CDXLDatum *dxl_datum = PdxldatumFromPointConstraint( mp, md_accessor, pcrDistrCol, pcnstrDistrCol); - if (FDirectDispatchable(pcrDistrCol, dxl_datum)) + if (FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) { CDXLDatumArray *pdrgpdxldatum = GPOS_NEW(mp) CDXLDatumArray(mp); @@ -1546,7 +1226,7 @@ CTranslatorExprToDXLUtils::PdrgpdrgpdxldatumFromDisjPointConstraint( CDXLDatum *dxl_datum = CTranslatorExprToDXLUtils::GetDatumVal( mp, md_accessor, prng->PdatumLeft()); - if (!FDirectDispatchable(pcrDistrCol, dxl_datum)) + if (!FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) { // clean up dxl_datum->Release(); @@ -1565,7 +1245,7 @@ CTranslatorExprToDXLUtils::PdrgpdrgpdxldatumFromDisjPointConstraint( { CDXLDatum *dxl_datum = pcrDistrCol->RetrieveType()->GetDXLDatumNull(mp); - if (!FDirectDispatchable(pcrDistrCol, dxl_datum)) + if (!FDirectDispatchable(md_accessor, pcrDistrCol, dxl_datum)) { // clean up dxl_datum->Release(); diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperator.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperator.h index c8e7df15c74..51564551d32 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperator.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperator.h @@ -116,12 +116,6 @@ enum Edxlopid EdxlopScalarDMLAction, EdxlopScalarOpList, - EdxlopScalarPartDefault, - EdxlopScalarPartBound, - EdxlopScalarPartBoundInclusion, - EdxlopScalarPartBoundOpen, - EdxlopScalarPartListValues, - EdxlopScalarPartListNullTest, EdxlopScalarValuesList, EdxlopScalarSortGroupClause, diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperatorFactory.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperatorFactory.h index d9a1167762c..c115a941d15 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperatorFactory.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLOperatorFactory.h @@ -523,6 +523,14 @@ class CDXLOperatorFactory CDXLMemoryManager *dxl_memory_manager, const Attributes &attr, Edxltoken target_attr, Edxltoken target_elem); + static IntPtrArray *ExtractConvertValuesToIntArray( + CDXLMemoryManager *dxl_memory_manager, const Attributes &attr, + Edxltoken target_attr, Edxltoken target_elem); + + static CBitSet *ExtractConvertValuesToIntBitSet( + CDXLMemoryManager *dxl_memory_manager, const Attributes &attr, + Edxltoken target_attr, Edxltoken target_elem); + // parse a comma-separated list of integers numbers into a dynamic array // will raise an exception if list is not well-formed template Pmp(); + + CBitSet *pbs = GPOS_NEW(mp) CBitSet(mp); + + XMLStringTokenizer mdid_components( + mdid_list_xml, CDXLTokens::XmlstrToken(EdxltokenComma)); + const ULONG num_tokens = mdid_components.countTokens(); + + for (ULONG ul = 0; ul < num_tokens; ul++) + { + XMLCh *xmlszNext = mdid_components.nextToken(); + GPOS_ASSERT(nullptr != xmlszNext); + + INT attno = ConvertAttrValueToInt(dxl_memory_manager, xmlszNext, + target_attr, target_elem); + pbs->ExchangeSet(attno); + } + + return pbs; + } + // parse a comma-separated list of CHAR partition types into a dynamic array. // will raise an exception if list is not well-formed static CharPtrArray *ExtractConvertPartitionTypeToArray( diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBound.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBound.h deleted file mode 100644 index 9643413cb92..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBound.h +++ /dev/null @@ -1,107 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBound.h -// -// @doc: -// Class for representing DXL Part boundary expressions -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartBound_H -#define GPDXL_CDXLScalarPartBound_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -//--------------------------------------------------------------------------- -// @class: -// CDXLScalarPartBound -// -// @doc: -// Class for representing DXL Part boundary expressions -// These expressions are created and consumed by the PartitionSelector operator -// -//--------------------------------------------------------------------------- -class CDXLScalarPartBound : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - - // boundary type - IMDId *m_mdid_type; - - // whether this represents a lower or upper bound - BOOL m_is_lower_bound; - -public: - CDXLScalarPartBound(const CDXLScalarPartBound &) = delete; - - // ctor - CDXLScalarPartBound(CMemoryPool *mp, ULONG partitioning_level, - IMDId *mdid_type, BOOL is_lower_bound); - - // dtor - ~CDXLScalarPartBound() override; - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG - GetPartitioningLevel() const - { - return m_partitioning_level; - } - - // boundary type - IMDId * - MdidType() const - { - return m_mdid_type; - } - - // is this a lower (or upper) bound - BOOL - IsLowerBound() const - { - return m_is_lower_bound; - } - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL HasBoolResult(CMDAccessor *md_accessor) const override; - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartBound * - Cast(CDXLOperator *dxl_op) - { - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartBound == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); - } -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartBound_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h deleted file mode 100644 index 12d6acab8f8..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h +++ /dev/null @@ -1,101 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBoundInclusion.h -// -// @doc: -// Class for representing DXL Part boundary inclusion expressions -// These expressions indicate whether a particular boundary of a part -// constraint is closed (inclusive) or open (exclusive) -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartBoundInclusion_H -#define GPDXL_CDXLScalarPartBoundInclusion_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -//--------------------------------------------------------------------------- -// @class: -// CDXLScalarPartBoundInclusion -// -// @doc: -// Class for representing DXL Part boundary inclusion expressions -// These expressions are created and consumed by the PartitionSelector operator -// -//--------------------------------------------------------------------------- -class CDXLScalarPartBoundInclusion : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - - // whether this represents a lower or upper bound - BOOL m_is_lower_bound; - -public: - CDXLScalarPartBoundInclusion(const CDXLScalarPartBoundInclusion &) = delete; - - // ctor - CDXLScalarPartBoundInclusion(CMemoryPool *mp, ULONG partitioning_level, - BOOL is_lower_bound); - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG - GetPartitioningLevel() const - { - return m_partitioning_level; - } - - // is this a lower (or upper) bound - BOOL - IsLowerBound() const - { - return m_is_lower_bound; - } - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL - HasBoolResult(CMDAccessor * //md_accessor - ) const override - { - return true; - } - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartBoundInclusion * - Cast(CDXLOperator *dxl_op) - { - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartBoundInclusion == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); - } -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartBoundInclusion_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundOpen.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundOpen.h deleted file mode 100644 index 727369df059..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartBoundOpen.h +++ /dev/null @@ -1,101 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBoundOpen.h -// -// @doc: -// Class for representing DXL Part boundary openness expressions -// These expressions indicate whether a particular boundary of a part -// constraint is open (unbounded) -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartBoundOpen_H -#define GPDXL_CDXLScalarPartBoundOpen_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -//--------------------------------------------------------------------------- -// @class: -// CDXLScalarPartBoundOpen -// -// @doc: -// Class for representing DXL Part boundary openness expressions -// These expressions are created and consumed by the PartitionSelector operator -// -//--------------------------------------------------------------------------- -class CDXLScalarPartBoundOpen : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - - // whether this represents a lower or upper bound - BOOL m_is_lower_bound; - -public: - CDXLScalarPartBoundOpen(const CDXLScalarPartBoundOpen &) = delete; - - // ctor - CDXLScalarPartBoundOpen(CMemoryPool *mp, ULONG partitioning_level, - BOOL is_lower_bound); - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG - GetPartitioningLevel() const - { - return m_partitioning_level; - } - - // is this a lower (or upper) bound - BOOL - IsLowerBound() const - { - return m_is_lower_bound; - } - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL - HasBoolResult(CMDAccessor * //md_accessor - ) const override - { - return true; - } - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartBoundOpen * - Cast(CDXLOperator *dxl_op) - { - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartBoundOpen == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); - } -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartBoundOpen_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartDefault.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartDefault.h deleted file mode 100644 index 50d486da3ca..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartDefault.h +++ /dev/null @@ -1,88 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartDefault.h -// -// @doc: -// Class for representing DXL Part Default expressions -// These expressions indicate whether a particular part is a default part -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartDefault_H -#define GPDXL_CDXLScalarPartDefault_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -//--------------------------------------------------------------------------- -// @class: -// CDXLScalarPartDefault -// -// @doc: -// Class for representing DXL Part Default expressions -// -//--------------------------------------------------------------------------- -class CDXLScalarPartDefault : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - -public: - CDXLScalarPartDefault(const CDXLScalarPartDefault &) = delete; - - // ctor - CDXLScalarPartDefault(CMemoryPool *mp, ULONG partitioning_level); - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG - GetPartitioningLevel() const - { - return m_partitioning_level; - } - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL - HasBoolResult(CMDAccessor * //md_accessor - ) const override - { - return true; - } - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartDefault * - Cast(CDXLOperator *dxl_op) - { - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartDefault == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); - } -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartDefault_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListNullTest.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListNullTest.h deleted file mode 100644 index c0ca9f854bf..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListNullTest.h +++ /dev/null @@ -1,68 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Class for representing DXL Part list null test expressions -// These expressions indicate whether the list values of a part -// contain NULL value or not -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartListNullTest_H -#define GPDXL_CDXLScalarPartListNullTest_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -class CDXLScalarPartListNullTest : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - - // Null Test type (true for 'is null', false for 'is not null') - BOOL m_is_null; - -public: - CDXLScalarPartListNullTest(const CDXLScalarPartListNullTest &) = delete; - - // ctor - CDXLScalarPartListNullTest(CMemoryPool *mp, ULONG partitioning_level, - BOOL is_null); - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG GetPartitioningLevel() const; - - // Null Test type (true for 'is null', false for 'is not null') - BOOL IsNull() const; - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL HasBoolResult(CMDAccessor *md_accessor) const override; - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartListNullTest *Cast(CDXLOperator *dxl_op); -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartListNullTest_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListValues.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListValues.h deleted file mode 100644 index 844282554cb..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarPartListValues.h +++ /dev/null @@ -1,76 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Class for representing DXL Part List Values expressions -// These expressions indicate the constant values for the list partition -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CDXLScalarPartListValues_H -#define GPDXL_CDXLScalarPartListValues_H - -#include "gpos/base.h" - -#include "naucrates/dxl/operators/CDXLScalar.h" - -namespace gpdxl -{ -class CDXLScalarPartListValues : public CDXLScalar -{ -private: - // partitioning level - ULONG m_partitioning_level; - - // result type - IMDId *m_result_type_mdid; - - // element type - IMDId *m_elem_type_mdid; - -public: - CDXLScalarPartListValues(const CDXLScalarPartListValues &) = delete; - - // ctor - CDXLScalarPartListValues(CMemoryPool *mp, ULONG partitioning_level, - IMDId *result_type_mdid, IMDId *elem_type_mdid); - - // dtor - ~CDXLScalarPartListValues() override; - - // operator type - Edxlopid GetDXLOperator() const override; - - // operator name - const CWStringConst *GetOpNameStr() const override; - - // partitioning level - ULONG GetPartitioningLevel() const; - - // result type - IMDId *GetResultTypeMdId() const; - - // element type - IMDId *GetElemTypeMdId() const; - - // serialize operator in DXL format - void SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode *dxlnode) const override; - - // does the operator return a boolean result - BOOL HasBoolResult(CMDAccessor *md_accessor) const override; - -#ifdef GPOS_DEBUG - // checks whether the operator has valid structure, i.e. number and - // types of child nodes - void AssertValid(const CDXLNode *dxlnode, - BOOL validate_children) const override; -#endif // GPOS_DEBUG - - // conversion function - static CDXLScalarPartListValues *Cast(CDXLOperator *dxl_op); -}; -} // namespace gpdxl - -#endif // !GPDXL_CDXLScalarPartListValues_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLTableDescr.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLTableDescr.h index 1b30845231d..4395335e725 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLTableDescr.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLTableDescr.h @@ -20,6 +20,9 @@ #include "naucrates/md/CMDName.h" #include "naucrates/md/IMDId.h" +// default value for m_assigned_query_id_for_target_rel - no assigned query for table descriptor +#define UNASSIGNED_QUERYID 0 + namespace gpdxl { using namespace gpmd; @@ -50,6 +53,12 @@ class CDXLTableDescr : public CRefCount // lock mode from the parser INT m_lockmode; + // identifier of query to which current table belongs. + // This field is used for assigning current table entry with + // target one within DML operation. If descriptor doesn't point + // to the target (result) relation it has value UNASSIGNED_QUERYID + ULONG m_assigned_query_id_for_target_rel; + void SerializeMDId(CXMLSerializer *xml_serializer) const; public: @@ -57,7 +66,8 @@ class CDXLTableDescr : public CRefCount // ctor/dtor CDXLTableDescr(CMemoryPool *mp, IMDId *mdid, CMDName *mdname, - ULONG ulExecuteAsUser, int lockmode); + ULONG ulExecuteAsUser, int lockmode, + ULONG assigned_query_id_for_target_rel = UNASSIGNED_QUERYID); ~CDXLTableDescr() override; @@ -86,6 +96,9 @@ class CDXLTableDescr : public CRefCount // serialize to dxl format void SerializeToDXL(CXMLSerializer *xml_serializer) const; + + // get assigned query id for target relation + ULONG GetAssignedQueryIdForTargetRel() const; }; } // namespace gpdxl diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBound.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStats.h similarity index 50% rename from src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBound.h rename to src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStats.h index 522bf5c4a1b..497005227f4 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBound.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStats.h @@ -1,36 +1,30 @@ //--------------------------------------------------------------------------- // Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. +// Copyright (C) 2023 VMware Inc. // // @filename: -// CParseHandlerScalarPartBound.h +// CParseHandlerExtStats.h // // @doc: -// SAX parse handler class for parsing scalar part bound +// SAX parse handler class for parsing extended stats objects //--------------------------------------------------------------------------- -#ifndef GPDXL_CParseHandlerScalarScalarPartBound_H -#define GPDXL_CParseHandlerScalarScalarPartBound_H +#ifndef GPDXL_CParseHandlerExtStats_H +#define GPDXL_CParseHandlerExtStats_H #include "gpos/base.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" namespace gpdxl { using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; XERCES_CPP_NAMESPACE_USE -//--------------------------------------------------------------------------- -// @class: -// CParseHandlerScalarPartBound -// -// @doc: -// Parse handler class for parsing scalar part bound -// -//--------------------------------------------------------------------------- -class CParseHandlerScalarPartBound : public CParseHandlerScalarOp +class CParseHandlerExtStats : public CParseHandlerMetadataObject { private: // process the start of an element @@ -48,16 +42,22 @@ class CParseHandlerScalarPartBound : public CParseHandlerScalarOp const XMLCh *const element_qname // element's qname ) override; + IMDId *m_mdid; + + CMDName *m_mdname; + public: - CParseHandlerScalarPartBound(const CParseHandlerScalarPartBound &) = delete; + CParseHandlerExtStats(const CParseHandlerExtStats &) = delete; // ctor - CParseHandlerScalarPartBound(CMemoryPool *mp, - CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root); + CParseHandlerExtStats(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + ~CParseHandlerExtStats() override; }; } // namespace gpdxl -#endif // !GPDXL_CParseHandlerScalarScalarPartBound_H +#endif // !GPDXL_CParseHandlerExtStats_H // EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h new file mode 100644 index 00000000000..57df1028eb6 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h @@ -0,0 +1,68 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsDependencies.h +// +// @doc: +// SAX parse handler class for parsing extended stats dependencies object +//--------------------------------------------------------------------------- + +#ifndef GPDXL_CParseHandlerExtStatsDependencies_H +#define GPDXL_CParseHandlerExtStatsDependencies_H + +#include "gpos/base.h" + +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDDependency.h" + +namespace gpdxl +{ +using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +class CParseHandlerExtStatsDependencies : public CParseHandlerBase +{ +private: + // dependency list values + CMDDependencyArray *m_dependencies; + + // process the start of an element + void StartElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname, // element's qname + const Attributes &attr // element's attributes + ) override; + + // process the end of an element + void EndElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname // element's qname + ) override; + +public: + CParseHandlerExtStatsDependencies( + const CParseHandlerExtStatsDependencies &) = delete; + + // ctor + CParseHandlerExtStatsDependencies(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerExtStatsDependencies() override; + + // returns the constructed bucket + CMDDependencyArray *GetDependencies() const; +}; +} // namespace gpdxl + +#endif // !GPDXL_CParseHandlerExtStatsDependencies_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependency.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependency.h new file mode 100644 index 00000000000..9c97b6f0aac --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsDependency.h @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsDependency.h +// +// @doc: +// SAX parse handler class for parsing extended stats dependency object +//--------------------------------------------------------------------------- + +#ifndef GPDXL_CParseHandlerExtStatsDependency_H +#define GPDXL_CParseHandlerExtStatsDependency_H + +#include "gpos/base.h" + +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDDependency.h" + +namespace gpdxl +{ +using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +class CParseHandlerExtStatsDependency : public CParseHandlerBase +{ +private: + // degree + CDouble m_degree; + + // from attnos values + IntPtrArray *m_from_attnos; + + INT m_to_attno; + + // dependency object + CMDDependency *m_dependency; + + // process the start of an element + void StartElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname, // element's qname + const Attributes &attr // element's attributes + ) override; + + // process the end of an element + void EndElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname // element's qname + ) override; + +public: + CParseHandlerExtStatsDependency(const CParseHandlerExtStatsDependency &) = + delete; + + // ctor + CParseHandlerExtStatsDependency(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerExtStatsDependency() override; + + // returns the constructed bucket + CMDDependency *GetDependencyAt() const; +}; +} // namespace gpdxl + +#endif // !GPDXL_CParseHandlerExtStatsDependency_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsInfo.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsInfo.h new file mode 100644 index 00000000000..0257ab058e1 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsInfo.h @@ -0,0 +1,69 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsInfo.h +// +// @doc: +// SAX parse handler class for parsing extended stats metadata object +//--------------------------------------------------------------------------- + +#ifndef GPDXL_CParseHandlerExtStatsInfo_H +#define GPDXL_CParseHandlerExtStatsInfo_H + +#include "gpos/base.h" + +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDExtStatsInfo.h" + +namespace gpdxl +{ +using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +class CParseHandlerExtStatsInfo : public CParseHandlerBase +{ +private: + // extstat infos list + CMDExtStatsInfo *m_extinfo; + + // process the start of an element + void StartElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname, // element's qname + const Attributes &attr // element's attributes + ) override; + + // process the end of an element + void EndElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname // element's qname + ) override; + + CMDExtStatsInfo::Estattype ParseStatKind(const Attributes &attrs) const; + +public: + CParseHandlerExtStatsInfo(const CParseHandlerExtStatsInfo &) = delete; + + // ctor + CParseHandlerExtStatsInfo(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerExtStatsInfo() override; + + // returns the constructed bucket + CMDExtStatsInfo *GetInfo() const; +}; +} // namespace gpdxl + +#endif // !GPDXL_CParseHandlerExtStatsInfo_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartDefault.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h similarity index 51% rename from src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartDefault.h rename to src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h index 561f4f728ce..775be18bf00 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartDefault.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h @@ -1,38 +1,42 @@ //--------------------------------------------------------------------------- // Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. +// Copyright (C) 2023 VMware Inc. // // @filename: -// CParseHandlerScalarPartDefault.h +// CParseHandlerExtStatsNDistinct.h // // @doc: -// SAX parse handler class for parsing scalar part default +// SAX parse handler class for parsing extended stats ndistinct object //--------------------------------------------------------------------------- -#ifndef GPDXL_CParseHandlerScalarScalarPartDefault_H -#define GPDXL_CParseHandlerScalarScalarPartDefault_H +#ifndef GPDXL_CParseHandlerExtStatsNDistinct_H +#define GPDXL_CParseHandlerExtStatsNDistinct_H #include "gpos/base.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDNDistinct.h" namespace gpdxl { using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; XERCES_CPP_NAMESPACE_USE -//--------------------------------------------------------------------------- -// @class: -// CParseHandlerScalarPartDefault -// -// @doc: -// Parse handler class for parsing scalar part default -// -//--------------------------------------------------------------------------- -class CParseHandlerScalarPartDefault : public CParseHandlerScalarOp +class CParseHandlerExtStatsNDistinct : public CParseHandlerBase { private: + // ndistinct + CDouble m_ndistinct; + + // attnos values + CBitSet *m_attnos; + + // ndistinct object + CMDNDistinct *m_ndistinct_md; + // process the start of an element void StartElement( const XMLCh *const element_uri, // URI of element's namespace @@ -49,16 +53,22 @@ class CParseHandlerScalarPartDefault : public CParseHandlerScalarOp ) override; public: - CParseHandlerScalarPartDefault(const CParseHandlerScalarPartDefault &) = + CParseHandlerExtStatsNDistinct(const CParseHandlerExtStatsNDistinct &) = delete; // ctor - CParseHandlerScalarPartDefault(CMemoryPool *mp, + CParseHandlerExtStatsNDistinct(CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root); + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerExtStatsNDistinct() override; + + // returns the constructed ndistinct + CMDNDistinct *GetNDistinctAt() const; }; } // namespace gpdxl -#endif // !GPDXL_CParseHandlerScalarScalarPartDefault_H +#endif // !GPDXL_CParseHandlerExtStatsNDistinct_H // EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h new file mode 100644 index 00000000000..b318d6e4a50 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h @@ -0,0 +1,69 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsNDistinctList.h +// +// @doc: +// SAX parse handler class for parsing list of extended stats ndistinct +// objects +//--------------------------------------------------------------------------- + +#ifndef GPDXL_CParseHandlerExtStatsNDistinctList_H +#define GPDXL_CParseHandlerExtStatsNDistinctList_H + +#include "gpos/base.h" + +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDNDistinct.h" + +namespace gpdxl +{ +using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +class CParseHandlerExtStatsNDistinctList : public CParseHandlerBase +{ +private: + // dependency list values + CMDNDistinctArray *m_ndistincts; + + // process the start of an element + void StartElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname, // element's qname + const Attributes &attr // element's attributes + ) override; + + // process the end of an element + void EndElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname // element's qname + ) override; + +public: + CParseHandlerExtStatsNDistinctList( + const CParseHandlerExtStatsNDistinctList &) = delete; + + // ctor + CParseHandlerExtStatsNDistinctList(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerExtStatsNDistinctList() override; + + // returns the constructed list + CMDNDistinctArray *GetNDistinctList() const; +}; +} // namespace gpdxl + +#endif // !GPDXL_CParseHandlerExtStatsNDistinctList_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerFactory.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerFactory.h index 2a988222283..4577175b73d 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerFactory.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerFactory.h @@ -162,6 +162,41 @@ class CParseHandlerFactory CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, CParseHandlerBase *parse_handler_root); + // construct a relation extended stats metadata parse handler + static CParseHandlerBase *CreateRelationExtStatsParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats parse handler + static CParseHandlerBase *CreateExtStatsParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats metadata parse handler + static CParseHandlerBase *CreateExtStatsInfoParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats dependencies parse handler + static CParseHandlerBase *CreateExtStatsDependenciesParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats dependency parse handler + static CParseHandlerBase *CreateExtStatsDependencyParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats ndistinct list parse handler + static CParseHandlerBase *CreateExtStatsNDistinctListParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + + // construct an extended stats ndistinct parse handler + static CParseHandlerBase *CreateExtStatsNDistinctParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root); + // construct a column stats parse handler static CParseHandlerBase *CreateColStatsParseHandler( CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDIndex.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDIndex.h index bc6c8b6e4d9..7bead5f0ba1 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDIndex.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDIndex.h @@ -59,15 +59,6 @@ class CParseHandlerMDIndex : public CParseHandlerMetadataObject // included columns ULongPtrArray *m_included_cols_array; - // index part constraint - CMDPartConstraintGPDB *m_part_constraint; - - // levels that include default partitions - ULongPtrArray *m_level_with_default_part_array; - - // is constraint unbounded - BOOL m_part_constraint_unbounded; - // child index oids parse handler CParseHandlerBase *m_child_indexes_parse_handler; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDRelation.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDRelation.h index 1e9adf794c2..5032dfb9c67 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDRelation.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerMDRelation.h @@ -67,9 +67,6 @@ class CParseHandlerMDRelation : public CParseHandlerMetadataObject // partition types CharPtrArray *m_str_part_types_array; - // number of partitions - ULONG m_num_of_partitions; - // key sets ULongPtr2dArray *m_key_sets_arrays; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerRelationExtendedStats.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerRelationExtendedStats.h new file mode 100644 index 00000000000..e08526a0790 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerRelationExtendedStats.h @@ -0,0 +1,71 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerRelationExtendedStats.h +// +// @doc: +// SAX parse handler class for parsing relation extended stats metadata +//--------------------------------------------------------------------------- + +#ifndef GPDXL_CParseHandlerRelationExtendedStatss_H +#define GPDXL_CParseHandlerRelationExtendedStatss_H + +#include "gpos/base.h" + +#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h" +#include "naucrates/md/CMDExtStatsInfo.h" + +namespace gpdxl +{ +using namespace gpos; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +class CParseHandlerRelationExtendedStats : public CParseHandlerMetadataObject +{ +private: + // dependency list values + CMDExtStatsInfoArray *m_extinfos; + + IMDId *m_mdid; + CMDName *m_mdname; + + // process the start of an element + void StartElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname, // element's qname + const Attributes &attr // element's attributes + ) override; + + // process the end of an element + void EndElement( + const XMLCh *const element_uri, // URI of element's namespace + const XMLCh *const element_local_name, // local part of element's name + const XMLCh *const element_qname // element's qname + ) override; + +public: + CParseHandlerRelationExtendedStats( + const CParseHandlerRelationExtendedStats &) = delete; + + // ctor + CParseHandlerRelationExtendedStats(CMemoryPool *mp, + CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base); + + // dtor + ~CParseHandlerRelationExtendedStats() override = default; + + // returns the constructed bucket + CMDExtStatsInfoArray *GetInfos() const; +}; +} // namespace gpdxl + +#endif // !GPDXL_CParseHandlerRelationExtendedStatss_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundInclusion.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundInclusion.h deleted file mode 100644 index 7d75335baf1..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundInclusion.h +++ /dev/null @@ -1,64 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CParseHandlerScalarPartBoundInclusion.h -// -// @doc: -// SAX parse handler class for parsing scalar part bound inclusion -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CParseHandlerScalarScalarPartBoundInclusion_H -#define GPDXL_CParseHandlerScalarScalarPartBoundInclusion_H - -#include "gpos/base.h" - -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -namespace gpdxl -{ -using namespace gpos; - -XERCES_CPP_NAMESPACE_USE - -//--------------------------------------------------------------------------- -// @class: -// CParseHandlerScalarPartBoundInclusion -// -// @doc: -// Parse handler class for parsing scalar part bound inclusion -// -//--------------------------------------------------------------------------- -class CParseHandlerScalarPartBoundInclusion : public CParseHandlerScalarOp -{ -private: - // process the start of an element - void StartElement( - const XMLCh *const element_uri, // URI of element's namespace - const XMLCh *const element_local_name, // local part of element's name - const XMLCh *const element_qname, // element's qname - const Attributes &attr // element's attributes - ) override; - - // process the end of an element - void EndElement( - const XMLCh *const element_uri, // URI of element's namespace - const XMLCh *const element_local_name, // local part of element's name - const XMLCh *const element_qname // element's qname - ) override; - -public: - CParseHandlerScalarPartBoundInclusion( - const CParseHandlerScalarPartBoundInclusion &) = delete; - - // ctor - CParseHandlerScalarPartBoundInclusion( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root); -}; -} // namespace gpdxl - -#endif // !GPDXL_CParseHandlerScalarScalarPartBoundInclusion_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundOpen.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundOpen.h deleted file mode 100644 index 912e904584d..00000000000 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerScalarPartBoundOpen.h +++ /dev/null @@ -1,64 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CParseHandlerScalarPartBoundOpen.h -// -// @doc: -// SAX parse handler class for parsing scalar part bound openness -//--------------------------------------------------------------------------- - -#ifndef GPDXL_CParseHandlerScalarScalarPartBoundOpen_H -#define GPDXL_CParseHandlerScalarScalarPartBoundOpen_H - -#include "gpos/base.h" - -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -namespace gpdxl -{ -using namespace gpos; - -XERCES_CPP_NAMESPACE_USE - -//--------------------------------------------------------------------------- -// @class: -// CParseHandlerScalarPartBoundOpen -// -// @doc: -// Parse handler class for parsing scalar part bound openness -// -//--------------------------------------------------------------------------- -class CParseHandlerScalarPartBoundOpen : public CParseHandlerScalarOp -{ -private: - // process the start of an element - void StartElement( - const XMLCh *const element_uri, // URI of element's namespace - const XMLCh *const element_local_name, // local part of element's name - const XMLCh *const element_qname, // element's qname - const Attributes &attr // element's attributes - ) override; - - // process the end of an element - void EndElement( - const XMLCh *const element_uri, // URI of element's namespace - const XMLCh *const element_local_name, // local part of element's name - const XMLCh *const element_qname // element's qname - ) override; - -public: - CParseHandlerScalarPartBoundOpen(const CParseHandlerScalarPartBoundOpen &) = - delete; - - // ctor - CParseHandlerScalarPartBoundOpen(CMemoryPool *mp, - CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root); -}; -} // namespace gpdxl - -#endif // !GPDXL_CParseHandlerScalarScalarPartBoundOpen_H - -// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/parsehandlers.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/parsehandlers.h index 25075cddd73..4956a26c20e 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/parsehandlers.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/parsehandlers.h @@ -35,6 +35,12 @@ #include "naucrates/dxl/parser/CParseHandlerDynamicIndexScan.h" #include "naucrates/dxl/parser/CParseHandlerDynamicTableScan.h" #include "naucrates/dxl/parser/CParseHandlerEnumeratorConfig.h" +#include "naucrates/dxl/parser/CParseHandlerExtStats.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependency.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsInfo.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h" #include "naucrates/dxl/parser/CParseHandlerFactory.h" #include "naucrates/dxl/parser/CParseHandlerFilter.h" #include "naucrates/dxl/parser/CParseHandlerForeignScan.h" @@ -111,6 +117,7 @@ #include "naucrates/dxl/parser/CParseHandlerRandomMotion.h" #include "naucrates/dxl/parser/CParseHandlerRedistributeMotion.h" #include "naucrates/dxl/parser/CParseHandlerRelStats.h" +#include "naucrates/dxl/parser/CParseHandlerRelationExtendedStats.h" #include "naucrates/dxl/parser/CParseHandlerResult.h" #include "naucrates/dxl/parser/CParseHandlerRoutedMotion.h" #include "naucrates/dxl/parser/CParseHandlerScalarAggref.h" @@ -143,12 +150,6 @@ #include "naucrates/dxl/parser/CParseHandlerScalarOp.h" #include "naucrates/dxl/parser/CParseHandlerScalarOpExpr.h" #include "naucrates/dxl/parser/CParseHandlerScalarOpList.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartBound.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartBoundInclusion.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartBoundOpen.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartDefault.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartListNullTest.h" -#include "naucrates/dxl/parser/CParseHandlerScalarPartListValues.h" #include "naucrates/dxl/parser/CParseHandlerScalarSortGroupClause.h" #include "naucrates/dxl/parser/CParseHandlerScalarSubPlan.h" #include "naucrates/dxl/parser/CParseHandlerScalarSubPlanParam.h" diff --git a/src/backend/gporca/libnaucrates/include/naucrates/dxl/xml/dxltokens.h b/src/backend/gporca/libnaucrates/include/naucrates/dxl/xml/dxltokens.h index 7f98040c463..0c44b28548c 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/dxl/xml/dxltokens.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/dxl/xml/dxltokens.h @@ -215,12 +215,6 @@ enum Edxltoken EdxltokenPartLevelFilterList, EdxltokenPartLevel, EdxltokenScalarPartDefault, - EdxltokenScalarPartBound, - EdxltokenScalarPartBoundLower, - EdxltokenScalarPartBoundInclusion, - EdxltokenScalarPartBoundOpen, - EdxltokenScalarPartListValues, - EdxltokenScalarPartListNullTest, EdxltokenScalarResidualFilter, EdxltokenScalarPartFilterExpr, EdxltokenScalarBitmapIndexProbe, @@ -451,6 +445,7 @@ enum Edxltoken EdxltokenSchema, EdxltokenTablespace, EdxltokenOid, + EdxltokenKind, EdxltokenVersion, EdxltokenMdid, EdxltokenLockMode, @@ -461,10 +456,21 @@ enum Edxltoken EdxltokenRelationStats, EdxltokenColumnStats, EdxltokenColumnStatsBucket, + EdxltokenRelationExtendedStats, + EdxltokenExtendedStats, + EdxltokenExtendedStatsInfo, + EdxltokenMVDependencyList, + EdxltokenMVDependency, + EdxltokenMVNDistinctList, + EdxltokenMVNDistinct, + EdxltokenDegree, + EdxltokenFrom, + EdxltokenTo, EdxltokenEmptyRelation, EdxltokenIsNull, EdxltokenLintValue, EdxltokenDoubleValue, + EdxltokenAssignedQueryIdForTargetRel, EdxltokenRelTemporary, @@ -478,7 +484,6 @@ enum Edxltoken EdxltokenPartKeys, EdxltokenPartTypes, - EdxltokenNumLeafPartitions, EdxltokenRelDistrPolicy, EdxltokenRelDistrMasterOnly, diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStats.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStats.h new file mode 100644 index 00000000000..f77311d6eee --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStats.h @@ -0,0 +1,112 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CDXLExtStats.h +// +// @doc: +// Class representing extended stats +//--------------------------------------------------------------------------- + + + +#ifndef GPMD_CDXLExtStats_H +#define GPMD_CDXLExtStats_H + +#include "gpos/base.h" +#include "gpos/common/CDouble.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/md/CMDExtStatsInfo.h" +#include "naucrates/md/IMDExtStats.h" + +namespace gpdxl +{ +class CXMLSerializer; +} + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + +//--------------------------------------------------------------------------- +// @class: +// CDXLExtStats +// +// @doc: +// Class representing extended stats +// +//--------------------------------------------------------------------------- +class CDXLExtStats : public IMDExtStats +{ +private: + // memory pool + CMemoryPool *m_mp; + + // metadata id of the object + IMDId *m_rel_stats_mdid; + + // table name + CMDName *m_mdname; + + // DXL string for object + CWStringDynamic *m_dxl_str; + + CMDDependencyArray *m_dependency_array; + + CMDNDistinctArray *m_ndistinct_array; + +public: + CDXLExtStats(const CDXLExtStats &) = delete; + + CDXLExtStats(CMemoryPool *mp, IMDId *rel_stats_mdid, CMDName *mdname, + CMDDependencyArray *extstats_dependency_array, + CMDNDistinctArray *ndistinct_array); + + ~CDXLExtStats() override; + + // the metadata id + IMDId *MDId() const override; + + // relation name + CMDName Mdname() const override; + + // DXL string representation of cache object + const CWStringDynamic *GetStrRepr() const override; + + // serialize relation stats in DXL format given a serializer object + void Serialize(gpdxl::CXMLSerializer *) const override; + + CMDDependencyArray * + GetDependencies() const override + { + return m_dependency_array; + } + + CMDNDistinctArray * + GetNDistinctList() const override + { + return m_ndistinct_array; + } + +#ifdef GPOS_DEBUG + // debug print of the metadata ext stats + void + DebugPrint(IOstream &os GPOS_UNUSED) const override + { + } +#endif + + // dummy relstats + static CDXLExtStats *CreateDXLDummyExtStats(CMemoryPool *mp, IMDId *mdid); +}; + +} // namespace gpmd + + + +#endif // !GPMD_CDXLExtStats_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStatsInfo.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStatsInfo.h new file mode 100644 index 00000000000..780ba5c0bf9 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CDXLExtStatsInfo.h @@ -0,0 +1,104 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CDXLExtStatsInfo.h +// +// @doc: +// Class representing extended stats metadata +//--------------------------------------------------------------------------- + + + +#ifndef GPMD_CDXLExtStatsInfo_H +#define GPMD_CDXLExtStatsInfo_H + +#include "gpos/base.h" +#include "gpos/common/CDouble.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/md/CMDExtStatsInfo.h" +#include "naucrates/md/IMDExtStatsInfo.h" + +namespace gpdxl +{ +class CXMLSerializer; +} + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + +//--------------------------------------------------------------------------- +// @class: +// CDXLExtStatsInfo +// +// @doc: +// Class representing extended stats metadata +// +//--------------------------------------------------------------------------- +class CDXLExtStatsInfo : public IMDExtStatsInfo +{ +private: + // memory pool + CMemoryPool *m_mp; + + // metadata id of the object + IMDId *m_mdid; + + // table name + CMDName *m_mdname; + + // DXL string for object + CWStringDynamic *m_dxl_str; + + CMDExtStatsInfoArray *m_extstats_info_array; + +public: + CDXLExtStatsInfo(const CDXLExtStatsInfo &) = delete; + + CDXLExtStatsInfo(CMemoryPool *mp, IMDId *rel_stats_mdid, CMDName *mdname, + CMDExtStatsInfoArray *extstats_info_array); + + ~CDXLExtStatsInfo() override; + + // the metadata id + IMDId *MDId() const override; + + // relation name + CMDName Mdname() const override; + + // DXL string representation of cache object + const CWStringDynamic *GetStrRepr() const override; + + // serialize relation stats in DXL format given a serializer object + void Serialize(gpdxl::CXMLSerializer *) const override; + + CMDExtStatsInfoArray * + GetExtStatInfoArray() const override + { + return m_extstats_info_array; + } + +#ifdef GPOS_DEBUG + // debug print of the metadata ext stats metadata + void + DebugPrint(IOstream &os GPOS_UNUSED) const override + { + } +#endif + + // dummy relstats + static CDXLExtStatsInfo *CreateDXLDummyExtStatsInfo(CMemoryPool *mp, + IMDId *mdid); +}; + +} // namespace gpmd + + + +#endif // !GPMD_CDXLExtStatsInfo_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDDependency.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDDependency.h new file mode 100644 index 00000000000..a9753c35535 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDDependency.h @@ -0,0 +1,131 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CMDDependency.h +// +// @doc: +// Class representing MD extended stats depencency. +// +// The structure mirrors MVDependency in statistics.h. One noticable +// difference is that that in CMDDependency the attributes are split into +// "from" and "to" attributes. Whereas MVDependency it is a single array +// where the last indexed attnum is infered to be the "to" attribute. +//--------------------------------------------------------------------------- + + + +#ifndef GPMD_CMDDependency_H +#define GPMD_CMDDependency_H + +#include "gpos/base.h" +#include "gpos/common/CDouble.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/xml/CXMLSerializer.h" + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + + +class CMDDependency : public CRefCount +{ +private: + // memory pool + CMemoryPool *m_mp; + + CDouble m_degree; + + IntPtrArray *m_from_attno; + + INT m_to_attno; + +public: + CMDDependency(CMemoryPool *mp, DOUBLE degree, IntPtrArray *from_attno, + INT to_attno) + : m_mp(mp), + m_degree(degree), + m_from_attno(from_attno), + m_to_attno(to_attno) + { + } + + ~CMDDependency() override + { + m_from_attno->Release(); + } + + CWStringDynamic * + FromAttnosToStr() + { + CWStringDynamic *str = GPOS_NEW(m_mp) CWStringDynamic(m_mp); + + ULONG size = m_from_attno->Size(); + for (ULONG i = 0; i < size - 1; i++) + { + str->AppendFormat(GPOS_WSZ_LIT("%d,"), *(*m_from_attno)[i]); + } + str->AppendFormat(GPOS_WSZ_LIT("%d"), *(*m_from_attno)[size - 1]); + + return str; + } + + // serialize metadata dependency in DXL format given a serializer object + void + Serialize(gpdxl::CXMLSerializer *xml_serializer) + { + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVDependency)); + + xml_serializer->AddAttribute( + CDXLTokens::GetDXLTokenStr(EdxltokenDegree), m_degree); + CWStringDynamic *from_attnos_str = FromAttnosToStr(); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenFrom), + from_attnos_str); + GPOS_DELETE(from_attnos_str); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenTo), + m_to_attno); + + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVDependency)); + } + + IntPtrArray * + GetFromAttno() const + { + return m_from_attno; + } + + INT + GetToAttno() const + { + return m_to_attno; + } + + CDouble + GetDegree() const + { + return m_degree; + } + + ULONG + GetNAttributes() const + + { + return m_from_attno->Size() + 1; + } +}; + +using CMDDependencyArray = CDynamicPtrArray; +} // namespace gpmd + + + +#endif // !GPMD_CMDDependency_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDExtStatsInfo.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDExtStatsInfo.h new file mode 100644 index 00000000000..fb2e6878a79 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDExtStatsInfo.h @@ -0,0 +1,111 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CMDExtStatsInfo.h +// +// @doc: +// Class representing MD extended stats metadata +// +// The structure mirrors StatisticExtInfo in pathnodes.h +//--------------------------------------------------------------------------- + + + +#ifndef GPMD_CMDExtStatsInfo_H +#define GPMD_CMDExtStatsInfo_H + +#include "gpos/base.h" +#include "gpos/common/CBitSet.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/gpdb_types.h" +#include "naucrates/md/CMDName.h" + +namespace gpdxl +{ +class CXMLSerializer; +} + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + + +class CMDExtStatsInfo : public CRefCount +{ +public: + enum Estattype + { + EstatDependencies, + EstatNDistinct, + EstatMCV, + EstatExpr, + EstatSentinel + }; + +private: + CMemoryPool *m_mp; + + OID m_stat_oid; + + CMDName *m_stat_name; + + Estattype m_kind; + + CBitSet *m_keys; + +public: + CMDExtStatsInfo(CMemoryPool *mp, OID stat_oid, CMDName *stat_name, + Estattype kind, CBitSet *keys) + : m_mp(mp), + m_stat_oid(stat_oid), + m_stat_name(stat_name), + m_kind(kind), + m_keys(keys) + { + } + + ~CMDExtStatsInfo() override + { + GPOS_DELETE(m_stat_name); + m_keys->Release(); + } + + CWStringDynamic *KeysToStr(CMemoryPool *mp); + + CWStringDynamic *KindToStr(CMemoryPool *mp); + + void Serialize(gpdxl::CXMLSerializer *xml_serializer); + + OID + GetStatOid() const + { + return m_stat_oid; + } + + Estattype + GetStatKind() const + { + return m_kind; + } + + CBitSet * + GetStatKeys() const + { + return m_keys; + } +}; + + +using CMDExtStatsInfoArray = CDynamicPtrArray; + +} // namespace gpmd + + + +#endif // !GPMD_CMDExtStatsInfo_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDIndexGPDB.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDIndexGPDB.h index 5694493968b..ccdebe592d0 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDIndexGPDB.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDIndexGPDB.h @@ -67,11 +67,6 @@ class CMDIndexGPDB : public IMDIndex // operator families for each index key IMdIdArray *m_mdid_opfamilies_array; - // partition constraint - // GPDB_12_MERGE_FIXME: This field is no longer needed, - // we should get rid of it. - IMDPartConstraint *m_mdpart_constraint; - // DXL for object const CWStringDynamic *m_dxl_str; @@ -88,7 +83,6 @@ class CMDIndexGPDB : public IMDIndex ULongPtrArray *index_key_cols_array, ULongPtrArray *included_cols_array, IMdIdArray *mdid_opfamilies_array, - IMDPartConstraint *mdpart_constraint, IMdIdArray *child_index_oids); // dtor @@ -127,9 +121,6 @@ class CMDIndexGPDB : public IMDIndex // return the position of the included column ULONG GetIncludedColPos(ULONG column) const override; - // part constraint - IMDPartConstraint *MDPartConstraint() const override; - // DXL string for index const CWStringDynamic * GetStrRepr() const override diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDNDistinct.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDNDistinct.h new file mode 100644 index 00000000000..e3186c3ce35 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDNDistinct.h @@ -0,0 +1,116 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CMDNDistinct.h +// +// @doc: +// Class representing MD extended stats multivariate n-distinct. +// +// The structure mirrors MVNDistinct in statistics.h +//--------------------------------------------------------------------------- + + + +#ifndef GPMD_CMDNDistinct_H +#define GPMD_CMDNDistinct_H + +#include "gpos/base.h" +#include "gpos/common/CBitSetIter.h" +#include "gpos/common/CDouble.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/xml/CXMLSerializer.h" + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + + +class CMDNDistinct : public CRefCount +{ +private: + // memory pool + CMemoryPool *m_mp; + + CDouble m_ndistnct_value; + + CBitSet *m_attrs; + +public: + CMDNDistinct(CMemoryPool *mp, DOUBLE ndistinct_value, CBitSet *attrs) + : m_mp(mp), m_ndistnct_value(ndistinct_value), m_attrs(attrs) + { + } + + ~CMDNDistinct() override + { + m_attrs->Release(); + } + + CWStringDynamic * + AttrsToStr() + { + CWStringDynamic *str = GPOS_NEW(m_mp) CWStringDynamic(m_mp); + CBitSetIter bsiter(*m_attrs); + + ULONG count = m_attrs->Size(); + while (bsiter.Advance()) + { + if (--count > 0) + { + str->AppendFormat(GPOS_WSZ_LIT("%d,"), bsiter.Bit()); + } + else + { + str->AppendFormat(GPOS_WSZ_LIT("%d"), bsiter.Bit()); + } + } + + return str; + } + + // serialize metadata dependency in DXL format given a serializer object + void + Serialize(gpdxl::CXMLSerializer *xml_serializer) + { + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVNDistinct)); + + xml_serializer->AddAttribute( + CDXLTokens::GetDXLTokenStr(EdxltokenMVNDistinct), m_ndistnct_value); + + CWStringDynamic *attnos_str = AttrsToStr(); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenAttno), + attnos_str); + GPOS_DELETE(attnos_str); + + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVNDistinct)); + } + + CBitSet * + GetAttrs() const + { + return m_attrs; + } + + CDouble + GetNDistinct() const + { + return m_ndistnct_value; + } +}; + +using CMDNDistinctArray = CDynamicPtrArray; +} // namespace gpmd + + + +#endif // !GPMD_CMDNDistinct_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDRelationGPDB.h b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDRelationGPDB.h index f658e5c64c8..90a313afc60 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/CMDRelationGPDB.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/CMDRelationGPDB.h @@ -85,9 +85,6 @@ class CMDRelationGPDB : public IMDRelation // partition types CharPtrArray *m_str_part_types_array; - // number of partition - ULONG m_num_of_partitions; - // Child partition oids IMdIdArray *m_partition_oids; @@ -128,9 +125,9 @@ class CMDRelationGPDB : public IMDRelation Erelstoragetype rel_storage_type, Ereldistrpolicy rel_distr_policy, CMDColumnArray *mdcol_array, ULongPtrArray *distr_col_array, IMdIdArray *distr_opfamilies, ULongPtrArray *partition_cols_array, - CharPtrArray *str_part_types_array, ULONG num_of_partitions, - IMdIdArray *partition_oids, BOOL convert_hash_to_random, - ULongPtr2dArray *keyset_array, CMDIndexInfoArray *md_index_info_array, + CharPtrArray *str_part_types_array, IMdIdArray *partition_oids, + BOOL convert_hash_to_random, ULongPtr2dArray *keyset_array, + CMDIndexInfoArray *md_index_info_array, IMdIdArray *mdid_check_constraint_array, CDXLNode *mdpart_constraint); // dtor @@ -208,9 +205,6 @@ class CMDRelationGPDB : public IMDRelation // number of partition keys ULONG PartColumnCount() const override; - // number of partitions - ULONG PartitionCount() const override; - // retrieve the partition key column at the given position const IMDColumn *PartColAt(ULONG pos) const override; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDCacheObject.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDCacheObject.h index 199bd04d3a7..da77ded97c9 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDCacheObject.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDCacheObject.h @@ -72,6 +72,8 @@ class IMDCacheObject : public IMDInterface EmdtColStats, EmdtCastFunc, EmdtScCmp, + EmdtExtStats, + EmdtExtStatsInfo, EmdtSentinel }; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStats.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStats.h new file mode 100644 index 00000000000..43f2a6e2dfb --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStats.h @@ -0,0 +1,60 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// IMDExtStats.h +// +// @doc: +// Interface for extended statistic in the metadata cache +//--------------------------------------------------------------------------- + +#ifndef GPMD_IMDExtStats_H +#define GPMD_IMDExtStats_H + +#include "gpos/base.h" + +#include "naucrates/md/CMDDependency.h" +#include "naucrates/md/CMDNDistinct.h" +#include "naucrates/md/IMDCacheObject.h" +#include "naucrates/statistics/IStatistics.h" + +namespace gpdxl +{ +//fwd declaration +class CXMLSerializer; +} // namespace gpdxl + +namespace gpmd +{ +using namespace gpos; + +//--------------------------------------------------------------------------- +// @class: +// IMDExtStats +// +// @doc: +// Interface for extended statistic in the metadata cache +// +//--------------------------------------------------------------------------- +class IMDExtStats : public IMDCacheObject +{ +public: + Emdtype + MDType() const override + { + return EmdtExtStats; + } + + virtual CMDDependencyArray *GetDependencies() const = 0; + + virtual CMDNDistinctArray *GetNDistinctList() const = 0; +}; + +} // namespace gpmd + + + +#endif // !GPMD_IMDExtStats_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStatsInfo.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStatsInfo.h new file mode 100644 index 00000000000..e39566645a7 --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDExtStatsInfo.h @@ -0,0 +1,49 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// IMDExtStatsInfo.h +// +// @doc: +// Interface for extended statistic metadata in the metadata cache +//--------------------------------------------------------------------------- +#ifndef GPMD_IMDExtStatsInfo_H +#define GPMD_IMDExtStatsInfo_H + +#include "gpos/base.h" +#include "gpos/common/CDouble.h" + +#include "naucrates/md/CMDExtStatsInfo.h" +#include "naucrates/md/IMDCacheObject.h" + +namespace gpmd +{ +using namespace gpos; +using namespace gpdxl; + +//--------------------------------------------------------------------------- +// @class: +// IMDExtStatsInfo +// +// @doc: +// Interface for extended statistic metadata in the metadata cache +// +//--------------------------------------------------------------------------- +class IMDExtStatsInfo : public IMDCacheObject +{ +public: + // object type + Emdtype + MDType() const override + { + return EmdtExtStatsInfo; + } + + virtual CMDExtStatsInfoArray *GetExtStatInfoArray() const = 0; +}; +} // namespace gpmd + +#endif // !GPMD_IMDExtStatsInfo_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDId.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDId.h index ffe4e511509..a9e15adc975 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDId.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDId.h @@ -77,6 +77,8 @@ class IMDId : public CRefCount, public DbgPrintMixin EmdidRel = 6, EmdidInd = 7, EmdidCheckConstraint = 8, + EmdidExtStats = 9, + EmdidExtStatsInfo = 10, EmdidSentinel }; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDIndex.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDIndex.h index 356e6fb39e1..749f7f4c093 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDIndex.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDIndex.h @@ -82,9 +82,6 @@ class IMDIndex : public IMDCacheObject // return the position of the included column virtual ULONG GetIncludedColPos(ULONG column) const = 0; - // part constraint - virtual IMDPartConstraint *MDPartConstraint() const = 0; - // type id of items returned by the index virtual IMDId *GetIndexRetItemTypeMdid() const = 0; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelation.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelation.h index 73ef2a8c3c0..eb843a77350 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelation.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelation.h @@ -148,9 +148,6 @@ class IMDRelation : public IMDCacheObject // number of partition columns virtual ULONG PartColumnCount() const = 0; - // number of partitions - virtual ULONG PartitionCount() const = 0; - // retrieve the partition column at the given position virtual const IMDColumn *PartColAt(ULONG pos) const = 0; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelationCtas.h b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelationCtas.h index 60390a0f26d..18aa6b8e30c 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelationCtas.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/md/IMDRelationCtas.h @@ -54,13 +54,6 @@ class IMDRelationCtas : public IMDRelation return 0; } - // number of partitions - ULONG - PartitionCount() const override - { - return 0; - } - // retrieve the partition column at the given position const IMDColumn *PartColAt(ULONG // pos ) const override diff --git a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CExtendedStatsProcessor.h b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CExtendedStatsProcessor.h new file mode 100644 index 00000000000..6c04520f17a --- /dev/null +++ b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CExtendedStatsProcessor.h @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware, Inc. or its affiliates. +// +// @filename: +// CExtendedStatsProcessor.h +// +// @doc: +// Compute extended statistics +//--------------------------------------------------------------------------- +#ifndef GPNAUCRATES_CExtendedStatsProcessor_H +#define GPNAUCRATES_CExtendedStatsProcessor_H + + +#include "naucrates/statistics/CStatistics.h" + +namespace gpnaucrates +{ +class CExtendedStatsProcessor +{ +public: + static void ApplyCorrelatedStatsToScaleFactorFilterCalculation( + CDoubleArray *scale_factors, CStatsPredConj *conjunctive_pred_stats, + const IMDExtStatsInfo *md_statsinfo, + UlongToIntMap *colid_to_attno_mapping, CMemoryPool *mp, + UlongToHistogramMap *result_histograms); + + static bool ApplyCorrelatedStatsToNDistinctCalculation( + CMemoryPool *mp, const IMDExtStatsInfo *md_statsinfo, + const UlongToIntMap *colid_to_attno_mapping, + ULongPtrArray *&src_grouping_cols, DOUBLE *ndistinct); +}; +} // namespace gpnaucrates + +#endif // !GPNAUCRATES_CExtendedStatsProcessor_H + +// EOF diff --git a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CFilterStatsProcessor.h b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CFilterStatsProcessor.h index c9200e5c682..bdd9c77e5d5 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CFilterStatsProcessor.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CFilterStatsProcessor.h @@ -64,19 +64,22 @@ class CFilterStatsProcessor static UlongToHistogramMap *MakeHistHashMapConjOrDisjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *input_histograms, CDouble input_rows, - CStatsPred *pred_stats, CDouble *scale_factor); + CStatsPred *pred_stats, CDouble *scale_factor, + const CStatistics *input_stats); // create new hash map of histograms after applying the conjunction predicate static UlongToHistogramMap *MakeHistHashMapConjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *intermediate_histograms, CDouble input_rows, - CStatsPredConj *conjunctive_pred_stats, CDouble *scale_factor); + CStatsPredConj *conjunctive_pred_stats, CDouble *scale_factor, + const CStatistics *input_stats); // create new hash map of histograms after applying the disjunctive predicate static UlongToHistogramMap *MakeHistHashMapDisjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *input_histograms, CDouble input_rows, - CStatsPredDisj *pred_stats, CDouble *scale_factor); + CStatsPredDisj *pred_stats, CDouble *scale_factor, + const CStatistics *input_stats); // check if the column is a new column for statistic calculation static BOOL IsNewStatsColumn(ULONG colid, ULONG last_colid); diff --git a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatistics.h b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatistics.h index bf6be0a1b44..f580fb10fb4 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatistics.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatistics.h @@ -15,6 +15,7 @@ #include "gpos/common/CBitSet.h" #include "gpos/string/CWStringDynamic.h" +#include "naucrates/md/IMDExtStatsInfo.h" #include "naucrates/statistics/CHistogram.h" #include "naucrates/statistics/CStatsPredArrayCmp.h" #include "naucrates/statistics/CStatsPredConj.h" @@ -37,6 +38,10 @@ using namespace gpdxl; using namespace gpmd; using namespace gpopt; +using UlongToIntMap = + CHashMap, gpos::Equals, + CleanupDelete, CleanupDelete>; + // hash maps ULONG -> array of ULONGs using UlongToUlongPtrArrayMap = CHashMap, gpos::Equals, @@ -113,6 +118,12 @@ class CStatistics : public IStatistics, public DbgPrintMixin // source can be one of the following operators: like Get, Group By, and Project CUpperBoundNDVPtrArray *m_src_upper_bound_NDVs; + // extended statistics metadata + const IMDExtStatsInfo *m_ext_stats; + + // map colid to attno (required because extended stats are stored as attno) + UlongToIntMap *m_colid_to_attno_mapping; + // the default value for operators that have no cardinality estimation risk static const ULONG no_card_est_risk_default_val; @@ -144,7 +155,9 @@ class CStatistics : public IStatistics, public DbgPrintMixin CStatistics(CMemoryPool *mp, UlongToHistogramMap *col_histogram_mapping, UlongToDoubleMap *colid_width_mapping, CDouble rows, BOOL is_empty, ULONG relpages, ULONG relallvisible, - CDouble rebinds, ULONG num_predicates); + CDouble rebinds, ULONG num_predicates, + const IMDExtStatsInfo *extstats, + UlongToIntMap *colid_to_attno_mapping); // dtor @@ -314,6 +327,19 @@ class CStatistics : public IStatistics, public DbgPrintMixin { return m_src_upper_bound_NDVs; } + + const IMDExtStatsInfo * + GetExtStatsInfo() const + { + return m_ext_stats; + } + + UlongToIntMap * + GetColidToAttnoMapping() const + { + return m_colid_to_attno_mapping; + } + // create an empty statistics object static CStatistics * MakeEmptyStats(CMemoryPool *mp) diff --git a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatsPred.h b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatsPred.h index 40b22e42c2d..7b37bc23c96 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatsPred.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/statistics/CStatsPred.h @@ -64,6 +64,10 @@ class CStatsPred : public CRefCount // column id ULONG m_colid; + // CStatsPred is recursively traversed to compute cardinality estimates for + // extended stat. This prevents infinite loop or double count in recursion. + BOOL m_is_estimated{false}; + public: CStatsPred &operator=(CStatsPred &) = delete; @@ -84,6 +88,18 @@ class CStatsPred : public CRefCount return m_colid; } + BOOL + IsAlreadyUsedInScaleFactorEstimation() const + { + return m_is_estimated; + } + + void + SetEstimated() + { + m_is_estimated = true; + } + // type id virtual EStatsPredType GetPredStatsType() const = 0; diff --git a/src/backend/gporca/libnaucrates/include/naucrates/traceflags/traceflags.h b/src/backend/gporca/libnaucrates/include/naucrates/traceflags/traceflags.h index d1bc807e8d7..f8c8ccc57c0 100644 --- a/src/backend/gporca/libnaucrates/include/naucrates/traceflags/traceflags.h +++ b/src/backend/gporca/libnaucrates/include/naucrates/traceflags/traceflags.h @@ -218,6 +218,9 @@ enum EOptTraceFlag // Enable use the distribution key in DQA EopttraceEnableUseDistributionInDQA = 103042, + // Discard HashJoin with RedistributeMotion nodes + EopttraceDiscardRedistributeHashJoin = 103044, + /////////////////////////////////////////////////////// ///////////////////// statistics flags //////////////// ////////////////////////////////////////////////////// diff --git a/src/backend/gporca/libnaucrates/src/md/CDXLExtStats.cpp b/src/backend/gporca/libnaucrates/src/md/CDXLExtStats.cpp new file mode 100644 index 00000000000..87c4742eab3 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/md/CDXLExtStats.cpp @@ -0,0 +1,172 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CDXLExtStats.cpp +// +// @doc: +// Implementation of the class for representing extended stats in DXL +//--------------------------------------------------------------------------- + + +#include "naucrates/md/CDXLExtStats.h" + +#include "gpos/common/CAutoP.h" +#include "gpos/common/CAutoRef.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/CDXLUtils.h" +#include "naucrates/dxl/xml/CXMLSerializer.h" + +using namespace gpdxl; +using namespace gpmd; + +CDXLExtStats::CDXLExtStats(CMemoryPool *mp, IMDId *rel_stats_mdid, + CMDName *mdname, + CMDDependencyArray *extstats_dependency_array, + CMDNDistinctArray *ndistinct_array) + : m_mp(mp), + m_rel_stats_mdid(rel_stats_mdid), + m_mdname(mdname), + m_dependency_array(extstats_dependency_array), + m_ndistinct_array(ndistinct_array) +{ + GPOS_ASSERT(rel_stats_mdid->IsValid()); + m_dxl_str = CDXLUtils::SerializeMDObj( + m_mp, this, false /*fSerializeHeader*/, false /*indentation*/); +} + +CDXLExtStats::~CDXLExtStats() +{ + GPOS_DELETE(m_mdname); + GPOS_DELETE(m_dxl_str); + m_rel_stats_mdid->Release(); + m_dependency_array->Release(); + m_ndistinct_array->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStats::MDId +// +// @doc: +// Returns the metadata id of this extended stats object +// +//--------------------------------------------------------------------------- +IMDId * +CDXLExtStats::MDId() const +{ + return m_rel_stats_mdid; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStats::Mdname +// +// @doc: +// Returns the name of this relation +// +//--------------------------------------------------------------------------- +CMDName +CDXLExtStats::Mdname() const +{ + return *m_mdname; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStats::GetMDName +// +// @doc: +// Returns the DXL string for this object +// +//--------------------------------------------------------------------------- +const CWStringDynamic * +CDXLExtStats::GetStrRepr() const +{ + return m_dxl_str; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStats::Serialize +// +// @doc: +// Serialize extended stats in DXL format +// +//--------------------------------------------------------------------------- +void +CDXLExtStats::Serialize(CXMLSerializer *xml_serializer) const +{ + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenExtendedStats)); + + m_rel_stats_mdid->Serialize(xml_serializer, + CDXLTokens::GetDXLTokenStr(EdxltokenMdid)); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenName), + m_mdname->GetMDName()); + + // serialize dependencies + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVDependencyList)); + for (ULONG i = 0; i < m_dependency_array->Size(); i++) + { + (*m_dependency_array)[i]->Serialize(xml_serializer); + } + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVDependencyList)); + + // serialize ndistincts + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVNDistinctList)); + for (ULONG i = 0; i < m_ndistinct_array->Size(); i++) + { + (*m_ndistinct_array)[i]->Serialize(xml_serializer); + } + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenMVNDistinctList)); + + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenExtendedStats)); + + GPOS_CHECK_ABORT; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStats::CreateDXLDummyExtStats +// +// @doc: +// Dummy extended stats +// +//--------------------------------------------------------------------------- +CDXLExtStats * +CDXLExtStats::CreateDXLDummyExtStats(CMemoryPool *mp, IMDId *mdid) +{ + CAutoP str; + str = GPOS_NEW(mp) CWStringDynamic(mp, mdid->GetBuffer()); + CAutoP mdname; + mdname = GPOS_NEW(mp) CMDName(mp, str.Value()); + CAutoRef ext_stats_dxl; + + CMDDependencyArray *extstats_dependency_array = + GPOS_NEW(mp) CMDDependencyArray(mp); + + CMDNDistinctArray *extstats_ndistinct_array = + GPOS_NEW(mp) CMDNDistinctArray(mp); + + ext_stats_dxl = GPOS_NEW(mp) + CDXLExtStats(mp, mdid, mdname.Value(), extstats_dependency_array, + extstats_ndistinct_array); + mdname.Reset(); + return ext_stats_dxl.Reset(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/md/CDXLExtStatsInfo.cpp b/src/backend/gporca/libnaucrates/src/md/CDXLExtStatsInfo.cpp new file mode 100644 index 00000000000..349a2102700 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/md/CDXLExtStatsInfo.cpp @@ -0,0 +1,148 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CDXLExtStatsInfo.cpp +// +// @doc: +// Implementation of the class for representing extended stats metadata in +// DXL +//--------------------------------------------------------------------------- + + +#include "naucrates/md/CDXLExtStatsInfo.h" + +#include "gpos/common/CAutoP.h" +#include "gpos/common/CAutoRef.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/CDXLUtils.h" +#include "naucrates/dxl/xml/CXMLSerializer.h" + +using namespace gpdxl; +using namespace gpmd; + +CDXLExtStatsInfo::CDXLExtStatsInfo(CMemoryPool *mp, IMDId *mdid, + CMDName *mdname, + CMDExtStatsInfoArray *extstats_info_array) + : m_mp(mp), + m_mdid(mdid), + m_mdname(mdname), + m_extstats_info_array(extstats_info_array) +{ + GPOS_ASSERT(mdid->IsValid()); + m_dxl_str = CDXLUtils::SerializeMDObj( + m_mp, this, false /*fSerializeHeader*/, false /*indentation*/); +} + +CDXLExtStatsInfo::~CDXLExtStatsInfo() +{ + GPOS_DELETE(m_mdname); + GPOS_DELETE(m_dxl_str); + m_mdid->Release(); + m_extstats_info_array->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStatsInfo::MDId +// +// @doc: +// Returns the metadata id of this extended stats metadata object +// +//--------------------------------------------------------------------------- +IMDId * +CDXLExtStatsInfo::MDId() const +{ + return m_mdid; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStatsInfo::Mdname +// +// @doc: +// Returns the name of this statistic +// +//--------------------------------------------------------------------------- +CMDName +CDXLExtStatsInfo::Mdname() const +{ + return *m_mdname; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStatsInfo::GetMDName +// +// @doc: +// Returns the DXL string for this object +// +//--------------------------------------------------------------------------- +const CWStringDynamic * +CDXLExtStatsInfo::GetStrRepr() const +{ + return m_dxl_str; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStatsInfo::Serialize +// +// @doc: +// Serialize extended stats info in DXL format +// +//--------------------------------------------------------------------------- +void +CDXLExtStatsInfo::Serialize(CXMLSerializer *xml_serializer) const +{ + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenRelationExtendedStats)); + + m_mdid->Serialize(xml_serializer, + CDXLTokens::GetDXLTokenStr(EdxltokenMdid)); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenName), + m_mdname->GetMDName()); + + // serialize stat infos + for (ULONG i = 0; i < m_extstats_info_array->Size(); i++) + { + (*m_extstats_info_array)[i]->Serialize(xml_serializer); + } + + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenRelationExtendedStats)); + + GPOS_CHECK_ABORT; +} + +//--------------------------------------------------------------------------- +// @function: +// CDXLExtStatsInfo::CreateDXLDummyExtStatsInfo +// +// @doc: +// Dummy extended stats info +// +//--------------------------------------------------------------------------- +CDXLExtStatsInfo * +CDXLExtStatsInfo::CreateDXLDummyExtStatsInfo(CMemoryPool *mp, IMDId *mdid) +{ + CAutoP str; + str = GPOS_NEW(mp) CWStringDynamic(mp, mdid->GetBuffer()); + CAutoP mdname; + mdname = GPOS_NEW(mp) CMDName(mp, str.Value()); + CAutoRef ext_stats_info_dxl; + + CMDExtStatsInfoArray *extstats_info_array = + GPOS_NEW(mp) CMDExtStatsInfoArray(mp); + + ext_stats_info_dxl = GPOS_NEW(mp) + CDXLExtStatsInfo(mp, mdid, mdname.Value(), extstats_info_array); + mdname.Reset(); + return ext_stats_info_dxl.Reset(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/md/CMDExtStatsInfo.cpp b/src/backend/gporca/libnaucrates/src/md/CMDExtStatsInfo.cpp new file mode 100644 index 00000000000..a2612af9b23 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/md/CMDExtStatsInfo.cpp @@ -0,0 +1,122 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CMDExtStatsInfo.cpp +// +// @doc: +// Implementation of the class for representing metadata cache ext stats +//--------------------------------------------------------------------------- + + +#include "naucrates/md/CMDExtStatsInfo.h" + +#include "gpos/common/CBitSetIter.h" +#include "gpos/string/CWStringDynamic.h" + +#include "naucrates/dxl/CDXLUtils.h" +#include "naucrates/dxl/xml/CXMLSerializer.h" +#include "naucrates/exception.h" + +using namespace gpdxl; +using namespace gpmd; + + +CWStringDynamic * +CMDExtStatsInfo::KeysToStr(CMemoryPool *mp) +{ + CWStringDynamic *str = GPOS_NEW(mp) CWStringDynamic(mp); + + ULONG length = m_keys->Size(); + ULONG ul = 0; + + CBitSetIter bsi(*m_keys); + while (bsi.Advance()) + { + const ULONG attno = bsi.Bit(); + if (ul == length - 1) + { + // last element: do not print a comma + str->AppendFormat(GPOS_WSZ_LIT("%d"), attno); + } + else + { + str->AppendFormat( + GPOS_WSZ_LIT("%d%ls"), attno, + CDXLTokens::GetDXLTokenStr(EdxltokenComma)->GetBuffer()); + } + ul += 1; + } + + return str; +} + + +CWStringDynamic * +CMDExtStatsInfo::KindToStr(CMemoryPool *mp) +{ + CWStringDynamic *str = GPOS_NEW(mp) CWStringDynamic(mp); + + switch (m_kind) + { + case Estattype::EstatDependencies: + { + str->AppendFormat(GPOS_WSZ_LIT("MVDependency")); + break; + } + case Estattype::EstatNDistinct: + { + str->AppendFormat(GPOS_WSZ_LIT("MVNDistinct")); + break; + } + case Estattype::EstatMCV: + { + str->AppendFormat(GPOS_WSZ_LIT("MVMCV")); + break; + } + default: + { + // unexpected type + GPOS_ASSERT(false && "Unknown extended stat type"); + break; + } + } + + return str; +} + + +void +CMDExtStatsInfo::Serialize(CXMLSerializer *xml_serializer) +{ + GPOS_CHECK_ABORT; + + xml_serializer->OpenElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenExtendedStatsInfo)); + + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenOid), + m_stat_oid); + + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenName), + m_stat_name->GetMDName()); + + CWStringDynamic *keys = KeysToStr(m_mp); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenKeys), + keys); + GPOS_DELETE(keys); + + CWStringDynamic *kind = KindToStr(m_mp); + xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenKind), + kind); + GPOS_DELETE(kind); + + xml_serializer->CloseElement( + CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), + CDXLTokens::GetDXLTokenStr(EdxltokenExtendedStatsInfo)); + + GPOS_CHECK_ABORT; +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/md/CMDIndexGPDB.cpp b/src/backend/gporca/libnaucrates/src/md/CMDIndexGPDB.cpp index 82e9f59e5dd..d46b1e61b80 100644 --- a/src/backend/gporca/libnaucrates/src/md/CMDIndexGPDB.cpp +++ b/src/backend/gporca/libnaucrates/src/md/CMDIndexGPDB.cpp @@ -18,7 +18,6 @@ #include "naucrates/dxl/xml/CXMLSerializer.h" #include "naucrates/exception.h" #include "naucrates/md/CMDRelationGPDB.h" -#include "naucrates/md/IMDPartConstraint.h" #include "naucrates/md/IMDScalarOp.h" using namespace gpdxl; @@ -38,7 +37,6 @@ CMDIndexGPDB::CMDIndexGPDB(CMemoryPool *mp, IMDId *mdid, CMDName *mdname, ULongPtrArray *index_key_cols_array, ULongPtrArray *included_cols_array, IMdIdArray *mdid_opfamilies_array, - IMDPartConstraint *mdpart_constraint, IMdIdArray *child_index_oids) : m_mp(mp), m_mdid(mdid), @@ -50,7 +48,6 @@ CMDIndexGPDB::CMDIndexGPDB(CMemoryPool *mp, IMDId *mdid, CMDName *mdname, m_index_key_cols_array(index_key_cols_array), m_included_cols_array(included_cols_array), m_mdid_opfamilies_array(mdid_opfamilies_array), - m_mdpart_constraint(mdpart_constraint), m_child_index_oids(child_index_oids) { GPOS_ASSERT(mdid->IsValid()); @@ -89,7 +86,6 @@ CMDIndexGPDB::~CMDIndexGPDB() m_index_key_cols_array->Release(); m_included_cols_array->Release(); m_mdid_opfamilies_array->Release(); - CRefCount::SafeRelease(m_mdpart_constraint); CRefCount::SafeRelease(m_child_index_oids); } @@ -269,19 +265,6 @@ CMDIndexGPDB::GetIncludedColPos(ULONG column) const return gpos::ulong_max; } -//--------------------------------------------------------------------------- -// @function: -// CMDIndexGPDB::MDPartConstraint -// -// @doc: -// Return the part constraint -// -//--------------------------------------------------------------------------- -IMDPartConstraint * -CMDIndexGPDB::MDPartConstraint() const -{ - return m_mdpart_constraint; -} //--------------------------------------------------------------------------- // @function: @@ -332,11 +315,6 @@ CMDIndexGPDB::Serialize(CXMLSerializer *xml_serializer) const CDXLTokens::GetDXLTokenStr(EdxltokenOpfamilies), CDXLTokens::GetDXLTokenStr(EdxltokenOpfamily)); - if (nullptr != m_mdpart_constraint) - { - m_mdpart_constraint->Serialize(xml_serializer); - } - if (IsPartitioned()) { SerializeMDIdList(xml_serializer, m_child_index_oids, diff --git a/src/backend/gporca/libnaucrates/src/md/CMDProviderMemory.cpp b/src/backend/gporca/libnaucrates/src/md/CMDProviderMemory.cpp index 2d8953877b0..efa32c80d70 100644 --- a/src/backend/gporca/libnaucrates/src/md/CMDProviderMemory.cpp +++ b/src/backend/gporca/libnaucrates/src/md/CMDProviderMemory.cpp @@ -23,6 +23,7 @@ #include "naucrates/dxl/CDXLUtils.h" #include "naucrates/exception.h" #include "naucrates/md/CDXLColStats.h" +#include "naucrates/md/CDXLExtStatsInfo.h" #include "naucrates/md/CDXLRelStats.h" #include "naucrates/md/CMDTypeBoolGPDB.h" #include "naucrates/md/CMDTypeInt4GPDB.h" @@ -191,6 +192,17 @@ CMDProviderMemory::GetMDObjDXLStr(CMemoryPool *mp, false /*findent*/); break; } + case IMDId::EmdidExtStatsInfo: + { + mdid->AddRef(); + CAutoRef a_pdxlrelstats; + a_pdxlrelstats = + CDXLExtStatsInfo::CreateDXLDummyExtStatsInfo(mp, mdid); + a_pstrResult = CDXLUtils::SerializeMDObj( + mp, a_pdxlrelstats.Value(), true /*fSerializeHeaders*/, + false /*findent*/); + break; + } default: { GPOS_RAISE(gpdxl::ExmaMD, gpdxl::ExmiMDCacheEntryNotFound, diff --git a/src/backend/gporca/libnaucrates/src/md/CMDRelationGPDB.cpp b/src/backend/gporca/libnaucrates/src/md/CMDRelationGPDB.cpp index 7d521802b32..b71d1afaa57 100644 --- a/src/backend/gporca/libnaucrates/src/md/CMDRelationGPDB.cpp +++ b/src/backend/gporca/libnaucrates/src/md/CMDRelationGPDB.cpp @@ -34,9 +34,9 @@ CMDRelationGPDB::CMDRelationGPDB( Erelstoragetype rel_storage_type, Ereldistrpolicy rel_distr_policy, CMDColumnArray *mdcol_array, ULongPtrArray *distr_col_array, IMdIdArray *distr_opfamilies, ULongPtrArray *partition_cols_array, - CharPtrArray *str_part_types_array, ULONG num_of_partitions, - IMdIdArray *partition_oids, BOOL convert_hash_to_random, - ULongPtr2dArray *keyset_array, CMDIndexInfoArray *md_index_info_array, + CharPtrArray *str_part_types_array, IMdIdArray *partition_oids, + BOOL convert_hash_to_random, ULongPtr2dArray *keyset_array, + CMDIndexInfoArray *md_index_info_array, IMdIdArray *mdid_check_constraint_array, CDXLNode *mdpart_constraint) : m_mp(mp), m_mdid(mdid), @@ -51,7 +51,6 @@ CMDRelationGPDB::CMDRelationGPDB( m_convert_hash_to_random(convert_hash_to_random), m_partition_cols_array(partition_cols_array), m_str_part_types_array(str_part_types_array), - m_num_of_partitions(num_of_partitions), m_partition_oids(partition_oids), m_keyset_array(keyset_array), m_mdindex_info_array(md_index_info_array), @@ -392,20 +391,6 @@ CMDRelationGPDB::IsPartitioned() const return (0 < PartColumnCount()); } -//--------------------------------------------------------------------------- -// @function: -// CMDRelationGPDB::PartitionCount -// -// @doc: -// number of partitions -// -//--------------------------------------------------------------------------- -ULONG -CMDRelationGPDB::PartitionCount() const -{ - return m_num_of_partitions; -} - //--------------------------------------------------------------------------- // @function: // CMDRelationGPDB::PartColumnCount @@ -669,10 +654,6 @@ CMDRelationGPDB::Serialize(CXMLSerializer *xml_serializer) const m_convert_hash_to_random); } - xml_serializer->AddAttribute( - CDXLTokens::GetDXLTokenStr(EdxltokenNumLeafPartitions), - m_num_of_partitions); - // serialize columns xml_serializer->OpenElement( CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), diff --git a/src/backend/gporca/libnaucrates/src/md/Makefile b/src/backend/gporca/libnaucrates/src/md/Makefile index 7145bf7c16e..9d6c521789f 100644 --- a/src/backend/gporca/libnaucrates/src/md/Makefile +++ b/src/backend/gporca/libnaucrates/src/md/Makefile @@ -13,6 +13,8 @@ include $(top_srcdir)/src/backend/gporca/gporca.mk OBJS = CDXLBucket.o \ CDXLColStats.o \ CDXLRelStats.o \ + CDXLExtStatsInfo.o \ + CDXLExtStats.o \ CDXLStatsDerivedColumn.o \ CDXLStatsDerivedRelation.o \ CMDAggregateGPDB.o \ @@ -20,6 +22,7 @@ OBJS = CDXLBucket.o \ CMDCastGPDB.o \ CMDCheckConstraintGPDB.o \ CMDColumn.o \ + CMDExtStatsInfo.o \ CMDFunctionGPDB.o \ CMDIdCast.o \ CMDIdColStats.o \ diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLOperatorFactory.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLOperatorFactory.cpp index 3fe941921e7..f8001027927 100644 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLOperatorFactory.cpp +++ b/src/backend/gporca/libnaucrates/src/operators/CDXLOperatorFactory.cpp @@ -1535,7 +1535,12 @@ CDXLOperatorFactory::MakeDXLTableDescr(CDXLMemoryManager *dxl_memory_manager, EdxltokenTableDescr); } - return GPOS_NEW(mp) CDXLTableDescr(mp, mdid, mdname, user_id, lockmode); + ULONG assigned_query_id_for_target_rel = ExtractConvertAttrValueToUlong( + dxl_memory_manager, attrs, EdxltokenAssignedQueryIdForTargetRel, + EdxltokenTableDescr, true /* is_optional */, UNASSIGNED_QUERYID); + + return GPOS_NEW(mp) CDXLTableDescr(mp, mdid, mdname, user_id, lockmode, + assigned_query_id_for_target_rel); } //--------------------------------------------------------------------------- @@ -2288,6 +2293,8 @@ CDXLOperatorFactory::MakeMdIdFromStr(CDXLMemoryManager *dxl_memory_manager, case IMDId::EmdidRel: case IMDId::EmdidInd: case IMDId::EmdidCheckConstraint: + case IMDId::EmdidExtStatsInfo: + case IMDId::EmdidExtStats: mdid = GetGPDBMdId(dxl_memory_manager, remaining_tokens, target_attr, target_elem, typ); break; @@ -2932,6 +2939,30 @@ CDXLOperatorFactory::ExtractConvertValuesToArray( target_elem); } +IntPtrArray * +CDXLOperatorFactory::ExtractConvertValuesToIntArray( + CDXLMemoryManager *dxl_memory_manager, const Attributes &attrs, + Edxltoken target_attr, Edxltoken target_elem) +{ + const XMLCh *xml_val = + CDXLOperatorFactory::ExtractAttrValue(attrs, target_attr, target_elem); + + return ExtractIntsToIntArray(dxl_memory_manager, xml_val, target_attr, + target_elem); +} + +CBitSet * +CDXLOperatorFactory::ExtractConvertValuesToIntBitSet( + CDXLMemoryManager *dxl_memory_manager, const Attributes &attrs, + Edxltoken target_attr, Edxltoken target_elem) +{ + const XMLCh *xml_val = + CDXLOperatorFactory::ExtractAttrValue(attrs, target_attr, target_elem); + + return ExtractIntsToIntBitSet(dxl_memory_manager, xml_val, target_attr, + target_elem); +} + //--------------------------------------------------------------------------- // @function: // CDXLOperatorFactory::ExtractConvertMdIdsToArray diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBound.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBound.cpp deleted file mode 100644 index c12409f5cd8..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBound.cpp +++ /dev/null @@ -1,144 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBound.cpp -// -// @doc: -// Implementation of DXL Part Bound expression -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/operators/CDXLScalarPartBound.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::CDXLScalarPartBound -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CDXLScalarPartBound::CDXLScalarPartBound(CMemoryPool *mp, - ULONG partitioning_level, - IMDId *mdid_type, BOOL is_lower_bound) - : CDXLScalar(mp), - m_partitioning_level(partitioning_level), - m_mdid_type(mdid_type), - m_is_lower_bound(is_lower_bound) -{ - GPOS_ASSERT(mdid_type->IsValid()); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::~CDXLScalarPartBound -// -// @doc: -// Dtor -// -//--------------------------------------------------------------------------- -CDXLScalarPartBound::~CDXLScalarPartBound() -{ - m_mdid_type->Release(); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::GetDXLOperator -// -// @doc: -// Operator type -// -//--------------------------------------------------------------------------- -Edxlopid -CDXLScalarPartBound::GetDXLOperator() const -{ - return EdxlopScalarPartBound; -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::GetOpNameStr -// -// @doc: -// Operator name -// -//--------------------------------------------------------------------------- -const CWStringConst * -CDXLScalarPartBound::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBound); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::HasBoolResult -// -// @doc: -// Does the operator return a boolean result -// -//--------------------------------------------------------------------------- -BOOL -CDXLScalarPartBound::HasBoolResult(CMDAccessor *md_accessor) const -{ - return (IMDType::EtiBool == - md_accessor->RetrieveType(m_mdid_type)->GetDatumType()); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::SerializeToDXL -// -// @doc: -// Serialize operator in DXL format -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBound::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - m_mdid_type->Serialize(xml_serializer, - CDXLTokens::GetDXLTokenStr(EdxltokenMDType)); - xml_serializer->AddAttribute( - CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBoundLower), - m_is_lower_bound); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -#ifdef GPOS_DEBUG -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBound::AssertValid -// -// @doc: -// Checks whether operator node is well-structured -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBound::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundInclusion.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundInclusion.cpp deleted file mode 100644 index 7e186f6f495..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundInclusion.cpp +++ /dev/null @@ -1,111 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBoundInclusion.cpp -// -// @doc: -// Implementation of DXL Part bound inclusion expression -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundInclusion::CDXLScalarPartBoundInclusion -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CDXLScalarPartBoundInclusion::CDXLScalarPartBoundInclusion( - CMemoryPool *mp, ULONG partitioning_level, BOOL is_lower_bound) - : CDXLScalar(mp), - m_partitioning_level(partitioning_level), - m_is_lower_bound(is_lower_bound) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundInclusion::GetDXLOperator -// -// @doc: -// Operator type -// -//--------------------------------------------------------------------------- -Edxlopid -CDXLScalarPartBoundInclusion::GetDXLOperator() const -{ - return EdxlopScalarPartBoundInclusion; -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundInclusion::GetOpNameStr -// -// @doc: -// Operator name -// -//--------------------------------------------------------------------------- -const CWStringConst * -CDXLScalarPartBoundInclusion::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBoundInclusion); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundInclusion::SerializeToDXL -// -// @doc: -// Serialize operator in DXL format -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBoundInclusion::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - xml_serializer->AddAttribute( - CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBoundLower), - m_is_lower_bound); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -#ifdef GPOS_DEBUG -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundInclusion::AssertValid -// -// @doc: -// Checks whether operator node is well-structured -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBoundInclusion::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundOpen.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundOpen.cpp deleted file mode 100644 index fad11407a70..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartBoundOpen.cpp +++ /dev/null @@ -1,112 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartBoundOpen.cpp -// -// @doc: -// Implementation of DXL Part bound openness expression -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/operators/CDXLScalarPartBoundOpen.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundOpen::CDXLScalarPartBoundOpen -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CDXLScalarPartBoundOpen::CDXLScalarPartBoundOpen(CMemoryPool *mp, - ULONG partitioning_level, - BOOL is_lower_bound) - : CDXLScalar(mp), - m_partitioning_level(partitioning_level), - m_is_lower_bound(is_lower_bound) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundOpen::GetDXLOperator -// -// @doc: -// Operator type -// -//--------------------------------------------------------------------------- -Edxlopid -CDXLScalarPartBoundOpen::GetDXLOperator() const -{ - return EdxlopScalarPartBoundOpen; -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundOpen::GetOpNameStr -// -// @doc: -// Operator name -// -//--------------------------------------------------------------------------- -const CWStringConst * -CDXLScalarPartBoundOpen::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBoundOpen); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundOpen::SerializeToDXL -// -// @doc: -// Serialize operator in DXL format -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBoundOpen::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - xml_serializer->AddAttribute( - CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartBoundLower), - m_is_lower_bound); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -#ifdef GPOS_DEBUG -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartBoundOpen::AssertValid -// -// @doc: -// Checks whether operator node is well-structured -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartBoundOpen::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartDefault.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartDefault.cpp deleted file mode 100644 index 2def43bacb5..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartDefault.cpp +++ /dev/null @@ -1,106 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CDXLScalarPartDefault.cpp -// -// @doc: -// Implementation of DXL Part Default expression -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/operators/CDXLScalarPartDefault.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartDefault::CDXLScalarPartDefault -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CDXLScalarPartDefault::CDXLScalarPartDefault(CMemoryPool *mp, - ULONG partitioning_level) - : CDXLScalar(mp), m_partitioning_level(partitioning_level) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartDefault::GetDXLOperator -// -// @doc: -// Operator type -// -//--------------------------------------------------------------------------- -Edxlopid -CDXLScalarPartDefault::GetDXLOperator() const -{ - return EdxlopScalarPartDefault; -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartDefault::GetOpNameStr -// -// @doc: -// Operator name -// -//--------------------------------------------------------------------------- -const CWStringConst * -CDXLScalarPartDefault::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartDefault); -} - -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartDefault::SerializeToDXL -// -// @doc: -// Serialize operator in DXL format -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartDefault::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -#ifdef GPOS_DEBUG -//--------------------------------------------------------------------------- -// @function: -// CDXLScalarPartDefault::AssertValid -// -// @doc: -// Checks whether operator node is well-structured -// -//--------------------------------------------------------------------------- -void -CDXLScalarPartDefault::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListNullTest.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListNullTest.cpp deleted file mode 100644 index d1dcebea471..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListNullTest.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Implementation of DXL Part list null test expression - -#include "naucrates/dxl/operators/CDXLScalarPartListNullTest.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -// Ctor -CDXLScalarPartListNullTest::CDXLScalarPartListNullTest(CMemoryPool *mp, - ULONG partitioning_level, - BOOL is_null) - : CDXLScalar(mp), - m_partitioning_level(partitioning_level), - m_is_null(is_null) -{ -} - -// Operator type -Edxlopid -CDXLScalarPartListNullTest::GetDXLOperator() const -{ - return EdxlopScalarPartListNullTest; -} - -// Operator name -const CWStringConst * -CDXLScalarPartListNullTest::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartListNullTest); -} - -// Serialize operator in DXL format -void -CDXLScalarPartListNullTest::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - xml_serializer->AddAttribute( - CDXLTokens::GetDXLTokenStr(EdxltokenScalarIsNull), m_is_null); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -// partitioning level -ULONG -CDXLScalarPartListNullTest::GetPartitioningLevel() const -{ - return m_partitioning_level; -} - -// Null Test type (true for 'is null', false for 'is not null') -BOOL -CDXLScalarPartListNullTest::IsNull() const -{ - return m_is_null; -} - -// does the operator return a boolean result -BOOL -CDXLScalarPartListNullTest::HasBoolResult(CMDAccessor * //md_accessor -) const -{ - return true; -} - -#ifdef GPOS_DEBUG -// Checks whether operator node is well-structured -void -CDXLScalarPartListNullTest::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// conversion function -CDXLScalarPartListNullTest * -CDXLScalarPartListNullTest::Cast(CDXLOperator *dxl_op) -{ - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartListNullTest == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListValues.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListValues.cpp deleted file mode 100644 index 5eb628eaca7..00000000000 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLScalarPartListValues.cpp +++ /dev/null @@ -1,126 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Implementation of DXL Part List Values expression -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/operators/CDXLScalarPartListValues.h" - -#include "gpopt/mdcache/CMDAccessor.h" -#include "naucrates/dxl/operators/CDXLNode.h" -#include "naucrates/dxl/xml/CXMLSerializer.h" - -using namespace gpopt; -using namespace gpmd; -using namespace gpos; -using namespace gpdxl; - -// Ctor -CDXLScalarPartListValues::CDXLScalarPartListValues(CMemoryPool *mp, - ULONG partitioning_level, - IMDId *result_type_mdid, - IMDId *elem_type_mdid) - : CDXLScalar(mp), - m_partitioning_level(partitioning_level), - m_result_type_mdid(result_type_mdid), - m_elem_type_mdid(elem_type_mdid) -{ - GPOS_ASSERT(result_type_mdid->IsValid()); - GPOS_ASSERT(elem_type_mdid->IsValid()); -} - - -// Dtor -CDXLScalarPartListValues::~CDXLScalarPartListValues() -{ - m_result_type_mdid->Release(); - m_elem_type_mdid->Release(); -} - -// Operator type -Edxlopid -CDXLScalarPartListValues::GetDXLOperator() const -{ - return EdxlopScalarPartListValues; -} - -// Operator name -const CWStringConst * -CDXLScalarPartListValues::GetOpNameStr() const -{ - return CDXLTokens::GetDXLTokenStr(EdxltokenScalarPartListValues); -} - -// partitioning level -ULONG -CDXLScalarPartListValues::GetPartitioningLevel() const -{ - return m_partitioning_level; -} - -// result type -IMDId * -CDXLScalarPartListValues::GetResultTypeMdId() const -{ - return m_result_type_mdid; -} - -// element type -IMDId * -CDXLScalarPartListValues::GetElemTypeMdId() const -{ - return m_elem_type_mdid; -} - -// does the operator return a boolean result -BOOL -CDXLScalarPartListValues::HasBoolResult(CMDAccessor * //md_accessor -) const -{ - return false; -} - -// Serialize operator in DXL format -void -CDXLScalarPartListValues::SerializeToDXL(CXMLSerializer *xml_serializer, - const CDXLNode * // dxlnode -) const -{ - const CWStringConst *element_name = GetOpNameStr(); - - xml_serializer->OpenElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); - xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenPartLevel), - m_partitioning_level); - m_result_type_mdid->Serialize( - xml_serializer, - CDXLTokens::GetDXLTokenStr(EdxltokenGPDBScalarOpResultTypeId)); - m_elem_type_mdid->Serialize( - xml_serializer, CDXLTokens::GetDXLTokenStr(EdxltokenArrayElementType)); - xml_serializer->CloseElement( - CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name); -} - -#ifdef GPOS_DEBUG -// Checks whether operator node is well-structured -void -CDXLScalarPartListValues::AssertValid(const CDXLNode *dxlnode, - BOOL // validate_children -) const -{ - GPOS_ASSERT(0 == dxlnode->Arity()); -} -#endif // GPOS_DEBUG - -// conversion function -CDXLScalarPartListValues * -CDXLScalarPartListValues::Cast(CDXLOperator *dxl_op) -{ - GPOS_ASSERT(nullptr != dxl_op); - GPOS_ASSERT(EdxlopScalarPartListValues == dxl_op->GetDXLOperator()); - - return dynamic_cast(dxl_op); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/CDXLTableDescr.cpp b/src/backend/gporca/libnaucrates/src/operators/CDXLTableDescr.cpp index b4a6f69c85b..8220ec9ded9 100644 --- a/src/backend/gporca/libnaucrates/src/operators/CDXLTableDescr.cpp +++ b/src/backend/gporca/libnaucrates/src/operators/CDXLTableDescr.cpp @@ -31,12 +31,14 @@ using namespace gpdxl; // //--------------------------------------------------------------------------- CDXLTableDescr::CDXLTableDescr(CMemoryPool *mp, IMDId *mdid, CMDName *mdname, - ULONG ulExecuteAsUser, int lockmode) + ULONG ulExecuteAsUser, int lockmode, + ULONG assigned_query_id_for_target_rel) : m_mdid(mdid), m_mdname(mdname), m_dxl_column_descr_array(nullptr), m_execute_as_user_id(ulExecuteAsUser), - m_lockmode(lockmode) + m_lockmode(lockmode), + m_assigned_query_id_for_target_rel(assigned_query_id_for_target_rel) { GPOS_ASSERT(nullptr != m_mdname); m_dxl_column_descr_array = GPOS_NEW(mp) CDXLColDescrArray(mp); @@ -218,6 +220,13 @@ CDXLTableDescr::SerializeToDXL(CXMLSerializer *xml_serializer) const CDXLTokens::GetDXLTokenStr(EdxltokenLockMode), LockMode()); } + if (UNASSIGNED_QUERYID != m_assigned_query_id_for_target_rel) + { + xml_serializer->AddAttribute( + CDXLTokens::GetDXLTokenStr(EdxltokenAssignedQueryIdForTargetRel), + m_assigned_query_id_for_target_rel); + } + // serialize columns xml_serializer->OpenElement( CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), @@ -240,4 +249,21 @@ CDXLTableDescr::SerializeToDXL(CXMLSerializer *xml_serializer) const CDXLTokens::GetDXLTokenStr(EdxltokenTableDescr)); } + +//--------------------------------------------------------------------------- +// @function: +// CDXLTableDescr::GetAssignedQueryIdForTargetRel +// +// @doc: +// Return id of query, to which TableDescr belongs to +// (if this descriptor points to a result (target) entry, +// else UNASSIGNED_QUERYID returned) +// +//--------------------------------------------------------------------------- +ULONG +CDXLTableDescr::GetAssignedQueryIdForTargetRel() const +{ + return m_assigned_query_id_for_target_rel; +} + // EOF diff --git a/src/backend/gporca/libnaucrates/src/operators/Makefile b/src/backend/gporca/libnaucrates/src/operators/Makefile index c4791ca0b8e..1c12de5229b 100644 --- a/src/backend/gporca/libnaucrates/src/operators/Makefile +++ b/src/backend/gporca/libnaucrates/src/operators/Makefile @@ -128,12 +128,6 @@ OBJS = CDXLColDescr.o \ CDXLScalarOneTimeFilter.o \ CDXLScalarOpExpr.o \ CDXLScalarOpList.o \ - CDXLScalarPartBound.o \ - CDXLScalarPartBoundInclusion.o \ - CDXLScalarPartBoundOpen.o \ - CDXLScalarPartDefault.o \ - CDXLScalarPartListNullTest.o \ - CDXLScalarPartListValues.o \ CDXLScalarProjElem.o \ CDXLScalarProjList.o \ CDXLScalarRecheckCondFilter.o \ diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStats.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStats.cpp new file mode 100644 index 00000000000..e754976351c --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStats.cpp @@ -0,0 +1,147 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStats.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing extended +// statistics. +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerExtStats.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLExtStats.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStats::CParseHandlerExtStats +// +// @doc: +// Constructor +// +//--------------------------------------------------------------------------- +CParseHandlerExtStats::CParseHandlerExtStats( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) + : CParseHandlerMetadataObject(mp, parse_handler_mgr, parse_handler_root) +{ +} + +CParseHandlerExtStats::~CParseHandlerExtStats() +{ + m_mdid->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStats::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStats::StartElement(const XMLCh *const, // element_uri, + const XMLCh *const element_local_name + GPOS_UNUSED, + const XMLCh *const, // element_qname, + const Attributes &attrs GPOS_UNUSED) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStats), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + // parse metadata id info + m_mdid = CDXLOperatorFactory::ExtractConvertAttrValueToMdId( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenMdid, + EdxltokenExtendedStats); + + const XMLCh *parsed_stat_name = CDXLOperatorFactory::ExtractAttrValue( + attrs, EdxltokenName, EdxltokenExtendedStats); + + CWStringDynamic *stat_name_str = + CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), parsed_stat_name); + + // create a copy of the string in the CMDName constructor + m_mdname = GPOS_NEW(m_mp) CMDName(m_mp, stat_name_str); + GPOS_DELETE(stat_name_str); + + CParseHandlerBase *ndistincts_parse_handler = + CParseHandlerFactory::GetParseHandler( + m_mp, CDXLTokens::XmlstrToken(EdxltokenMVNDistinctList), + m_parse_handler_mgr, this); + m_parse_handler_mgr->ActivateParseHandler(ndistincts_parse_handler); + + this->Append(ndistincts_parse_handler); + + CParseHandlerBase *dependencies_parse_handler = + CParseHandlerFactory::GetParseHandler( + m_mp, CDXLTokens::XmlstrToken(EdxltokenMVDependencyList), + m_parse_handler_mgr, this); + m_parse_handler_mgr->ActivateParseHandler(dependencies_parse_handler); + + this->Append(dependencies_parse_handler); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStats::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStats::EndElement(const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStats), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + CParseHandlerExtStatsDependencies *dependencies_parse_handler = + dynamic_cast((*this)[1]); + dependencies_parse_handler->GetDependencies()->AddRef(); + + CParseHandlerExtStatsNDistinctList *ndistincts_parse_handler = + dynamic_cast((*this)[0]); + ndistincts_parse_handler->GetNDistinctList()->AddRef(); + + m_mdid->AddRef(); + m_imd_obj = GPOS_NEW(m_mp) CDXLExtStats( + m_mp, m_mdid, m_mdname, dependencies_parse_handler->GetDependencies(), + ndistincts_parse_handler->GetNDistinctList()); + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependencies.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependencies.cpp new file mode 100644 index 00000000000..1f52ae1ec31 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependencies.cpp @@ -0,0 +1,139 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsDependencies.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing extended stat +// dependencies +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependencies.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependency.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLColStats.h" +#include "naucrates/md/CMDDependency.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +CParseHandlerExtStatsDependencies::CParseHandlerExtStatsDependencies( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base) + : CParseHandlerBase(mp, parse_handler_mgr, parse_handler_base), + m_dependencies(nullptr) +{ +} + +CParseHandlerExtStatsDependencies::~CParseHandlerExtStatsDependencies() +{ + m_dependencies->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependencies::GetDependencies +// +// @doc: +// The dependencies constructed by the parse handler +// +//--------------------------------------------------------------------------- +CMDDependencyArray * +CParseHandlerExtStatsDependencies::GetDependencies() const +{ + return m_dependencies; +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependencies::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsDependencies::StartElement( + const XMLCh *const element_uri, const XMLCh *const element_local_name, + const XMLCh *const element_qname, const Attributes &attrs) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVDependencyList), + element_local_name) && + 0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVDependency), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + else if (0 == XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVDependency), + element_local_name)) + { + // new bucket + CParseHandlerBase *parse_handler_base_dependency = + CParseHandlerFactory::GetParseHandler( + m_mp, CDXLTokens::XmlstrToken(EdxltokenMVDependency), + m_parse_handler_mgr, this); + this->Append(parse_handler_base_dependency); + + m_parse_handler_mgr->ActivateParseHandler( + parse_handler_base_dependency); + parse_handler_base_dependency->startElement( + element_uri, element_local_name, element_qname, attrs); + } +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependencies::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsDependencies::EndElement( + const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVDependencyList), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + m_dependencies = GPOS_NEW(m_mp) CMDDependencyArray(m_mp); + for (ULONG ul = 0; ul < this->Length(); ul++) + { + CParseHandlerExtStatsDependency *parse_handler_ext_stats_dep = + dynamic_cast((*this)[ul]); + + CMDDependency *dep = parse_handler_ext_stats_dep->GetDependencyAt(); + dep->AddRef(); + + m_dependencies->Append(dep); + } + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependency.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependency.cpp new file mode 100644 index 00000000000..94c348c4738 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsDependency.cpp @@ -0,0 +1,127 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsDependency.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing a extended +// stat dependency object +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependency.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLColStats.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +CParseHandlerExtStatsDependency::CParseHandlerExtStatsDependency( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base) + : CParseHandlerBase(mp, parse_handler_mgr, parse_handler_base), + m_degree(0.0), + m_from_attnos(nullptr), + m_to_attno(0), + m_dependency(nullptr) +{ +} + +CParseHandlerExtStatsDependency::~CParseHandlerExtStatsDependency() +{ + m_dependency->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependency::GetDependencyAt +// +// @doc: +// The dependency constructed by the parse handler +// +//--------------------------------------------------------------------------- +CMDDependency * +CParseHandlerExtStatsDependency::GetDependencyAt() const +{ + return m_dependency; +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependency::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsDependency::StartElement( + const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const, // element_qname, + const Attributes &attrs) +{ + if (0 == + XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenMVDependency), + element_local_name)) + { + // parse degree and relationship values + m_degree = CDXLOperatorFactory::ExtractConvertAttrValueToDouble( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenDegree, + EdxltokenMVDependency); + m_from_attnos = CDXLOperatorFactory::ExtractConvertValuesToIntArray( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenFrom, + EdxltokenMVDependency); + m_to_attno = CDXLOperatorFactory::ExtractConvertAttrValueToInt( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenTo, + EdxltokenMVDependency); + } + else + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsDependency::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsDependency::EndElement( + const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != + XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenMVDependency), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + m_dependency = GPOS_NEW(m_mp) + CMDDependency(m_mp, m_degree.Get(), m_from_attnos, m_to_attno); + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsInfo.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsInfo.cpp new file mode 100644 index 00000000000..7178c634e46 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsInfo.cpp @@ -0,0 +1,163 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsInfo.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing a extended +// stat metadata object +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerExtStatsInfo.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsDependency.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLExtStatsInfo.h" +#include "naucrates/md/CMDExtStatsInfo.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +CParseHandlerExtStatsInfo::CParseHandlerExtStatsInfo( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base) + : CParseHandlerBase(mp, parse_handler_mgr, parse_handler_base), + m_extinfo(nullptr) +{ +} + +CParseHandlerExtStatsInfo::~CParseHandlerExtStatsInfo() +{ + m_extinfo->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsInfo::GetInfo +// +// @doc: +// The metadata (info) constructed by the parse handler +// +//--------------------------------------------------------------------------- +CMDExtStatsInfo * +CParseHandlerExtStatsInfo::GetInfo() const +{ + return m_extinfo; +} + +CMDExtStatsInfo::Estattype +CParseHandlerExtStatsInfo::ParseStatKind(const Attributes &attrs) const +{ + const XMLCh *parsed_stat_kind = CDXLOperatorFactory::ExtractAttrValue( + attrs, EdxltokenKind, EdxltokenExtendedStatsInfo); + + if (0 == + XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenMVDependency), + parsed_stat_kind)) + { + return CMDExtStatsInfo::EstatDependencies; + } + else if (0 == XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + parsed_stat_kind)) + { + return CMDExtStatsInfo::EstatNDistinct; + } + else + { + // unexpected kind... + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLInvalidAttributeValue, + CDXLTokens::GetDXLTokenStr(EdxltokenKind)->GetBuffer(), + CDXLTokens::GetDXLTokenStr(EdxltokenErrorCode)->GetBuffer()); + } +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsInfo::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsInfo::StartElement( + const XMLCh *const element_uri GPOS_UNUSED, + const XMLCh *const element_local_name, + const XMLCh *const element_qname GPOS_UNUSED, const Attributes &attrs) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStatsInfo), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + OID stat_oid = CDXLOperatorFactory::ExtractConvertAttrValueToOid( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenOid, + EdxltokenExtendedStatsInfo); + + const XMLCh *parsed_stat_name = CDXLOperatorFactory::ExtractAttrValue( + attrs, EdxltokenName, EdxltokenExtendedStatsInfo); + + CWStringDynamic *stat_name_str = + CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), parsed_stat_name); + + // create a copy of the string in the CMDName constructor + CMDName *stat_name = GPOS_NEW(m_mp) CMDName(m_mp, stat_name_str); + GPOS_DELETE(stat_name_str); + + ULongPtrArray *keys = CDXLOperatorFactory::ExtractConvertValuesToArray( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenKeys, + EdxltokenExtendedStatsInfo); + + CBitSet *bs_keys = GPOS_NEW(m_mp) CBitSet(m_mp); + for (ULONG i = 0; i < keys->Size(); i++) + { + bs_keys->ExchangeSet(*(*keys)[i]); + } + keys->Release(); + + m_extinfo = GPOS_NEW(m_mp) CMDExtStatsInfo(m_mp, stat_oid, stat_name, + ParseStatKind(attrs), bs_keys); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsInfo::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsInfo::EndElement(const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStatsInfo), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundInclusion.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinct.cpp similarity index 50% rename from src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundInclusion.cpp rename to src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinct.cpp index ac5021f11a4..333b17fab08 100644 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundInclusion.cpp +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinct.cpp @@ -1,95 +1,112 @@ //--------------------------------------------------------------------------- // Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. +// Copyright (C) 2023 VMware Inc. // // @filename: -// CParseHandlerScalarPartBoundInclusion.cpp +// CParseHandlerExtStatsNDistinct.cpp // // @doc: -// Implementation of the SAX parse handler class for parsing part bound inclusion +// Implementation of the SAX parse handler class for parsing a extended +// stat ndistinct object //--------------------------------------------------------------------------- -#include "naucrates/dxl/parser/CParseHandlerScalarPartBoundInclusion.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h" #include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartBoundInclusion.h" #include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLColStats.h" using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; XERCES_CPP_NAMESPACE_USE +CParseHandlerExtStatsNDistinct::CParseHandlerExtStatsNDistinct( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base) + : CParseHandlerBase(mp, parse_handler_mgr, parse_handler_base), + m_ndistinct(0.0), + m_attnos(nullptr), + m_ndistinct_md(nullptr) +{ +} + +CParseHandlerExtStatsNDistinct::~CParseHandlerExtStatsNDistinct() +{ + m_attnos->Release(); + m_ndistinct_md->Release(); +} + //--------------------------------------------------------------------------- // @function: -// CParseHandlerScalarPartBoundInclusion::CParseHandlerScalarPartBoundInclusion +// CParseHandlerExtStatsNDistinct::GetNDistinctAt // // @doc: -// Ctor +// The ndistinct constructed by the parse handler // //--------------------------------------------------------------------------- -CParseHandlerScalarPartBoundInclusion::CParseHandlerScalarPartBoundInclusion( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) +CMDNDistinct * +CParseHandlerExtStatsNDistinct::GetNDistinctAt() const { + return m_ndistinct_md; } //--------------------------------------------------------------------------- // @function: -// CParseHandlerScalarPartBoundInclusion::StartElement +// CParseHandlerExtStatsNDistinct::StartElement // // @doc: // Invoked by Xerces to process an opening tag // //--------------------------------------------------------------------------- void -CParseHandlerScalarPartBoundInclusion::StartElement( +CParseHandlerExtStatsNDistinct::StartElement( const XMLCh *const, // element_uri, const XMLCh *const element_local_name, const XMLCh *const, // element_qname, const Attributes &attrs) { - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBoundInclusion), - element_local_name)) + if (0 == + XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + element_local_name)) + { + // parse degree and relationship values + m_ndistinct = CDXLOperatorFactory::ExtractConvertAttrValueToDouble( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, + EdxltokenMVNDistinct, EdxltokenMVNDistinct); + m_attnos = CDXLOperatorFactory::ExtractConvertValuesToIntBitSet( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenAttno, + EdxltokenMVNDistinct); + } + else { CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, str->GetBuffer()); } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartBoundInclusion); - BOOL is_lower_bound = CDXLOperatorFactory::ExtractConvertAttrValueToBool( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenScalarPartBoundLower, EdxltokenScalarPartBoundInclusion); - - m_dxl_node = GPOS_NEW(m_mp) - CDXLNode(m_mp, GPOS_NEW(m_mp) CDXLScalarPartBoundInclusion( - m_mp, partition_level, is_lower_bound)); } //--------------------------------------------------------------------------- // @function: -// CParseHandlerScalarPartBoundInclusion::EndElement +// CParseHandlerExtStatsNDistinct::EndElement // // @doc: // Invoked by Xerces to process a closing tag // //--------------------------------------------------------------------------- void -CParseHandlerScalarPartBoundInclusion::EndElement( +CParseHandlerExtStatsNDistinct::EndElement( const XMLCh *const, // element_uri, const XMLCh *const element_local_name, const XMLCh *const // element_qname ) { - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBoundInclusion), - element_local_name)) + if (0 != + XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + element_local_name)) { CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); @@ -97,7 +114,9 @@ CParseHandlerScalarPartBoundInclusion::EndElement( str->GetBuffer()); } - GPOS_ASSERT(nullptr != m_dxl_node); + m_attnos->AddRef(); + m_ndistinct_md = + GPOS_NEW(m_mp) CMDNDistinct(m_mp, m_ndistinct.Get(), m_attnos); // deactivate handler m_parse_handler_mgr->DeactivateHandler(); diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinctList.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinctList.cpp new file mode 100644 index 00000000000..50ec5df89d3 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerExtStatsNDistinctList.cpp @@ -0,0 +1,138 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerExtStatsNDistinctList.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing extended stat +// ndinstinct +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinctList.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLColStats.h" +#include "naucrates/md/CMDNDistinct.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +CParseHandlerExtStatsNDistinctList::CParseHandlerExtStatsNDistinctList( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_base) + : CParseHandlerBase(mp, parse_handler_mgr, parse_handler_base), + m_ndistincts(nullptr) +{ +} + +CParseHandlerExtStatsNDistinctList::~CParseHandlerExtStatsNDistinctList() +{ + m_ndistincts->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsNDistinctList::GetNDistinctList +// +// @doc: +// The ndinstincts constructed by the parse handler +// +//--------------------------------------------------------------------------- +CMDNDistinctArray * +CParseHandlerExtStatsNDistinctList::GetNDistinctList() const +{ + return m_ndistincts; +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsNDistinctList::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsNDistinctList::StartElement( + const XMLCh *const element_uri, const XMLCh *const element_local_name, + const XMLCh *const element_qname, const Attributes &attrs) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVNDistinctList), + element_local_name) && + 0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + else if (0 == XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + element_local_name)) + { + // new ndistinct + CParseHandlerBase *parse_handler_base_ndistinct = + CParseHandlerFactory::GetParseHandler( + m_mp, CDXLTokens::XmlstrToken(EdxltokenMVNDistinct), + m_parse_handler_mgr, this); + this->Append(parse_handler_base_ndistinct); + + m_parse_handler_mgr->ActivateParseHandler(parse_handler_base_ndistinct); + parse_handler_base_ndistinct->startElement( + element_uri, element_local_name, element_qname, attrs); + } +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerExtStatsNDistinctList::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerExtStatsNDistinctList::EndElement( + const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenMVNDistinctList), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + m_ndistincts = GPOS_NEW(m_mp) CMDNDistinctArray(m_mp); + for (ULONG ul = 0; ul < this->Length(); ul++) + { + CParseHandlerExtStatsNDistinct *parse_handler_ext_stats_dep = + dynamic_cast((*this)[ul]); + + CMDNDistinct *dep = parse_handler_ext_stats_dep->GetNDistinctAt(); + dep->AddRef(); + + m_ndistincts->Append(dep); + } + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerFactory.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerFactory.cpp index 53264460113..ef6d2a981fe 100644 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerFactory.cpp +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerFactory.cpp @@ -71,6 +71,13 @@ CParseHandlerFactory::Init(CMemoryPool *mp) {EdxltokenGPDBAgg, &CreateMDAggParseHandler}, {EdxltokenCheckConstraint, &CreateMDChkConstraintParseHandler}, {EdxltokenRelationStats, &CreateRelStatsParseHandler}, + {EdxltokenRelationExtendedStats, &CreateRelationExtStatsParseHandler}, + {EdxltokenExtendedStats, &CreateExtStatsParseHandler}, + {EdxltokenExtendedStatsInfo, &CreateExtStatsInfoParseHandler}, + {EdxltokenMVDependencyList, &CreateExtStatsDependenciesParseHandler}, + {EdxltokenMVDependency, &CreateExtStatsDependencyParseHandler}, + {EdxltokenMVNDistinctList, &CreateExtStatsNDistinctListParseHandler}, + {EdxltokenMVNDistinct, &CreateExtStatsNDistinctParseHandler}, {EdxltokenColumnStats, &CreateColStatsParseHandler}, {EdxltokenMetadataIdList, &CreateMDIdListParseHandler}, {EdxltokenIndexInfoList, &CreateMDIndexInfoListParseHandler}, @@ -181,13 +188,6 @@ CParseHandlerFactory::Init(CMemoryPool *mp) &CreateScSubPlanParamListParseHandler}, {EdxltokenScalarSubPlanParam, &CreateScSubPlanParamParseHandler}, {EdxltokenScalarOpList, &CreateScOpListParseHandler}, - {EdxltokenScalarPartDefault, &CreateScPartDefaultParseHandler}, - {EdxltokenScalarPartBound, &CreateScPartBoundParseHandler}, - {EdxltokenScalarPartBoundInclusion, &CreateScPartBoundInclParseHandler}, - {EdxltokenScalarPartBoundOpen, &CreateScPartBoundOpenParseHandler}, - {EdxltokenScalarPartListValues, &CreateScPartListValuesParseHandler}, - {EdxltokenScalarPartListNullTest, - &CreateScPartListNullTestParseHandler}, {EdxltokenScalarSubquery, &CreateScSubqueryParseHandler}, {EdxltokenScalarBitmapAnd, &CreateScBitmapBoolOpParseHandler}, @@ -483,6 +483,71 @@ CParseHandlerFactory::CreateRelStatsParseHandler( CParseHandlerRelStats(mp, parse_handler_mgr, parse_handler_root); } +// creates a parse handler for parsing relation stats +CParseHandlerBase * +CParseHandlerFactory::CreateRelationExtStatsParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) CParseHandlerRelationExtendedStats( + mp, parse_handler_mgr, parse_handler_root); +} + +// creates a parse handler for parsing relation stats +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) + CParseHandlerExtStats(mp, parse_handler_mgr, parse_handler_root); +} + +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsInfoParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) + CParseHandlerExtStatsInfo(mp, parse_handler_mgr, parse_handler_root); +} + +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsDependenciesParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) CParseHandlerExtStatsDependencies(mp, parse_handler_mgr, + parse_handler_root); +} + +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsDependencyParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) CParseHandlerExtStatsDependency(mp, parse_handler_mgr, + parse_handler_root); +} + +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsNDistinctListParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) CParseHandlerExtStatsNDistinctList( + mp, parse_handler_mgr, parse_handler_root); +} + +CParseHandlerBase * +CParseHandlerFactory::CreateExtStatsNDistinctParseHandler( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) +{ + return GPOS_NEW(mp) CParseHandlerExtStatsNDistinct(mp, parse_handler_mgr, + parse_handler_root); +} + // creates a parse handler for parsing column stats CParseHandlerBase * CParseHandlerFactory::CreateColStatsParseHandler( @@ -912,66 +977,6 @@ CParseHandlerFactory::CreateScOpListParseHandler( CParseHandlerScalarOpList(mp, parse_handler_mgr, parse_handler_root); } -// creates a parse handler for parsing a scalar part default -CParseHandlerBase * -CParseHandlerFactory::CreateScPartDefaultParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) CParseHandlerScalarPartDefault(mp, parse_handler_mgr, - parse_handler_root); -} - -// creates a parse handler for parsing a scalar part boundary -CParseHandlerBase * -CParseHandlerFactory::CreateScPartBoundParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) - CParseHandlerScalarPartBound(mp, parse_handler_mgr, parse_handler_root); -} - -// creates a parse handler for parsing a scalar part bound inclusion -CParseHandlerBase * -CParseHandlerFactory::CreateScPartBoundInclParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) CParseHandlerScalarPartBoundInclusion( - mp, parse_handler_mgr, parse_handler_root); -} - -// creates a parse handler for parsing a scalar part bound openness -CParseHandlerBase * -CParseHandlerFactory::CreateScPartBoundOpenParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) CParseHandlerScalarPartBoundOpen(mp, parse_handler_mgr, - parse_handler_root); -} - -// creates a parse handler for parsing a scalar part list values -CParseHandlerBase * -CParseHandlerFactory::CreateScPartListValuesParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) CParseHandlerScalarPartListValues(mp, parse_handler_mgr, - parse_handler_root); -} - -// creates a parse handler for parsing a scalar part list null test -CParseHandlerBase * -CParseHandlerFactory::CreateScPartListNullTestParseHandler( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) -{ - return GPOS_NEW(mp) CParseHandlerScalarPartListNullTest( - mp, parse_handler_mgr, parse_handler_root); -} - // creates a parse handler for parsing direct dispatch info CParseHandlerBase * CParseHandlerFactory::CreateDirectDispatchParseHandler( diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDIndex.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDIndex.cpp index c1ec82e6f58..be3ecc5accb 100644 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDIndex.cpp +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDIndex.cpp @@ -42,9 +42,6 @@ CParseHandlerMDIndex::CParseHandlerMDIndex( m_mdid_item_type(nullptr), m_index_key_cols_array(nullptr), m_included_cols_array(nullptr), - m_part_constraint(nullptr), - m_level_with_default_part_array(nullptr), - m_part_constraint_unbounded(false), m_child_indexes_parse_handler(nullptr) { } @@ -63,43 +60,6 @@ CParseHandlerMDIndex::StartElement(const XMLCh *const element_uri, const XMLCh *const element_qname, const Attributes &attrs) { - if (0 == XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenPartConstraint), - element_local_name)) - { - GPOS_ASSERT(nullptr == m_part_constraint); - - const XMLCh *xmlszDefParts = - attrs.getValue(CDXLTokens::XmlstrToken(EdxltokenDefaultPartition)); - if (nullptr != xmlszDefParts) - { - m_level_with_default_part_array = - CDXLOperatorFactory::ExtractIntsToUlongArray( - m_parse_handler_mgr->GetDXLMemoryManager(), xmlszDefParts, - EdxltokenDefaultPartition, EdxltokenIndex); - } - else - { - // construct an empty keyset - m_level_with_default_part_array = - GPOS_NEW(m_mp) ULongPtrArray(m_mp); - } - - m_part_constraint_unbounded = - CDXLOperatorFactory::ExtractConvertAttrValueToBool( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenPartConstraintUnbounded, EdxltokenIndex); - - // parse handler for part constraints - CParseHandlerBase *pphPartConstraint = - CParseHandlerFactory::GetParseHandler( - m_mp, CDXLTokens::XmlstrToken(EdxltokenScalar), - m_parse_handler_mgr, this); - m_parse_handler_mgr->ActivateParseHandler(pphPartConstraint); - this->Append(pphPartConstraint); - return; - } - if (0 == XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenPartitions), element_local_name)) @@ -195,22 +155,6 @@ CParseHandlerMDIndex::EndElement(const XMLCh *const, // element_uri, const XMLCh *const // element_qname ) { - if (0 == XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenPartConstraint), - element_local_name)) - { - GPOS_ASSERT(2 == Length()); - - CParseHandlerScalarOp *pphPartCnstr = - dynamic_cast((*this)[1]); - CDXLNode *pdxlnPartConstraint = pphPartCnstr->CreateDXLNode(); - pdxlnPartConstraint->AddRef(); - m_part_constraint = GPOS_NEW(m_mp) CMDPartConstraintGPDB( - m_mp, m_level_with_default_part_array, m_part_constraint_unbounded, - pdxlnPartConstraint); - return; - } - if (0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenIndex), element_local_name)) { @@ -239,7 +183,7 @@ CParseHandlerMDIndex::EndElement(const XMLCh *const, // element_uri, m_imd_obj = GPOS_NEW(m_mp) CMDIndexGPDB( m_mp, m_mdid, m_mdname, m_clustered, is_partitioned, m_index_type, m_mdid_item_type, m_index_key_cols_array, m_included_cols_array, - mdid_opfamilies_array, m_part_constraint, child_indexes); + mdid_opfamilies_array, child_indexes); // deactivate handler m_parse_handler_mgr->DeactivateHandler(); diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDRelation.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDRelation.cpp index 9b996f73ecf..3859963ebb2 100644 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDRelation.cpp +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerMDRelation.cpp @@ -46,7 +46,6 @@ CParseHandlerMDRelation::CParseHandlerMDRelation( m_convert_hash_to_random(false), m_partition_cols_array(nullptr), m_str_part_types_array(nullptr), - m_num_of_partitions(0), m_key_sets_arrays(nullptr), m_part_constraint(nullptr), m_opfamilies_parse_handler(nullptr), @@ -165,16 +164,6 @@ CParseHandlerMDRelation::StartElement(const XMLCh *const element_uri, EdxltokenPartTypes, EdxltokenRelation); } - const XMLCh *xmlszPartitions = - attrs.getValue(CDXLTokens::XmlstrToken(EdxltokenNumLeafPartitions)); - - if (nullptr != xmlszPartitions) - { - m_num_of_partitions = CDXLOperatorFactory::ConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), xmlszPartitions, - EdxltokenNumLeafPartitions, EdxltokenRelation); - } - // parse whether a hash distributed relation needs to be considered as random distributed const XMLCh *xmlszConvertHashToRandom = attrs.getValue(CDXLTokens::XmlstrToken(EdxltokenConvertHashToRandom)); @@ -270,9 +259,9 @@ CParseHandlerMDRelation::EndElement(const XMLCh *const, // element_uri, m_imd_obj = GPOS_NEW(m_mp) CMDRelationGPDB( m_mp, m_mdid, m_mdname, m_is_temp_table, m_rel_storage_type, m_rel_distr_policy, md_col_array, m_distr_col_array, distr_opfamilies, - m_partition_cols_array, m_str_part_types_array, m_num_of_partitions, - child_partitions, m_convert_hash_to_random, m_key_sets_arrays, - md_index_info_array, mdid_check_constraint_array, m_part_constraint); + m_partition_cols_array, m_str_part_types_array, child_partitions, + m_convert_hash_to_random, m_key_sets_arrays, md_index_info_array, + mdid_check_constraint_array, m_part_constraint); // deactivate handler m_parse_handler_mgr->DeactivateHandler(); @@ -335,11 +324,6 @@ CParseHandlerMDRelation::ParseRelationAttributes(const Attributes &attrs, // construct an empty keyset m_key_sets_arrays = GPOS_NEW(m_mp) ULongPtr2dArray(m_mp); } - - m_num_of_partitions = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenNumLeafPartitions, dxl_token_element, true /* optional */, - 0 /* default value */); } //--------------------------------------------------------------------------- diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerRelationExtendedStats.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerRelationExtendedStats.cpp new file mode 100644 index 00000000000..1240a4df74e --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerRelationExtendedStats.cpp @@ -0,0 +1,150 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright (C) 2023 VMware Inc. +// +// @filename: +// CParseHandlerRelationExtendedStats.cpp +// +// @doc: +// Implementation of the SAX parse handler class for parsing relation +// extended statistics. +//--------------------------------------------------------------------------- + +#include "naucrates/dxl/parser/CParseHandlerRelationExtendedStats.h" + +#include "naucrates/dxl/operators/CDXLOperatorFactory.h" +#include "naucrates/dxl/parser/CParseHandlerExtStatsInfo.h" +#include "naucrates/dxl/parser/CParseHandlerFactory.h" +#include "naucrates/dxl/parser/CParseHandlerManager.h" +#include "naucrates/md/CDXLExtStatsInfo.h" +#include "naucrates/md/CMDExtStatsInfo.h" + +using namespace gpdxl; +using namespace gpmd; +using namespace gpnaucrates; + +XERCES_CPP_NAMESPACE_USE + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerRelationExtendedStats::CParseHandlerRelationExtendedStats +// +// @doc: +// Constructor +// +//--------------------------------------------------------------------------- +CParseHandlerRelationExtendedStats::CParseHandlerRelationExtendedStats( + CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, + CParseHandlerBase *parse_handler_root) + : CParseHandlerMetadataObject(mp, parse_handler_mgr, parse_handler_root) +{ +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerRelationExtendedStats::StartElement +// +// @doc: +// Invoked by Xerces to process an opening tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerRelationExtendedStats::StartElement( + const XMLCh *const element_uri, const XMLCh *const element_local_name, + const XMLCh *const element_qname, const Attributes &attrs) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenRelationExtendedStats), + element_local_name) && + 0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStatsInfo), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + else if (0 == XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenExtendedStatsInfo), + element_local_name)) + { + CParseHandlerBase *extinfos_parse_handler = + CParseHandlerFactory::GetParseHandler( + m_mp, CDXLTokens::XmlstrToken(EdxltokenExtendedStatsInfo), + m_parse_handler_mgr, this); + this->Append(extinfos_parse_handler); + + m_parse_handler_mgr->ActivateParseHandler(extinfos_parse_handler); + extinfos_parse_handler->startElement(element_uri, element_local_name, + element_qname, attrs); + } + else + { + // parse table name + const XMLCh *xml_str_table_name = CDXLOperatorFactory::ExtractAttrValue( + attrs, EdxltokenName, EdxltokenRelationExtendedStats); + + CWStringDynamic *str_table_name = + CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), xml_str_table_name); + + // create a copy of the string in the CMDName constructor + m_mdname = GPOS_NEW(m_mp) CMDName(m_mp, str_table_name); + + GPOS_DELETE(str_table_name); + + // parse metadata id info + m_mdid = CDXLOperatorFactory::ExtractConvertAttrValueToMdId( + m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenMdid, + EdxltokenRelationExtendedStats); + } +} + +//--------------------------------------------------------------------------- +// @function: +// CParseHandlerRelationExtendedStats::EndElement +// +// @doc: +// Invoked by Xerces to process a closing tag +// +//--------------------------------------------------------------------------- +void +CParseHandlerRelationExtendedStats::EndElement( + const XMLCh *const, // element_uri, + const XMLCh *const element_local_name, + const XMLCh *const // element_qname +) +{ + if (0 != XMLString::compareString( + CDXLTokens::XmlstrToken(EdxltokenRelationExtendedStats), + element_local_name)) + { + CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( + m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); + GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, + str->GetBuffer()); + } + + CMDExtStatsInfoArray *extstatsinfo_array = + GPOS_NEW(m_mp) CMDExtStatsInfoArray(m_mp); + + + for (ULONG ul = 0; ul < this->Length(); ul++) + { + CParseHandlerExtStatsInfo *parse_handler_ext_stats_info = + dynamic_cast((*this)[ul]); + CMDExtStatsInfo *info = parse_handler_ext_stats_info->GetInfo(); + info->AddRef(); + + extstatsinfo_array->Append(info); + } + + m_imd_obj = GPOS_NEW(m_mp) + CDXLExtStatsInfo(m_mp, m_mdid, m_mdname, extstatsinfo_array); + + // deactivate handler + m_parse_handler_mgr->DeactivateHandler(); +} + +// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBound.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBound.cpp deleted file mode 100644 index e25d522f310..00000000000 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBound.cpp +++ /dev/null @@ -1,108 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CParseHandlerScalarPartBound.cpp -// -// @doc: -// Implementation of the SAX parse handler class for parsing part bound -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/parser/CParseHandlerScalarPartBound.h" - -#include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartBound.h" -#include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -using namespace gpdxl; - -XERCES_CPP_NAMESPACE_USE - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBound::CParseHandlerScalarPartBound -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CParseHandlerScalarPartBound::CParseHandlerScalarPartBound( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBound::StartElement -// -// @doc: -// Invoked by Xerces to process an opening tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartBound::StartElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const, // element_qname, - const Attributes &attrs) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBound), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartBound); - IMDId *m_mdid_type = CDXLOperatorFactory::ExtractConvertAttrValueToMdId( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenMDType, - EdxltokenScalarPartBound); - BOOL is_lower_bound = CDXLOperatorFactory::ExtractConvertAttrValueToBool( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenScalarPartBoundLower, EdxltokenScalarPartBound); - - m_dxl_node = GPOS_NEW(m_mp) - CDXLNode(m_mp, GPOS_NEW(m_mp) CDXLScalarPartBound( - m_mp, partition_level, m_mdid_type, is_lower_bound)); -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBound::EndElement -// -// @doc: -// Invoked by Xerces to process a closing tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartBound::EndElement(const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const // element_qname -) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBound), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != m_dxl_node); - - // deactivate handler - m_parse_handler_mgr->DeactivateHandler(); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundOpen.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundOpen.cpp deleted file mode 100644 index 3aa7ddfa7c6..00000000000 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartBoundOpen.cpp +++ /dev/null @@ -1,106 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CParseHandlerScalarPartBoundOpen.cpp -// -// @doc: -// Implementation of the SAX parse handler class for parsing part bound openness -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/parser/CParseHandlerScalarPartBoundOpen.h" - -#include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartBoundOpen.h" -#include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -using namespace gpdxl; - -XERCES_CPP_NAMESPACE_USE - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBoundOpen::CParseHandlerScalarPartBoundOpen -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CParseHandlerScalarPartBoundOpen::CParseHandlerScalarPartBoundOpen( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBoundOpen::StartElement -// -// @doc: -// Invoked by Xerces to process an opening tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartBoundOpen::StartElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const, // element_qname, - const Attributes &attrs) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBoundOpen), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartBoundOpen); - BOOL is_lower_bound = CDXLOperatorFactory::ExtractConvertAttrValueToBool( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenScalarPartBoundLower, EdxltokenScalarPartBoundOpen); - - m_dxl_node = GPOS_NEW(m_mp) - CDXLNode(m_mp, GPOS_NEW(m_mp) CDXLScalarPartBoundOpen( - m_mp, partition_level, is_lower_bound)); -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartBoundOpen::EndElement -// -// @doc: -// Invoked by Xerces to process a closing tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartBoundOpen::EndElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const // element_qname -) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartBoundOpen), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != m_dxl_node); - - // deactivate handler - m_parse_handler_mgr->DeactivateHandler(); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartDefault.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartDefault.cpp deleted file mode 100644 index ec46811cb6f..00000000000 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartDefault.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2014 VMware, Inc. or its affiliates. -// -// @filename: -// CParseHandlerScalarPartDefault.cpp -// -// @doc: -// Implementation of the SAX parse handler class for parsing part default -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/parser/CParseHandlerScalarPartDefault.h" - -#include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartDefault.h" -#include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -using namespace gpdxl; - -XERCES_CPP_NAMESPACE_USE - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartDefault::CParseHandlerScalarPartDefault -// -// @doc: -// Ctor -// -//--------------------------------------------------------------------------- -CParseHandlerScalarPartDefault::CParseHandlerScalarPartDefault( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) -{ -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartDefault::StartElement -// -// @doc: -// Invoked by Xerces to process an opening tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartDefault::StartElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const, // element_qname, - const Attributes &attrs) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartDefault), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartDefault); - m_dxl_node = GPOS_NEW(m_mp) CDXLNode( - m_mp, GPOS_NEW(m_mp) CDXLScalarPartDefault(m_mp, partition_level)); -} - -//--------------------------------------------------------------------------- -// @function: -// CParseHandlerScalarPartDefault::EndElement -// -// @doc: -// Invoked by Xerces to process a closing tag -// -//--------------------------------------------------------------------------- -void -CParseHandlerScalarPartDefault::EndElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const // element_qname -) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartDefault), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != m_dxl_node); - - // deactivate handler - m_parse_handler_mgr->DeactivateHandler(); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListNullTest.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListNullTest.cpp deleted file mode 100644 index 6441a4f798d..00000000000 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListNullTest.cpp +++ /dev/null @@ -1,82 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Implementation of the SAX parse handler class for parsing part list -// null test -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/parser/CParseHandlerScalarPartListNullTest.h" - -#include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartListNullTest.h" -#include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -using namespace gpdxl; - -XERCES_CPP_NAMESPACE_USE - -// Ctor -CParseHandlerScalarPartListNullTest::CParseHandlerScalarPartListNullTest( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) -{ -} - -// Invoked by Xerces to process an opening tag -void -CParseHandlerScalarPartListNullTest::StartElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const, // element_qname, - const Attributes &attrs) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartListNullTest), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartListNullTest); - BOOL is_null = CDXLOperatorFactory::ExtractConvertAttrValueToBool( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenScalarIsNull, EdxltokenScalarPartListNullTest); - - m_dxl_node = - GPOS_NEW(m_mp) CDXLNode(m_mp, GPOS_NEW(m_mp) CDXLScalarPartListNullTest( - m_mp, partition_level, is_null)); -} - -// Invoked by Xerces to process a closing tag -void -CParseHandlerScalarPartListNullTest::EndElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const // element_qname -) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartListNullTest), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != m_dxl_node); - - // deactivate handler - m_parse_handler_mgr->DeactivateHandler(); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListValues.cpp b/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListValues.cpp deleted file mode 100644 index 5c7b82329c0..00000000000 --- a/src/backend/gporca/libnaucrates/src/parser/CParseHandlerScalarPartListValues.cpp +++ /dev/null @@ -1,84 +0,0 @@ -//--------------------------------------------------------------------------- -// Greenplum Database -// Copyright (C) 2017 VMware, Inc. or its affiliates. -// -// Implementation of the SAX parse handler class for parsing part list -// values -//--------------------------------------------------------------------------- - -#include "naucrates/dxl/parser/CParseHandlerScalarPartListValues.h" - -#include "naucrates/dxl/operators/CDXLOperatorFactory.h" -#include "naucrates/dxl/operators/CDXLScalarPartListValues.h" -#include "naucrates/dxl/parser/CParseHandlerFactory.h" -#include "naucrates/dxl/parser/CParseHandlerScalarOp.h" - -using namespace gpdxl; - -XERCES_CPP_NAMESPACE_USE - -// Ctor -CParseHandlerScalarPartListValues::CParseHandlerScalarPartListValues( - CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, - CParseHandlerBase *parse_handler_root) - : CParseHandlerScalarOp(mp, parse_handler_mgr, parse_handler_root) -{ -} - -// Invoked by Xerces to process an opening tag -void -CParseHandlerScalarPartListValues::StartElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const, // element_qname, - const Attributes &attrs) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartListValues), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - ULONG partition_level = CDXLOperatorFactory::ExtractConvertAttrValueToUlong( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, EdxltokenPartLevel, - EdxltokenScalarPartListValues); - IMDId *mdid_result = CDXLOperatorFactory::ExtractConvertAttrValueToMdId( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenGPDBScalarOpResultTypeId, EdxltokenScalarPartListValues); - IMDId *mdid_element = CDXLOperatorFactory::ExtractConvertAttrValueToMdId( - m_parse_handler_mgr->GetDXLMemoryManager(), attrs, - EdxltokenArrayElementType, EdxltokenScalarPartListValues); - m_dxl_node = GPOS_NEW(m_mp) - CDXLNode(m_mp, GPOS_NEW(m_mp) CDXLScalarPartListValues( - m_mp, partition_level, mdid_result, mdid_element)); -} - -// Invoked by Xerces to process a closing tag -void -CParseHandlerScalarPartListValues::EndElement( - const XMLCh *const, // element_uri, - const XMLCh *const element_local_name, - const XMLCh *const // element_qname -) -{ - if (0 != XMLString::compareString( - CDXLTokens::XmlstrToken(EdxltokenScalarPartListValues), - element_local_name)) - { - CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray( - m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name); - GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, - str->GetBuffer()); - } - - GPOS_ASSERT(nullptr != m_dxl_node); - - // deactivate handler - m_parse_handler_mgr->DeactivateHandler(); -} - -// EOF diff --git a/src/backend/gporca/libnaucrates/src/parser/Makefile b/src/backend/gporca/libnaucrates/src/parser/Makefile index a1845394216..d1fff568e8c 100644 --- a/src/backend/gporca/libnaucrates/src/parser/Makefile +++ b/src/backend/gporca/libnaucrates/src/parser/Makefile @@ -115,6 +115,13 @@ OBJS = CParseHandlerAgg.o \ CParseHandlerRandomMotion.o \ CParseHandlerRedistributeMotion.o \ CParseHandlerRelStats.o \ + CParseHandlerRelationExtendedStats.o \ + CParseHandlerExtStatsInfo.o \ + CParseHandlerExtStats.o \ + CParseHandlerExtStatsDependency.o \ + CParseHandlerExtStatsDependencies.o \ + CParseHandlerExtStatsNDistinct.o \ + CParseHandlerExtStatsNDistinctList.o \ CParseHandlerResult.o \ CParseHandlerRoutedMotion.o \ CParseHandlerScalarAggref.o \ @@ -147,12 +154,6 @@ OBJS = CParseHandlerAgg.o \ CParseHandlerScalarOp.o \ CParseHandlerScalarOpExpr.o \ CParseHandlerScalarOpList.o \ - CParseHandlerScalarPartBound.o \ - CParseHandlerScalarPartBoundInclusion.o \ - CParseHandlerScalarPartBoundOpen.o \ - CParseHandlerScalarPartDefault.o \ - CParseHandlerScalarPartListNullTest.o \ - CParseHandlerScalarPartListValues.o \ CParseHandlerScalarSubPlan.o \ CParseHandlerScalarSubPlanParam.o \ CParseHandlerScalarSubPlanParamList.o \ diff --git a/src/backend/gporca/libnaucrates/src/statistics/CExtendedStatsProcessor.cpp b/src/backend/gporca/libnaucrates/src/statistics/CExtendedStatsProcessor.cpp new file mode 100644 index 00000000000..85c38e7f483 --- /dev/null +++ b/src/backend/gporca/libnaucrates/src/statistics/CExtendedStatsProcessor.cpp @@ -0,0 +1,541 @@ +//--------------------------------------------------------------------------- +// Greenplum Database +// Copyright 2023 VMware, Inc. or its affiliates. +// +// @filename: +// CExtendedStatsProcessor.cpp +// +// @doc: +// Statistics helper routines for processing extended statistics. +// +// Many functions in this file are mirrored versions of functions in +// dependencies.c and selfuncs.c. Ideally they should stay in sync. +// Unfortunately, the duplication is necessary due ORCA's DXL abstraction +// that by design it to be independent of backend core. In other words, we +// do not necessarily have access to backend core functions. Hence the +// need to mirror them here. +//--------------------------------------------------------------------------- + +#include "naucrates/statistics/CExtendedStatsProcessor.h" + +#include "gpos/common/CBitSet.h" + +#include "naucrates/md/CMDExtStatsInfo.h" +#include "naucrates/statistics/CFilterStatsProcessor.h" + + +#define STATS_MAX_DIMENSIONS 8 /* max number of attributes */ + +#define InvalidOid 0 + + +using namespace gpopt; + +static BOOL +IsDependencyCapablePredicate(CStatsPred *child_pred GPOS_UNUSED) +{ + return child_pred->GetPredStatsType() == CStatsPred::EsptPoint; +} + +/* + * choose_best_statistics + * Look for and return statistics with the specified 'requiredkind' which + * have keys that match at least two of the given attnums. Return NULL if + * there's no match. + * + * The current selection criteria is very simple - we choose the statistics + * object referencing the most of the requested attributes, breaking ties + * in favor of objects with fewer keys overall. + * + * XXX If multiple statistics objects tie on both criteria, then which object + * is chosen depends on the order that they appear in the stats list. Perhaps + * further tiebreakers are needed. + * + * NB: This function is modified version of choose_best_statistics() in + * dependencies.c. + */ +CMDExtStatsInfo * +choose_best_statistics(CMemoryPool *mp, + CMDExtStatsInfoArray *md_statsinfo_array, + CBitSet *attnums, + CMDExtStatsInfo::Estattype requiredkind) +{ + CMDExtStatsInfo *best_match = nullptr; + int best_num_matched = 2; /* goal #1: maximize */ + int best_match_keys = (STATS_MAX_DIMENSIONS + 1); /* goal #2: minimize */ + + for (ULONG i = 0; i < md_statsinfo_array->Size(); i++) + { + CMDExtStatsInfo *info = (*md_statsinfo_array)[i]; + int num_matched; + int numkeys; + CBitSet *matched; + + /* skip statistics that are not of the correct type */ + if (info->GetStatKind() != requiredkind) + { + continue; + } + + /* determine how many attributes of these stats can be matched to */ + matched = GPOS_NEW(mp) CBitSet(mp, *attnums); + matched->Intersection(info->GetStatKeys()); + num_matched = matched->Size(); + matched->Release(); + + /* + * save the actual number of keys in the stats so that we can choose + * the narrowest stats with the most matching keys. + */ + numkeys = info->GetStatKeys()->Size(); + + /* + * Use this object when it increases the number of matched clauses or + * when it matches the same number of attributes but these stats have + * fewer keys than any previous match. + */ + if (num_matched > best_num_matched || + (num_matched == best_num_matched && numkeys < best_match_keys)) + { + best_match = info; + best_num_matched = num_matched; + best_match_keys = numkeys; + } + } + + return best_match; +} + +/* + * dependency_implies_attribute + * check that the attnum matches is implied by the functional dependency + * + * NB: This function is modified version of dependency_implies_attribute() in + * dependencies.c. + */ +static bool +dependency_implies_attribute(CMDDependency *dependency, INT attnum) +{ + if (attnum == dependency->GetToAttno()) + { + return true; + } + + return false; +} + +/* + * dependency_is_fully_matched + * checks that a functional dependency is fully matched given clauses on + * attributes (assuming the clauses are suitable equality clauses) + * + * NB: This function is modified version of dependency_is_fully_matched() in + * dependencies.c. + */ +static bool +dependency_is_fully_matched(CMDDependency *dependency, CBitSet *attnums) +{ + /* + * Check that the dependency actually is fully covered by clauses. We have + * to translate all attribute numbers, as those are referenced + */ + for (ULONG j = 0; j < dependency->GetNAttributes() - 1; j++) + { + int attnum = *(*dependency->GetFromAttno())[j]; + + if (!attnums->Get(attnum)) + { + return false; + } + } + + return attnums->Get(dependency->GetToAttno()); +} + +/* + * find_strongest_dependency + * find the strongest dependency on the attributes + * + * When applying functional dependencies, we start with the strongest + * dependencies. That is, we select the dependency that: + * + * (a) has all attributes covered by equality clauses + * + * (b) has the most attributes + * + * (c) has the highest degree of validity + * + * This guarantees that we eliminate the most redundant conditions first + * (see the comment in dependencies_clauselist_selectivity). + * + * NB: This function is modified version of find_strongest_dependency() in + * dependencies.c. + */ +static CMDDependency * +find_strongest_dependency(CMDDependencyArray *dependencies, CBitSet *attnums) +{ + ULONG i; + CMDDependency *strongest = nullptr; + + /* number of attnums in clauses */ + ULONG nattnums = attnums->Size(); + + /* + * Iterate over the MVDependency items and find the strongest one from the + * fully-matched dependencies. We do the cheap checks first, before + * matching it against the attnums. + */ + for (i = 0; i < dependencies->Size(); i++) + { + CMDDependency *dependency = (*dependencies)[i]; + + /* + * Skip dependencies referencing more attributes than available + * clauses, as those can't be fully matched. + */ + if (dependency->GetNAttributes() > nattnums) + { + continue; + } + + if (strongest) + { + /* skip dependencies on fewer attributes than the strongest. */ + if (dependency->GetNAttributes() < strongest->GetNAttributes()) + { + continue; + } + + /* also skip weaker dependencies when attribute count matches */ + if (strongest->GetNAttributes() == dependency->GetNAttributes() && + strongest->GetDegree() > dependency->GetDegree()) + { + continue; + } + } + + /* + * this dependency is stronger, but we must still check that it's + * fully matched to these attnums. We perform this check last as it's + * slightly more expensive than the previous checks. + */ + if (dependency_is_fully_matched(dependency, attnums)) + { + strongest = dependency; /* save new best match */ + } + } + + return strongest; +} + +//--------------------------------------------------------------------------- +// @function: +// CExtendedStatsProcessor::ApplyCorrelatedStatsToScaleFactorFilterCalculation +// +// @doc: +// This function is essentially an ORCA version of the dependencies.c +// function dependencies_clauselist_selectivity(). It determines the most +// suitable extended statistic to apply and computes the scale factor for +// the conjunctive_pred_stats. +// +//--------------------------------------------------------------------------- +void +CExtendedStatsProcessor::ApplyCorrelatedStatsToScaleFactorFilterCalculation( + CDoubleArray *scale_factors, CStatsPredConj *conjunctive_pred_stats, + const IMDExtStatsInfo *md_statsinfo, UlongToIntMap *colid_to_attno_mapping, + CMemoryPool *mp, UlongToHistogramMap *result_histograms) +{ + GPOS_ASSERT(scale_factors->Size() == 0); + + if (!md_statsinfo || md_statsinfo->GetExtStatInfoArray()->Size() == 0) + { + return; + } + + DOUBLE s1 = 1.0; + CMDExtStatsInfo *stat; + CMDDependencyArray *dependencies; + + CBitSet *clauses_attnums = GPOS_NEW(mp) CBitSet(mp); + + /* + * Pre-process the clauses list to extract the attnums seen in each item. + * We need to determine if there's any clauses which will be useful for + * dependency selectivity estimations. Along the way we'll record all of + * the attnums for each clause in a list which we'll reference later so we + * don't need to repeat the same work again. We'll also keep track of all + * attnums seen. + * + * We also skip clauses that we already estimated using different types of + * statistics (we treat them as incompatible). + */ + for (ULONG ul = 0; ul < conjunctive_pred_stats->GetNumPreds(); ul++) + { + CStatsPred *child_pred = conjunctive_pred_stats->GetPredStats(ul); + if (!child_pred->IsAlreadyUsedInScaleFactorEstimation() && + IsDependencyCapablePredicate(child_pred)) + { + ULONG colid = child_pred->GetColId(); + INT *attnum = colid_to_attno_mapping->Find(&colid); + clauses_attnums->ExchangeSet(*attnum); + } + } + + /* + * If there's not at least two distinct attnums then reject the whole list + * of clauses. + */ + if (clauses_attnums->Size() < 2) + { + return; + } + + /* find the best suited statistics object for these attnums */ + stat = choose_best_statistics(mp, md_statsinfo->GetExtStatInfoArray(), + clauses_attnums, + CMDExtStatsInfo::EstatDependencies); + + if (!stat) + { + return; + } + + const COptCtxt *poctxt = COptCtxt::PoctxtFromTLS(); + CMDAccessor *md_accessor = poctxt->Pmda(); + + CMDIdGPDB *pmdid = + GPOS_NEW(mp) CMDIdGPDB(IMDId::EmdidExtStats, stat->GetStatOid()); + const IMDExtStats *extstats = md_accessor->RetrieveExtStats(pmdid); + pmdid->Release(); + + /* load the dependency items stored in the statistics object */ + dependencies = extstats->GetDependencies(); + + /* + * Apply the dependencies recursively, starting with the widest/strongest + * ones, and proceeding to the smaller/weaker ones. At the end of each + * round we factor in the selectivity of clauses on the implied attribute, + * and remove the clauses from the list. + */ + while (true) + { + DOUBLE s2 = 1.0; + CMDDependency *dependency; + + /* the widest/strongest dependency, fully matched by clauses */ + dependency = find_strongest_dependency(dependencies, clauses_attnums); + + /* if no suitable dependency was found, we're done */ + if (!dependency) + { + break; + } + + /* + * We found an applicable dependency, so find all the clauses on the + * implied attribute - with dependency (a,b => c) we look for clauses + * on 'c'. + */ + const ULONG filters = conjunctive_pred_stats->GetNumPreds(); + for (ULONG ul = 0; ul < filters; ul++) + { + CStatsPred *child_pred = conjunctive_pred_stats->GetPredStats(ul); + + /* + * Skip incompatible clauses, and ones we've already estimated on. + */ + if (child_pred->IsAlreadyUsedInScaleFactorEstimation()) + { + continue; + } + + ULONG colid = child_pred->GetColId(); + INT *attnum = colid_to_attno_mapping->Find(&colid); + + /* + * Technically we could find more than one clause for a given + * attnum. Since these clauses must be equality clauses, we choose + * to only take the selectivity estimate from the final clause in + * the list for this attnum. If the attnum happens to be compared + * to a different Const in another clause then no rows will match + * anyway. If it happens to be compared to the same Const, then + * ignoring the additional clause is just the thing to do. + */ + if (dependency_implies_attribute(dependency, *attnum)) + { + s2 = 1 / result_histograms->Find(&colid)->GetFrequency().Get(); + + /* mark this one as done, so we don't touch it again. */ + child_pred->SetEstimated(); + + /* + * Mark that we've got and used the dependency on this clause. + * We'll want to ignore this when looking for the next + * strongest dependency above. + */ + clauses_attnums->ExchangeClear(*attnum); + } + } + + /* + * Now factor in the selectivity for all the "implied" clauses into + * the final one, using this formula: + * + * P(a,b) = P(a) * (f + (1-f) * P(b)) + * + * where 'f' is the degree of validity of the dependency. + */ + s1 *= (dependency->GetDegree().Get() + + (1 - dependency->GetDegree().Get()) * s2); + } + scale_factors->Append(GPOS_NEW(mp) CDouble(s1)); + + clauses_attnums->Release(); +} + +//--------------------------------------------------------------------------- +// @function: +// CExtendedStatsProcessor::ApplyCorrelatedStatsToNDistinctCalculation +// +// @doc: +// This function is essentially an ORCA version of the selfuncs.c +// function estimate_multivariate_ndistinct(). It determines the most +// suitable extended statistic to apply and calculate ndistinct. +//--------------------------------------------------------------------------- +bool +CExtendedStatsProcessor::ApplyCorrelatedStatsToNDistinctCalculation( + CMemoryPool *mp, const IMDExtStatsInfo *md_statsinfo, + const UlongToIntMap *colid_to_attno_mapping, + ULongPtrArray *&src_grouping_cols, DOUBLE *ndistinct) +{ + int nmatches; + OID statOid = InvalidOid; + const IMDExtStats *stats; + CBitSet *attnums = nullptr; + CBitSet *matched = nullptr; + + /* bail out immediately if the table has no extended statistics */ + if (!md_statsinfo || !colid_to_attno_mapping) + { + return false; + } + + attnums = GPOS_NEW(mp) CBitSet(mp); + for (ULONG ul = 0; ul < src_grouping_cols->Size(); ul++) + { + ULONG colid = *(*src_grouping_cols)[ul]; + + INT *attnum = colid_to_attno_mapping->Find(&colid); + if (!attnum) + { + attnums->Release(); + return false; + } + attnums->ExchangeSet(*attnum); + } + + /* look for the ndistinct statistics matching the most vars */ + nmatches = 1; /* we require at least two matches */ + + CMDExtStatsInfoArray *md_statsinfo_array = + md_statsinfo->GetExtStatInfoArray(); + for (ULONG ul = 0; ul < md_statsinfo_array->Size(); ul++) + { + CMDExtStatsInfo *info = (*md_statsinfo_array)[ul]; + CBitSet *shared = GPOS_NEW(mp) CBitSet(mp, *attnums); + int nshared; + + /* skip statistics of other kinds */ + if (info->GetStatKind() != CMDExtStatsInfo::EstatNDistinct) + { + shared->Release(); + continue; + } + + /* compute attnums shared by the vars and the statistics object */ + shared->Intersection(info->GetStatKeys()); + nshared = shared->Size(); + + /* + * Does this statistics object match more columns than the currently + * best object? If so, use this one instead. + * + * XXX This should break ties using name of the object, or something + * like that, to make the outcome stable. + */ + if (nshared > nmatches) + { + CRefCount::SafeRelease(matched); + + statOid = info->GetStatOid(); + nmatches = nshared; + matched = shared; + } + else + { + shared->Release(); + } + } + + /* No match? */ + if (statOid == InvalidOid) + { + CRefCount::SafeRelease(matched); + attnums->Release(); + return false; + } + + const COptCtxt *poctxt = COptCtxt::PoctxtFromTLS(); + CMDAccessor *md_accessor = poctxt->Pmda(); + + CMDIdGPDB *pmdid = GPOS_NEW(mp) CMDIdGPDB(IMDId::EmdidExtStats, statOid); + stats = md_accessor->RetrieveExtStats(pmdid); + pmdid->Release(); + + /* + * If we have a match, search it for the specific item that matches (there + * must be one), and construct the output values. + */ + if (stats) + { + CMDNDistinct *item = nullptr; + + /* Find the specific item that exactly matches the combination */ + for (ULONG i = 0; i < stats->GetNDistinctList()->Size(); i++) + { + CMDNDistinct *tmpitem = (*stats->GetNDistinctList())[i]; + + if (tmpitem->GetAttrs()->Equals(matched)) + { + item = tmpitem; + break; + } + } + + /* Form the output varinfo list, keeping only unmatched ones */ + ULongPtrArray *new_src_grouping_cols = GPOS_NEW(mp) ULongPtrArray(mp); + for (ULONG ul = 0; ul < src_grouping_cols->Size(); ul++) + { + ULONG colid = *(*src_grouping_cols)[ul]; + + INT *attnum = colid_to_attno_mapping->Find(&colid); + if (!matched->Get(*attnum)) + { + new_src_grouping_cols->Append(GPOS_NEW(mp) ULONG(colid)); + } + } + src_grouping_cols->Release(); + src_grouping_cols = new_src_grouping_cols; + + matched->Release(); + attnums->Release(); + + *ndistinct = item->GetNDistinct().Get(); + return true; + } + + matched->Release(); + + attnums->Release(); + return false; +} diff --git a/src/backend/gporca/libnaucrates/src/statistics/CFilterStatsProcessor.cpp b/src/backend/gporca/libnaucrates/src/statistics/CFilterStatsProcessor.cpp index d2bad37c1d2..bd87972500b 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/CFilterStatsProcessor.cpp +++ b/src/backend/gporca/libnaucrates/src/statistics/CFilterStatsProcessor.cpp @@ -17,6 +17,7 @@ #include "gpopt/operators/CScalarCmp.h" #include "gpopt/optimizer/COptimizerConfig.h" #include "naucrates/statistics/CBucket.h" +#include "naucrates/statistics/CExtendedStatsProcessor.h" #include "naucrates/statistics/CJoinStatsProcessor.h" #include "naucrates/statistics/CScaleFactorUtils.h" #include "naucrates/statistics/CStatistics.h" @@ -231,7 +232,7 @@ CFilterStatsProcessor::MakeStatsFilter(CMemoryPool *mp, { histograms_new = MakeHistHashMapConjOrDisjFilter( mp, stats_config, histograms_copy, input_rows, base_pred_stats, - &scale_factor); + &scale_factor, input_stats); GPOS_ASSERT(CStatistics::MinRows.Get() <= scale_factor.Get()); rows_filter = input_rows / scale_factor; @@ -268,7 +269,8 @@ UlongToHistogramMap * CFilterStatsProcessor::MakeHistHashMapConjOrDisjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *input_histograms, CDouble input_rows, - CStatsPred *pred_stats, CDouble *scale_factor) + CStatsPred *pred_stats, CDouble *scale_factor, + const CStatistics *input_stats) { GPOS_ASSERT(nullptr != pred_stats); GPOS_ASSERT(nullptr != stats_config); @@ -282,14 +284,14 @@ CFilterStatsProcessor::MakeHistHashMapConjOrDisjFilter( CStatsPredConj::ConvertPredStats(pred_stats); return MakeHistHashMapConjFilter(mp, stats_config, input_histograms, input_rows, conjunctive_pred_stats, - scale_factor); + scale_factor, input_stats); } CStatsPredDisj *disjunctive_pred_stats = CStatsPredDisj::ConvertPredStats(pred_stats); result_histograms = MakeHistHashMapDisjFilter( mp, stats_config, input_histograms, input_rows, disjunctive_pred_stats, - scale_factor); + scale_factor, input_stats); GPOS_ASSERT(nullptr != result_histograms); @@ -301,7 +303,8 @@ UlongToHistogramMap * CFilterStatsProcessor::MakeHistHashMapConjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *input_histograms, CDouble input_rows, - CStatsPredConj *conjunctive_pred_stats, CDouble *scale_factor) + CStatsPredConj *conjunctive_pred_stats, CDouble *scale_factor, + const CStatistics *input_stats) { GPOS_ASSERT(nullptr != stats_config); GPOS_ASSERT(nullptr != input_histograms); @@ -316,6 +319,10 @@ CFilterStatsProcessor::MakeHistHashMapConjFilter( UlongToHistogramMap *result_histograms = CStatisticsUtils::CopyHistHashMap(mp, input_histograms); + CExtendedStatsProcessor::ApplyCorrelatedStatsToScaleFactorFilterCalculation( + scale_factors, conjunctive_pred_stats, input_stats->GetExtStatsInfo(), + input_stats->GetColidToAttnoMapping(), mp, result_histograms); + // properties of last seen column CDouble last_scale_factor(1.0); ULONG last_colid = gpos::ulong_max; @@ -326,6 +333,12 @@ CFilterStatsProcessor::MakeHistHashMapConjFilter( { CStatsPred *child_pred_stats = conjunctive_pred_stats->GetPredStats(ul); + // Skip clauses we've already used in our estimate calculation + if (child_pred_stats->IsAlreadyUsedInScaleFactorEstimation()) + { + continue; + } + GPOS_ASSERT(CStatsPred::EsptConj != child_pred_stats->GetPredStatsType()); @@ -409,7 +422,8 @@ CFilterStatsProcessor::MakeHistHashMapConjFilter( UlongToHistogramMap *disjunctive_histograms_after = MakeHistHashMapDisjFilter( mp, stats_config, result_histograms, num_disj_input_rows, - disjunctive_pred_stats, &disjunctive_scale_factor); + disjunctive_pred_stats, &disjunctive_scale_factor, + input_stats); // replace intermediate result with the newly generated result from the disjunction if (gpos::ulong_max != colid) @@ -457,7 +471,8 @@ UlongToHistogramMap * CFilterStatsProcessor::MakeHistHashMapDisjFilter( CMemoryPool *mp, const CStatisticsConfig *stats_config, UlongToHistogramMap *input_histograms, CDouble input_rows, - CStatsPredDisj *disjunctive_pred_stats, CDouble *scale_factor) + CStatsPredDisj *disjunctive_pred_stats, CDouble *scale_factor, + const CStatistics *input_stats) { GPOS_ASSERT(nullptr != stats_config); GPOS_ASSERT(nullptr != input_histograms); @@ -542,7 +557,7 @@ CFilterStatsProcessor::MakeHistHashMapDisjFilter( { child_histograms = MakeHistHashMapConjOrDisjFilter( mp, stats_config, input_histograms, input_rows, - child_pred_stats, &child_scale_factor); + child_pred_stats, &child_scale_factor, input_stats); GPOS_ASSERT_IMP( CStatsPred::EsptDisj == child_pred_stats->GetPredStatsType(), diff --git a/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp b/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp index 3573e5cd3c8..3395897c2d6 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp +++ b/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp @@ -1750,7 +1750,7 @@ CHistogram::CombineBuckets(CMemoryPool *mp, CBucketArray *buckets, CDouble(0.0) + CStatistics::Epsilon); #endif - // GPDB_12_MERGE_FIXME: the desired_num_buckets handling is broken for singleton buckets + // FIXME: the desired_num_buckets handling is broken for singleton buckets // While it limits the number of buckets for non-singleton buckets, singleton buckets // are not merged, and thus we can get cases where the number of result buckets is // larger than the desired number of buckets diff --git a/src/backend/gporca/libnaucrates/src/statistics/CStatistics.cpp b/src/backend/gporca/libnaucrates/src/statistics/CStatistics.cpp index ce184111964..3899ff156f6 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/CStatistics.cpp +++ b/src/backend/gporca/libnaucrates/src/statistics/CStatistics.cpp @@ -71,7 +71,9 @@ CStatistics::CStatistics(CMemoryPool *mp, m_num_rebinds( 1.0), // by default, a stats object is rebound to parameters only once m_num_predicates(num_predicates), - m_src_upper_bound_NDVs(nullptr) + m_src_upper_bound_NDVs(nullptr), + m_ext_stats(nullptr), + m_colid_to_attno_mapping(GPOS_NEW(mp) UlongToIntMap(mp)) { GPOS_ASSERT(nullptr != m_colid_histogram_mapping); GPOS_ASSERT(nullptr != m_colid_width_mapping); @@ -88,7 +90,9 @@ CStatistics::CStatistics(CMemoryPool *mp, UlongToHistogramMap *col_histogram_mapping, UlongToDoubleMap *colid_width_mapping, CDouble rows, BOOL is_empty, ULONG relpages, ULONG relallvisible, - CDouble rebinds, ULONG num_predicates) + CDouble rebinds, ULONG num_predicates, + const IMDExtStatsInfo *extstats, + UlongToIntMap *colid_to_attno_mapping) : m_colid_histogram_mapping(col_histogram_mapping), m_colid_width_mapping(colid_width_mapping), m_rows(rows), @@ -98,7 +102,9 @@ CStatistics::CStatistics(CMemoryPool *mp, m_relallvisible(relallvisible), m_num_rebinds(rebinds), m_num_predicates(num_predicates), - m_src_upper_bound_NDVs(nullptr) + m_src_upper_bound_NDVs(nullptr), + m_ext_stats(extstats), + m_colid_to_attno_mapping(colid_to_attno_mapping) { GPOS_ASSERT(nullptr != m_colid_histogram_mapping); GPOS_ASSERT(nullptr != m_colid_width_mapping); @@ -117,6 +123,7 @@ CStatistics::~CStatistics() m_colid_histogram_mapping->Release(); m_colid_width_mapping->Release(); m_src_upper_bound_NDVs->Release(); + m_colid_to_attno_mapping->Release(); } // look up the width of a particular column @@ -569,10 +576,13 @@ CStatistics::ScaleStats(CMemoryPool *mp, CDouble factor) const CDouble scaled_num_rows = m_rows * factor; + m_colid_to_attno_mapping->AddRef(); + // create a scaled stats object - CStatistics *scaled_stats = GPOS_NEW(mp) CStatistics( - mp, histograms_new, widths_new, scaled_num_rows, IsEmpty(), RelPages(), - RelAllVisible(), NumRebinds(), m_num_predicates); + CStatistics *scaled_stats = GPOS_NEW(mp) + CStatistics(mp, histograms_new, widths_new, scaled_num_rows, IsEmpty(), + RelPages(), RelAllVisible(), NumRebinds(), m_num_predicates, + m_ext_stats, m_colid_to_attno_mapping); // In the output statistics object, the upper bound source cardinality of the scaled column // cannot be greater than the the upper bound source cardinality information maintained in the input @@ -603,10 +613,13 @@ CStatistics::CopyStatsWithRemap(CMemoryPool *mp, AddWidthInfoWithRemap(mp, m_colid_width_mapping, widths_new, colref_mapping, must_exist); + m_colid_to_attno_mapping->AddRef(); + // create a copy of the stats object - CStatistics *stats_copy = GPOS_NEW(mp) CStatistics( - mp, histograms_new, widths_new, m_rows, IsEmpty(), RelPages(), - RelAllVisible(), NumRebinds(), m_num_predicates); + CStatistics *stats_copy = GPOS_NEW(mp) + CStatistics(mp, histograms_new, widths_new, m_rows, IsEmpty(), + RelPages(), RelAllVisible(), NumRebinds(), m_num_predicates, + m_ext_stats, m_colid_to_attno_mapping); // In the output statistics object, the upper bound source cardinality of the join column // cannot be greater than the the upper bound source cardinality information maintained in the input diff --git a/src/backend/gporca/libnaucrates/src/statistics/CStatisticsUtils.cpp b/src/backend/gporca/libnaucrates/src/statistics/CStatisticsUtils.cpp index 687e18fcd19..2ecd92c0f60 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/CStatisticsUtils.cpp +++ b/src/backend/gporca/libnaucrates/src/statistics/CStatisticsUtils.cpp @@ -39,6 +39,7 @@ #include "naucrates/md/IMDTypeInt4.h" #include "naucrates/md/IMDTypeInt8.h" #include "naucrates/md/IMDTypeOid.h" +#include "naucrates/statistics/CExtendedStatsProcessor.h" #include "naucrates/statistics/CFilterStatsProcessor.h" #include "naucrates/statistics/CHistogram.h" #include "naucrates/statistics/CJoinStatsProcessor.h" @@ -1070,10 +1071,11 @@ CStatisticsUtils::DeriveStatsForDynamicScan(CMemoryPool *mp, GPOS_ASSERT(pps_reqd->SelectorIds(scan_id)->Size() > 0); + // GPDB_12_MERGE_FEATURE_NOT_SUPPORTED: // each Dynamic Scan may have multiple associated PartitionSelectors; // for now just use the first one in the list (similar to 6X, which used - // the PartitionSelector on the top-most Join node) - // GPDB_12_MERGE_FIXME: combine stats from all associated PartitionSelectors + // the PartitionSelector on the top-most Join node). Ideally, we would + // combine partition selectors here to get a more accurate stats estimate const SPartSelectorInfoEntry *part_selector_info = nullptr; { CBitSetIter it(*selector_ids); @@ -1507,8 +1509,37 @@ CStatisticsUtils::MaxNumGroupsForGivenSrcGprCols( CColRef *first_colref = col_factory->LookupColRef(*(*src_grouping_cols)[0]); CDouble upper_bound_ndvs = input_stats->GetColUpperBoundNDVs(first_colref); + DOUBLE mvndistinct; + ULongPtrArray *updated_src_grouping_cols = GPOS_NEW(mp) ULongPtrArray(mp); + for (ULONG ul = 0; ul < src_grouping_cols->Size(); ul++) + { + updated_src_grouping_cols->Append(GPOS_NEW(mp) + ULONG(*(*src_grouping_cols)[ul])); + } + CDoubleArray *ndvs = GPOS_NEW(mp) CDoubleArray(mp); - AddNdvForAllGrpCols(mp, input_stats, src_grouping_cols, ndvs); + + // Use all applicable multivariate n-distinct correlated stats + while (true) + { + if (CExtendedStatsProcessor::ApplyCorrelatedStatsToNDistinctCalculation( + mp, input_stats->GetExtStatsInfo(), + input_stats->GetColidToAttnoMapping(), + updated_src_grouping_cols, &mvndistinct)) + { + ndvs->Append(GPOS_NEW(mp) CDouble(mvndistinct)); + } + else + { + // No more relevant multivariate n-distinct stats + break; + } + } + + // add any remaining columns not covered by multivariate n-distinct + // correlated stats + AddNdvForAllGrpCols(mp, input_stats, updated_src_grouping_cols, ndvs); + updated_src_grouping_cols->Release(); // take the minimum of (a) the estimated number of groups from the columns of this source, // (b) input rows, and (c) cardinality upper bound for the given source in the diff --git a/src/backend/gporca/libnaucrates/src/statistics/Makefile b/src/backend/gporca/libnaucrates/src/statistics/Makefile index f2e196070ef..88ac97404e8 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/Makefile +++ b/src/backend/gporca/libnaucrates/src/statistics/Makefile @@ -12,6 +12,7 @@ include $(top_srcdir)/src/backend/gporca/gporca.mk OBJS = CBucket.o \ CFilterStatsProcessor.o \ + CExtendedStatsProcessor.o \ CGroupByStatsProcessor.o \ CHistogram.o \ CInnerJoinStatsProcessor.o \ diff --git a/src/backend/gporca/libnaucrates/src/xml/dxltokens.cpp b/src/backend/gporca/libnaucrates/src/xml/dxltokens.cpp index 4748db58bd8..0e8b12e332b 100644 --- a/src/backend/gporca/libnaucrates/src/xml/dxltokens.cpp +++ b/src/backend/gporca/libnaucrates/src/xml/dxltokens.cpp @@ -255,12 +255,6 @@ CDXLTokens::Init(CMemoryPool *mp) {EdxltokenPartLevelFilterList, GPOS_WSZ_LIT("PartFilters")}, {EdxltokenPartLevel, GPOS_WSZ_LIT("Level")}, {EdxltokenScalarPartDefault, GPOS_WSZ_LIT("DefaultPart")}, - {EdxltokenScalarPartBound, GPOS_WSZ_LIT("PartBound")}, - {EdxltokenScalarPartBoundLower, GPOS_WSZ_LIT("LowerBound")}, - {EdxltokenScalarPartBoundInclusion, GPOS_WSZ_LIT("PartBoundInclusion")}, - {EdxltokenScalarPartBoundOpen, GPOS_WSZ_LIT("PartBoundOpen")}, - {EdxltokenScalarPartListValues, GPOS_WSZ_LIT("PartListValues")}, - {EdxltokenScalarPartListNullTest, GPOS_WSZ_LIT("PartListNullTest")}, {EdxltokenScalarResidualFilter, GPOS_WSZ_LIT("ResidualFilter")}, {EdxltokenScalarPartFilterExpr, GPOS_WSZ_LIT("PartFilterExpr")}, @@ -496,6 +490,7 @@ CDXLTokens::Init(CMemoryPool *mp) {EdxltokenSchema, GPOS_WSZ_LIT("Schema")}, {EdxltokenTablespace, GPOS_WSZ_LIT("Tablespace")}, {EdxltokenOid, GPOS_WSZ_LIT("Oid")}, + {EdxltokenKind, GPOS_WSZ_LIT("Kind")}, {EdxltokenVersion, GPOS_WSZ_LIT("Version")}, {EdxltokenMdid, GPOS_WSZ_LIT("Mdid")}, {EdxltokenLockMode, GPOS_WSZ_LIT("LockMode")}, @@ -506,11 +501,24 @@ CDXLTokens::Init(CMemoryPool *mp) {EdxltokenRelationStats, GPOS_WSZ_LIT("RelationStatistics")}, {EdxltokenColumnStats, GPOS_WSZ_LIT("ColumnStatistics")}, {EdxltokenColumnStatsBucket, GPOS_WSZ_LIT("StatsBucket")}, + {EdxltokenRelationExtendedStats, + GPOS_WSZ_LIT("RelationExtendedStatistics")}, + {EdxltokenExtendedStatsInfo, GPOS_WSZ_LIT("ExtendedStatisticsInfo")}, + {EdxltokenExtendedStats, GPOS_WSZ_LIT("ExtendedStatistics")}, + {EdxltokenMVDependencyList, GPOS_WSZ_LIT("MVDependencyList")}, + {EdxltokenMVDependency, GPOS_WSZ_LIT("MVDependency")}, + {EdxltokenMVNDistinctList, GPOS_WSZ_LIT("MVNDistinctList")}, + {EdxltokenMVNDistinct, GPOS_WSZ_LIT("MVNDistinct")}, + {EdxltokenDegree, GPOS_WSZ_LIT("Degree")}, + {EdxltokenFrom, GPOS_WSZ_LIT("From")}, + {EdxltokenTo, GPOS_WSZ_LIT("To")}, {EdxltokenEmptyRelation, GPOS_WSZ_LIT("EmptyRelation")}, {EdxltokenIsNull, GPOS_WSZ_LIT("IsNull")}, {EdxltokenLintValue, GPOS_WSZ_LIT("LintValue")}, {EdxltokenDoubleValue, GPOS_WSZ_LIT("DoubleValue")}, + {EdxltokenAssignedQueryIdForTargetRel, + GPOS_WSZ_LIT("AssignedQueryIdForTargetRel")}, {EdxltokenRelTemporary, GPOS_WSZ_LIT("IsTemporary")}, @@ -548,7 +556,6 @@ CDXLTokens::Init(CMemoryPool *mp) {EdxltokenPartKeys, GPOS_WSZ_LIT("PartitionColumns")}, {EdxltokenPartTypes, GPOS_WSZ_LIT("PartitionTypes")}, - {EdxltokenNumLeafPartitions, GPOS_WSZ_LIT("NumberLeafPartitions")}, {EdxltokenTypeInt4, GPOS_WSZ_LIT("Int4")}, {EdxltokenTypeBool, GPOS_WSZ_LIT("Bool")}, diff --git a/src/backend/gporca/server/CMakeLists.txt b/src/backend/gporca/server/CMakeLists.txt index f8f43d10f5b..0c9fad2f89a 100644 --- a/src/backend/gporca/server/CMakeLists.txt +++ b/src/backend/gporca/server/CMakeLists.txt @@ -87,7 +87,7 @@ CLikeIDFTest: LIKE-Pattern-green LIKE-Pattern-green-2 LIKE-Pattern-Empty Nested-Or-Predicates Join-IDF LikePredStatsNotComparable PredStatsNotComparable ExtractPredicateFromDisj CollapseNot IDF-NotNullConstant IDF-NullConstant INDF-NotNullConstant INDF-NullConstant NullConstant-INDF-Col -Join-INDF Join-INDF-NoBroadcast TimeTypeStatsNotComparable Join-INDF-Nulls-Not-Collocated; +Join-INDF Join-INDF-NoBroadcast Join-INDF-Nulls-Not-Collocated; CLeftOuterIndexApplyTest: IndexApply-LeftOuter-NLJoin LOJ-IndexApply-MultiIndexes LOJ-IndexApply-Negative-NonEqual-Predicate @@ -159,6 +159,10 @@ CStatsTest: Stat-Derivation-Leaf-Pattern MissingBoolColStats JoinColWithOnlyNDV UnsupportedStatsPredicate StatsFilter-AnyWithNewColStats EquiJoinOnExpr-Supported EquiJoinOnExpr-Unsupported; +CCorrelatedStatsTest: +Correlated-Stat-Function-Dependency Correlated-Stat-Function-Dependency-2 Correlated-Stat-Function-Dependency-3 +Correlated-Stat-NDistinct Correlated-Stat-NDistinct-2 Correlated-Stat-NDistinct-3 Correlated-Stat-NDistinct-4 Correlated-Stat-NDistinct-5; + CICGMiscTest: BroadcastSkewedHashjoin OrderByNullsFirst ConvertHashToRandomSelect ConvertHashToRandomInsert HJN-DeeperOuter CTAS CTAS-Random CheckAsUser CTAS-random-distributed-from-replicated-distributed-table @@ -172,7 +176,9 @@ MultipleDampedPredJoinCardinality MultipleIndependentPredJoinCardinality MultiDi MultiDistKeyWithOtherPredsJoinCardinality NoDistKeyMultiPredJoinCardinality OneDistKeyMultiPredJoinCardinality JoinOnViewWithCastedColumn JoinOnViewWithCastedColumnAndSubqueryInPredicate JoinOnViewWithVolatileColumn JoinOnViewWithMixOfPushableAndNonpushablePredicates JoinOnViewWithSetReturningColumn OuterJoinOnViewWithCastedColumn JoinWithSubqueryProjectColumn -AggSubqCollapseFalseFilter NestedJoinWithCastedColumn; +AggSubqCollapseFalseFilter NestedJoinWithCastedColumn PushConstantSelectPredicateThruJoin-1 PushConstantSelectPredicateThruJoin-2 +PushConstantSelectPredicateThruJoin-3 PushConstantSelectPredicateThruJoin-4 PushConstantSelectPredicateThruJoin-5 PushConstantSelectPredicateThruJoin-6 +PushConstantSelectPredicateThruJoin-7 PushConstantSelectPredicateThruJoin-8 PushConstantSelectPredicateThruJoin-9 PushConstantSelectPredicateThruJoin-10; CArrayCmpTest: ArrayConcat ArrayRef FoldedArrayCmp ArrayCmpAll @@ -309,7 +315,7 @@ JOIN-NonRedistributableCol DQA-NonRedistributableCol MotionHazard-NoMaterializeHashAggUnderResult; CInvalidCostContextTest: -SpoolShouldInvalidateUnresolvedDynamicScans; +SpoolShouldInvalidateUnresolvedDynamicScans DiscardRedistributeHashJoin; CRandomDataInsertionTest: AddRedistributeBeforeInsert-1 AddRedistributeBeforeInsert-2 AddRedistributeBeforeInsert-3 diff --git a/src/backend/gporca/server/src/unittest/CTestUtils.cpp b/src/backend/gporca/server/src/unittest/CTestUtils.cpp index 6e44c48c486..3693cae8c1d 100644 --- a/src/backend/gporca/server/src/unittest/CTestUtils.cpp +++ b/src/backend/gporca/server/src/unittest/CTestUtils.cpp @@ -221,8 +221,9 @@ CTestUtils::PtabdescPlainWithColNameFormat( mp, mdid, nameTable, false, // convert_hash_to_random IMDRelation::EreldistrRandom, IMDRelation::ErelstorageHeap, - 0, // ulExecuteAsUser - -1 // lockmode + 0, // ulExecuteAsUser + -1, // lockmode + 0 // UNASSIGNED_QUERYID ); for (ULONG i = 0; i < num_cols; i++) diff --git a/src/backend/gporca/server/src/unittest/dxl/statistics/CStatisticsTest.cpp b/src/backend/gporca/server/src/unittest/dxl/statistics/CStatisticsTest.cpp index f946e1412d8..a7c0c47b897 100644 --- a/src/backend/gporca/server/src/unittest/dxl/statistics/CStatisticsTest.cpp +++ b/src/backend/gporca/server/src/unittest/dxl/statistics/CStatisticsTest.cpp @@ -317,8 +317,9 @@ CStatisticsTest::PtabdescTwoColumnSource(CMemoryPool *mp, nameTable, false, // convert_hash_to_random IMDRelation::EreldistrRandom, IMDRelation::ErelstorageHeap, - 0, // ulExecuteAsUser - -1 // lockmode + 0, // ulExecuteAsUser + -1, // lockmode + 0 // UNASSIGNED_QUERYID ); for (ULONG i = 0; i < 2; i++) @@ -717,7 +718,8 @@ CStatisticsTest::EresUnittest_CStatisticsCopy() CStatistics *pstats = GPOS_NEW(mp) CStatistics( mp, phmulhist, phmuldoubleWidth, 100.0 /* rows */, false /* is_empty */, ULONG(5) /* relpages */, ULONG(10) /* relallvisible */, - CDouble(100.0) /* rebinds */, ULONG(3) /* num predicates */); + CDouble(100.0) /* rebinds */, ULONG(3) /* num predicates */, nullptr, + GPOS_NEW(mp) UlongToIntMap(mp)); IStatistics *stats_copy = pstats->CopyStats(mp); diff --git a/src/backend/gporca/server/src/unittest/gpopt/base/CConstraintTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/base/CConstraintTest.cpp index d9f95be5b48..96ce1d5b8a1 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/base/CConstraintTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/base/CConstraintTest.cpp @@ -22,6 +22,7 @@ #include "gpopt/base/CDefaultComparator.h" #include "gpopt/base/CUtils.h" #include "gpopt/eval/CConstExprEvaluatorDefault.h" +#include "gpopt/exception.h" #include "gpopt/operators/CPredicateUtils.h" #include "naucrates/base/CDatumInt8GPDB.h" #include "naucrates/md/CMDIdGPDB.h" @@ -98,8 +99,7 @@ CConstraintTest::EresUnittest() CConstraintTest::EresUnittest_CConstraintIntervalFromArrayExpr), #ifdef GPOS_DEBUG GPOS_UNITTEST_FUNC_THROW(CConstraintTest::EresUnittest_NegativeTests, - gpos::CException::ExmaSystem, - gpos::CException::ExmiAssert), + gpopt::ExmaGPOPT, gpopt::ExmiUnsupportedOp), #endif // GPOS_DEBUG GPOS_UNITTEST_FUNC(CConstraintTest::EresUnittest_ConstraintsOnDates), }; diff --git a/src/backend/gporca/server/src/unittest/gpopt/minidump/CDMLTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/minidump/CDMLTest.cpp index 2e84691b940..8303c060ee2 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/minidump/CDMLTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/minidump/CDMLTest.cpp @@ -47,6 +47,7 @@ const CHAR *rgszDMLFileNames[] = { "../data/dxl/minidump/InsertSortDistributed2MasterOnly.mdp", "../data/dxl/minidump/InsertProjectSort.mdp", "../data/dxl/minidump/InsertAssertSort.mdp", + "../data/dxl/minidump/Delete-Check-AssignedQueryIdForTargetRel.mdp", "../data/dxl/minidump/UpdateRandomDistr.mdp", "../data/dxl/minidump/DeleteRandomDistr.mdp", "../data/dxl/minidump/DeleteRandomlyDistributedTableJoin.mdp", diff --git a/src/backend/gporca/server/src/unittest/gpopt/minidump/CDirectDispatchTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/minidump/CDirectDispatchTest.cpp index d43eba38a4a..31aebb9f1a0 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/minidump/CDirectDispatchTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/minidump/CDirectDispatchTest.cpp @@ -41,6 +41,8 @@ const CHAR *rgszDirectDispatchFileNames[] = { "../data/dxl/minidump/DirectDispatch-IndexScan.mdp", "../data/dxl/minidump/DirectDispatch-DynamicIndexScan.mdp", "../data/dxl/minidump/InsertDirectedDispatchNullValue.mdp", + "../data/dxl/minidump/DirectDispatch-RandDistTable.mdp", + "../data/dxl/minidump/DirectDispatch-RandDistTable-Disjunction.mdp", }; //--------------------------------------------------------------------------- diff --git a/src/backend/gporca/server/src/unittest/gpopt/minidump/CICGTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/minidump/CICGTest.cpp index 603f5ffc040..896eea45b8c 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/minidump/CICGTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/minidump/CICGTest.cpp @@ -63,8 +63,6 @@ const CHAR *rgszFileNames[] = { "../data/dxl/minidump/HAWQ-TPCH-Stat-Derivation.mdp", "../data/dxl/minidump/HJN-Redistribute-One-Side.mdp", - // GPDB_12_MERGE_FIXME Needs review: assertion failure - // "../data/dxl/minidump/TPCH-Q5.mdp", "../data/dxl/minidump/TPCDS-39-InnerJoin-JoinEstimate.mdp", "../data/dxl/minidump/TPCH-Partitioned-256GB.mdp", // TODO: - Jul 31st 2018; disabling it since new cost model picks up Indexed nested Loop Joi @@ -162,8 +160,6 @@ GPOS_RESULT CICGTest::EresUnittest_RunTestsWithoutAdditionalTraceFlags() { const CHAR *rgszFileNames[] = { - // GPDB_12_MERGE_FIXME: Needs review: Join order change - // "../data/dxl/minidump/Union-On-HJNs.mdp", "../data/dxl/minidump/Tpcds-NonPart-Q70a.mdp"}; return CTestUtils::EresUnittest_RunTestsWithoutAdditionalTraceFlags( rgszFileNames, &m_ulTestCounterNoAdditionTraceFlag, diff --git a/src/backend/gporca/server/src/unittest/gpopt/operators/CExpressionPreprocessorTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/operators/CExpressionPreprocessorTest.cpp index 111b5d481fb..ed4203e1b47 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/operators/CExpressionPreprocessorTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/operators/CExpressionPreprocessorTest.cpp @@ -776,7 +776,8 @@ CExpressionPreprocessorTest::EresTestLOJ( { CAutoTrace at(mp); at.Os() << std::endl - << "WindowFunction: " << fAddWindowFunction + << "Test Number: " << ulTestCases + << ", WindowFunction: " << fAddWindowFunction << ", IntermediateInnerjoin: " << fIntermediateInnerjoin << ", CascadedLOJ: " << fCascadedLOJ diff --git a/src/backend/gporca/server/src/unittest/gpopt/translate/CTranslatorDXLToExprTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/translate/CTranslatorDXLToExprTest.cpp index ddad763171d..b0dae889317 100644 --- a/src/backend/gporca/server/src/unittest/gpopt/translate/CTranslatorDXLToExprTest.cpp +++ b/src/backend/gporca/server/src/unittest/gpopt/translate/CTranslatorDXLToExprTest.cpp @@ -253,7 +253,8 @@ class GetBuilder mp, mdid, CName(&strTableName), convert_hash_to_random, CMDRelationGPDB::EreldistrMasterOnly, CMDRelationGPDB::ErelstorageHeap, ulExecuteAsUser, - -1 /* lockmode */); + -1, /* lockmode */ + 0 /* UNASSIGNED_QUERYID */); } void diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 6a45828c011..50b08fb038f 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -1298,9 +1298,6 @@ _copySort(const Sort *from) */ CopySortFields(from, newnode); - /* CDB */ - COPY_SCALAR_FIELD(noduplicates); - return newnode; } diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 85fe1a621e4..7291841a1bd 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -1013,8 +1013,6 @@ _outSortInfo(StringInfo str, const Sort *node) WRITE_OID_ARRAY(sortOperators, node->numCols); WRITE_OID_ARRAY(collations, node->numCols); WRITE_BOOL_ARRAY(nullsFirst, node->numCols); - /* CDB */ - WRITE_BOOL_FIELD(noduplicates); } static void diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 4783e74cbad..166c3d588ba 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -2382,17 +2382,6 @@ ReadCommonSort(Sort *local_node) READ_BOOL_ARRAY(nullsFirst, local_node->numCols); } -static void -ReadSort(Sort *local_node) -{ - READ_TEMP_LOCALS(); - - ReadCommonSort(local_node); - - /* CDB */ - READ_BOOL_FIELD(noduplicates); -} - /* * _readSort */ @@ -2401,7 +2390,7 @@ _readSort(void) { READ_LOCALS_NO_FIELDS(Sort); - ReadSort(local_node); + ReadCommonSort(local_node); READ_DONE(); } @@ -2414,7 +2403,7 @@ _readIncrementalSort(void) { READ_LOCALS(IncrementalSort); - ReadSort(&local_node->sort); + ReadCommonSort(&local_node->sort); READ_INT_FIELD(nPresortedCols); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 19231adde3c..10677763b2a 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -66,7 +66,6 @@ // TODO: these planner gucs need to be refactored into PlannerConfig. bool gp_enable_sort_limit = false; -bool gp_enable_sort_distinct = false; /* results of subquery_is_pushdown_safe */ typedef struct pushdown_safety_info diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 89bd855ed61..9df1f326d01 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -7296,8 +7296,6 @@ make_sort(Plan *lefttree, int numCols, Assert(sortColIdx[0] != 0); - node->noduplicates = false; /* CDB */ - return node; } @@ -8057,14 +8055,6 @@ make_unique_from_sortclauses(Plan *lefttree, List *distinctList) node->uniqOperators = uniqOperators; node->uniqCollations = uniqCollations; - /* CDB */ /* pass DISTINCT to sort */ - if (IsA(lefttree, Sort) && gp_enable_sort_distinct) - { - Sort *pSort = (Sort *) lefttree; - - pSort->noduplicates = true; - } - return node; } diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 535059309ac..1368bc74d55 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -1536,6 +1536,79 @@ get_relation_constraints(PlannerInfo *root, return result; } +/* + * GetExtStatisticsName + * Retrieve the name of an extended statistic object + */ +char * +GetExtStatisticsName(Oid statOid) +{ + Form_pg_statistic_ext staForm; + HeapTuple htup; + + htup = SearchSysCache1(STATEXTOID, ObjectIdGetDatum(statOid)); + if (!HeapTupleIsValid(htup)) + elog(ERROR, "cache lookup failed for statistics object %u", statOid); + + staForm = (Form_pg_statistic_ext) GETSTRUCT(htup); + ReleaseSysCache(htup); + return NameStr(staForm->stxname); +} + +/* + * GetExtStatisticsKinds + * + * Retrieve the kinds of an extended statistic object + */ +List * +GetExtStatisticsKinds(Oid statOid) +{ + Form_pg_statistic_ext staForm; + HeapTuple htup; + Datum datum; + bool isnull; + ArrayType *arr; + char *enabled; + + List *types = NULL; + int i; + + htup = SearchSysCache1(STATEXTOID, ObjectIdGetDatum(statOid)); + if (!HeapTupleIsValid(htup)) + elog(ERROR, "cache lookup failed for statistics object %u", statOid); + + staForm = (Form_pg_statistic_ext) GETSTRUCT(htup); + + datum = SysCacheGetAttr(STATEXTOID, htup, + Anum_pg_statistic_ext_stxkind, &isnull); + arr = DatumGetArrayTypeP(datum); + if (ARR_NDIM(arr) != 1 || + ARR_HASNULL(arr) || + ARR_ELEMTYPE(arr) != CHAROID) + elog(ERROR, "stxkind is not a 1-D char array"); + enabled = (char *) ARR_DATA_PTR(arr); + for (i = 0; i < ARR_DIMS(arr)[0]; i++) + { + types = lappend_int(types, (int) enabled[i]); + } + + ReleaseSysCache(htup); + + return types; +} + +/* + * GetRelationExtStatistics + * GPDB: Interface to get_relation_statistics. + * + * Used by ORCA to access function without PLANNER objects (e.g. RelOptInfo). + */ +List * +GetRelationExtStatistics(Relation relation) +{ + return get_relation_statistics(NULL, relation); +} + /* * get_relation_statistics * Retrieve extended statistics defined on the table. @@ -1547,7 +1620,7 @@ get_relation_constraints(PlannerInfo *root, static List * get_relation_statistics(RelOptInfo *rel, Relation relation) { - Index varno = rel->relid; + Index varno = rel ? rel->relid : 0; List *statoidlist; List *stainfos = NIL; ListCell *l; @@ -1585,7 +1658,7 @@ get_relation_statistics(RelOptInfo *rel, Relation relation) * Preprocess expressions (if any). We read the expressions, run them * through eval_const_expressions, and fix the varnos. */ - { + if (rel) { bool isnull; Datum datum; diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c index 9482b108066..8b3d560cb20 100644 --- a/src/backend/statistics/dependencies.c +++ b/src/backend/statistics/dependencies.c @@ -619,7 +619,7 @@ dependency_is_fully_matched(MVDependency *dependency, Bitmapset *attnums) * Load the functional dependencies for the indicated pg_statistic_ext tuple */ MVDependencies * -statext_dependencies_load(Oid mvoid) +statext_dependencies_load(Oid mvoid, bool allow_null) { MVDependencies *result; bool isnull; @@ -633,9 +633,17 @@ statext_dependencies_load(Oid mvoid) deps = SysCacheGetAttr(STATEXTDATASTXOID, htup, Anum_pg_statistic_ext_data_stxddependencies, &isnull); if (isnull) - elog(ERROR, - "requested statistics kind \"%c\" is not yet built for statistics object %u", - STATS_EXT_DEPENDENCIES, mvoid); + { + if (!allow_null) + { + elog(ERROR, + "requested statistics kind \"%c\" is not yet built for statistics object %u", + STATS_EXT_DEPENDENCIES, mvoid); + } + + ReleaseSysCache(htup); + return NULL; + } result = statext_dependencies_deserialize(DatumGetByteaPP(deps)); @@ -1656,7 +1664,7 @@ dependencies_clauselist_selectivity(PlannerInfo *root, if (nmatched + nexprs < 2) continue; - deps = statext_dependencies_load(stat->statOid); + deps = statext_dependencies_load(stat->statOid, false); /* * The expressions may be represented by different attnums in the diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index c1a56e362ab..40fe9c3bc7b 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -4027,46 +4027,6 @@ get_range_subtype(Oid rangeOid) return InvalidOid; } -/* - * relation_exists - * Is there a relation with the given oid - */ -bool -relation_exists(Oid oid) -{ - return SearchSysCacheExists(RELOID, oid, 0, 0, 0); -} - -/* - * index_exists - * Is there an index with the given oid - */ -bool -index_exists(Oid oid) -{ - return SearchSysCacheExists(INDEXRELID, oid, 0, 0, 0); -} - -/* - * type_exists - * Is there a type with the given oid - */ -bool -type_exists(Oid oid) -{ - return SearchSysCacheExists(TYPEOID, oid, 0, 0, 0); -} - -/* - * operator_exists - * Is there an operator with the given oid - */ -bool -operator_exists(Oid oid) -{ - return SearchSysCacheExists(OPEROID, oid, 0, 0, 0); -} - /* * function_exists * Is there a function with the given oid @@ -4124,35 +4084,6 @@ get_aggregate(const char *aggname, Oid oidType) return oidResult; } -/* - * trigger_exists - * Is there a trigger with the given oid - */ -bool -trigger_exists(Oid oid) -{ - ScanKeyData scankey; - Relation rel; - SysScanDesc sscan; - bool result; - - ScanKeyInit(&scankey, Anum_pg_trigger_oid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(oid)); - - rel = table_open(TriggerRelationId, AccessShareLock); - sscan = systable_beginscan(rel, TriggerOidIndexId, true, - NULL, 1, &scankey); - - result = (systable_getnext(sscan) != NULL); - - systable_endscan(sscan); - - table_close(rel, AccessShareLock); - - return result; -} - /* * get_relation_keys * Return a list of relation keys @@ -4859,53 +4790,6 @@ get_index_column_opclass(Oid index_oid, int attno) return opclass; } -/* GPDB_12_MERGE_FIXME: only used by ORCA. Fix the callers to check - * Relation->relkind == RELKIND_PARTITIONED_TABLE instead. They should - * have the relcache entry at hand anyway. - */ -bool -relation_is_partitioned(Oid relid) -{ - HeapTuple tuple; - tuple = SearchSysCache1(PARTRELID, ObjectIdGetDatum(relid)); - - if (HeapTupleIsValid(tuple)) - { - ReleaseSysCache(tuple); - return true; - } - else - return false; -} - -bool -index_is_partitioned(Oid relid) -{ - HeapTuple tuple; - tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid)); - if (!HeapTupleIsValid(tuple)) - elog(ERROR, "cache lookup failed for relation %u", relid); - Form_pg_class pg_class_tuple = (Form_pg_class) GETSTRUCT(tuple); - ReleaseSysCache(tuple); - return pg_class_tuple->relkind == RELKIND_PARTITIONED_INDEX; -} - -List * -relation_get_leaf_partitions(Oid oid) -{ - List *descendants = find_all_inheritors(oid, AccessShareLock, NULL); - List *leaves = NIL; - ListCell *lc; - foreach(lc, descendants) - { - const Oid descendant = lfirst_oid(lc); - if (get_rel_relkind(descendant) != RELKIND_PARTITIONED_TABLE && - get_rel_relkind(descendant) != RELKIND_PARTITIONED_INDEX) - leaves = lappend_oid(leaves, descendant); - } - return leaves; -} - /* * get_index_isreplident * diff --git a/src/backend/utils/misc/guc_gp.c b/src/backend/utils/misc/guc_gp.c index f816a4b9b23..dd177a768aa 100644 --- a/src/backend/utils/misc/guc_gp.c +++ b/src/backend/utils/misc/guc_gp.c @@ -328,6 +328,7 @@ bool optimizer_enable_multiple_distinct_aggs; bool optimizer_enable_direct_dispatch; bool optimizer_enable_hashjoin_redistribute_broadcast_children; bool optimizer_enable_broadcast_nestloop_outer_child; +bool optimizer_discard_redistribute_hashjoin; bool optimizer_enable_streaming_material; bool optimizer_enable_gather_on_segment_for_dml; bool optimizer_enable_assert_maxonerow; @@ -351,6 +352,7 @@ bool optimizer_prune_unused_columns; bool optimizer_enable_redistribute_nestloop_loj_inner_child; bool optimizer_force_comprehensive_join_implementation; bool optimizer_enable_replicated_table; +bool optimizer_enable_foreign_table; /* Optimizer plan enumeration related GUCs */ bool optimizer_enumerate_plans; @@ -798,16 +800,6 @@ struct config_bool ConfigureNamesBool_gp[] = NULL, NULL, NULL }, - { - {"gp_enable_sort_distinct", PGC_USERSET, QUERY_TUNING_METHOD, - gettext_noop("Enable duplicate removal to be performed while sorting."), - gettext_noop("Reduces data handling when plan calls for removing duplicates from sorted rows.") - }, - &gp_enable_sort_distinct, - true, - NULL, NULL, NULL - }, - { {"gp_enable_motion_deadlock_sanity", PGC_USERSET, DEVELOPER_OPTIONS, gettext_noop("Enable verbose check at planning time."), @@ -2447,6 +2439,16 @@ struct config_bool ConfigureNamesBool_gp[] = true, NULL, NULL, NULL }, + { + {"optimizer_discard_redistribute_hashjoin", PGC_USERSET, DEVELOPER_OPTIONS, + gettext_noop("Discard hash join with redistribute motion in the optimizer."), + NULL, + GUC_NOT_IN_SAMPLE + }, + &optimizer_discard_redistribute_hashjoin, + false, + NULL, NULL, NULL + }, { {"optimizer_expand_fulljoin", PGC_USERSET, DEVELOPER_OPTIONS, gettext_noop("Enables the optimizer's support of expanding full outer joins using union all."), @@ -3117,10 +3119,20 @@ struct config_bool ConfigureNamesBool_gp[] = gettext_noop("Enable replicated tables."), NULL, GUC_NOT_IN_SAMPLE - }, - &optimizer_enable_replicated_table, - true, - NULL, NULL, NULL + }, + &optimizer_enable_replicated_table, + true, + NULL, NULL, NULL + }, + { + {"optimizer_enable_foreign_table", PGC_USERSET, DEVELOPER_OPTIONS, + gettext_noop("Enable foreign tables in Orca."), + NULL, + GUC_NOT_IN_SAMPLE + }, + &optimizer_enable_foreign_table, + true, + NULL, NULL, NULL }, { {"aqumv_allow_foreign_table", PGC_USERSET, DEVELOPER_OPTIONS, @@ -3136,10 +3148,10 @@ struct config_bool ConfigureNamesBool_gp[] = {"gp_log_suboverflow_statement", PGC_SUSET, LOGGING_WHAT, gettext_noop("Enable logging of statements that cause subtransaction overflow."), NULL, - }, - &gp_log_suboverflow_statement, - false, - NULL, NULL, NULL + }, + &gp_log_suboverflow_statement, + false, + NULL, NULL, NULL }, { diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 0908c412234..31ac67628af 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -396,7 +396,6 @@ max_prepared_transactions = 250 # can be 0 or more #gp_selectivity_damping_for_joins = off #gp_enable_sort_limit = on -#gp_enable_sort_distinct = on # - Planner Cost Constants - diff --git a/src/include/cdb/cdbvars.h b/src/include/cdb/cdbvars.h index 1d9c72db61f..0485d2bf840 100644 --- a/src/include/cdb/cdbvars.h +++ b/src/include/cdb/cdbvars.h @@ -648,16 +648,6 @@ extern int explain_memory_verbosity; */ extern bool gp_enable_sort_limit; -/* May Cloudberry discard duplicate rows in sort if it is is wrapped by a - * DISTINCT clause (unique aggregation operator)? - * - * The code does not currently use planner estimates for this. If enabled, - * the tactic is used whenever possible. - * - * GPDB_12_MERGE_FIXME: Resurrect this - */ -extern bool gp_enable_sort_distinct; - extern bool trace_sort; /** diff --git a/src/include/gpopt/gpdbwrappers.h b/src/include/gpopt/gpdbwrappers.h index 2faa86c54a7..36c3a39dd35 100644 --- a/src/include/gpopt/gpdbwrappers.h +++ b/src/include/gpopt/gpdbwrappers.h @@ -21,6 +21,7 @@ extern "C" { #include "access/attnum.h" #include "parser/parse_coerce.h" +#include "statistics/statistics.h" #include "utils/faultinjector.h" #include "utils/lsyscache.h" #include "utils/partcache.h" @@ -207,6 +208,11 @@ void FreeAttrStatsSlot(AttStatsSlot *sslot); // attribute statistics HeapTuple GetAttStats(Oid relid, AttrNumber attnum); +List *GetExtStats(Relation rel); + +char *GetExtStatsName(Oid statOid); +List *GetExtStatsKinds(Oid statOid); + // does a function exist with the given oid bool FunctionExists(Oid oid); @@ -486,10 +492,6 @@ Node *MutateExpressionTree(Node *node, Node *(*mutator)(Node *, void *), void *c Node *MutateQueryOrExpressionTree(Node *node, Node *(*mutator)(Node *, void *), void *context, int flags); -bool RelIsPartitioned(Oid relid); - -bool IndexIsPartitioned(Oid relid); - // check whether a relation is inherited bool HasSubclassSlow(Oid rel_oid); @@ -501,16 +503,6 @@ GpPolicy *GetDistributionPolicy(Relation rel); // the child partitions is randomly distributed gpos::BOOL IsChildPartDistributionMismatched(Relation rel); -#if 0 - // return true if the table is partitioned and any of the child partitions - // have a trigger of the given type - gpos::BOOL ChildPartHasTriggers(Oid oid, int trigger_type); -#endif - -// estimate the relation size using the real number of blocks and tuple density -void CdbEstimateRelationSize(RelOptInfo *relOptInfo, Relation rel, - int32 *attr_widths, BlockNumber *pages, - double *tuples, double *allvisfrac); double CdbEstimatePartitionedNumTuples(Relation rel); // close the given relation @@ -524,6 +516,12 @@ void BuildRelationTriggers(Relation rel); PartitionKey GetRelationPartitionKey(Relation rel); +PartitionDesc RelationGetPartitionDesc(Relation rel, bool omit_detached); + +MVNDistinct *GetMVNDistinct(Oid stat_oid); + +MVDependencies *GetMVDependencies(Oid stat_oid); + // get relation with given oid RelationWrapper GetRelation(Oid rel_oid); @@ -548,21 +546,6 @@ bool IsCompositeType(Oid typid); bool IsTextRelatedType(Oid typid); -// get integer value from an Integer value node -int GetIntFromValue(Node *node); - -// parse external table URI -Uri *ParseExternalTableUri(const char *uri); - -// returns ComponentDatabases -CdbComponentDatabases *GetComponentDatabases(void); - -// compare two strings ignoring case -int StrCmpIgnoreCase(const char *s1, const char *s2); - -// construct random segment map -bool *ConstructRandomSegMap(int total_primaries, int total_to_skip); - // create an empty 'StringInfoData' & return a pointer to it StringInfo MakeStringInfo(void); @@ -597,7 +580,8 @@ void CheckRTPermissions(List *rtable); bool HasUpdateTriggers(Oid relid); // get index operator family properties -void IndexOpProperties(Oid opno, Oid opfamily, int *strategy, Oid *righttype); +void IndexOpProperties(Oid opno, Oid opfamily, StrategyNumber *strategynumber, + Oid *righttype); // get oids of families this operator belongs to List *GetOpFamiliesForScOp(Oid opno); diff --git a/src/include/gpopt/relcache/CMDProviderRelcache.h b/src/include/gpopt/relcache/CMDProviderRelcache.h index 97776e9e4d8..18258562050 100644 --- a/src/include/gpopt/relcache/CMDProviderRelcache.h +++ b/src/include/gpopt/relcache/CMDProviderRelcache.h @@ -45,15 +45,11 @@ using namespace gpos; //--------------------------------------------------------------------------- class CMDProviderRelcache : public IMDProvider { -private: - // memory pool - CMemoryPool *m_mp; - public: CMDProviderRelcache(const CMDProviderRelcache &) = delete; // ctor/dtor - explicit CMDProviderRelcache(CMemoryPool *mp); + CMDProviderRelcache() = default; ~CMDProviderRelcache() override = default; diff --git a/src/include/gpopt/translate/CContextDXLToPlStmt.h b/src/include/gpopt/translate/CContextDXLToPlStmt.h index f76033f7c83..1ce8ce1d32b 100644 --- a/src/include/gpopt/translate/CContextDXLToPlStmt.h +++ b/src/include/gpopt/translate/CContextDXLToPlStmt.h @@ -87,6 +87,10 @@ class CContextDXLToPlStmt gpos::Equals, CleanupDelete, CleanupDelete>; + using HMUlIndex = + CHashMap, gpos::Equals, + CleanupDelete, CleanupDelete>; + CMemoryPool *m_mp; // counter for generating plan ids @@ -105,12 +109,6 @@ class CContextDXLToPlStmt // list of all rtable entries List *m_rtable_entries_list; - // list of oids of partitioned tables - List *m_partitioned_tables_list; - - // number of partition selectors for each dynamic scan - ULongPtrArray *m_num_partition_selectors_array; - // list of all subplan entries List *m_subplan_entries_list; List *m_subplan_sliceids_list; @@ -134,6 +132,8 @@ class CContextDXLToPlStmt UlongToUlongMap *m_part_selector_to_param_map; + // hash map of the queryid (of DML query) and the target relation index + HMUlIndex *m_used_rte_indexes; public: // ctor/dtor @@ -173,16 +173,6 @@ class CContextDXLToPlStmt return m_rtable_entries_list; } - // return list of partitioned table indexes - List * - GetPartitionedTablesList() const - { - return m_partitioned_tables_list; - } - - // return list containing number of partition selectors for every scan id - List *GetNumPartitionSelectorsList() const; - List * GetSubplanEntriesList() const { @@ -204,12 +194,6 @@ class CContextDXLToPlStmt // add a range table entry void AddRTE(RangeTblEntry *rte, BOOL is_result_relation = false); - // add a partitioned table index - void AddPartitionedTable(OID oid); - - // increment the number of partition selectors for the given scan id - void IncrementPartitionSelectors(ULONG scan_id); - void AddSubplan(Plan *); // add a slice table entry @@ -255,6 +239,12 @@ class CContextDXLToPlStmt // used by internal GPDB functions to build the RelOptInfo when creating foreign scans Query *m_orig_query; + + // get rte from m_rtable_entries_list by given index + RangeTblEntry *GetRTEByIndex(Index index); + + Index GetRTEIndexByTableDescr(const CDXLTableDescr *table_descr, + BOOL *is_rte_exists); }; } // namespace gpdxl diff --git a/src/include/gpopt/translate/CContextQueryToDXL.h b/src/include/gpopt/translate/CContextQueryToDXL.h index bc147f894b5..e27345e4268 100644 --- a/src/include/gpopt/translate/CContextQueryToDXL.h +++ b/src/include/gpopt/translate/CContextQueryToDXL.h @@ -22,6 +22,7 @@ #define GPDXL_CTE_ID_START 1 #define GPDXL_COL_ID_START 1 +#define GPDXL_QUERY_ID_START 1 namespace gpdxl { @@ -53,6 +54,9 @@ class CContextQueryToDXL // counter for generating unique CTE ids CIdGenerator *m_cte_id_counter; + // counter for upper-level query and its subqueries + CIdGenerator *m_queryid_counter; + // does the query have any distributed tables? BOOL m_has_distributed_tables; @@ -65,6 +69,8 @@ class CContextQueryToDXL // dtor ~CContextQueryToDXL(); + + ULONG GetNextQueryId(); }; } // namespace gpdxl #endif // GPDXL_CContextQueryToDXL_H diff --git a/src/include/gpopt/translate/CTranslatorDXLToPlStmt.h b/src/include/gpopt/translate/CTranslatorDXLToPlStmt.h index a04c259e69a..57cb3313d3e 100644 --- a/src/include/gpopt/translate/CTranslatorDXLToPlStmt.h +++ b/src/include/gpopt/translate/CTranslatorDXLToPlStmt.h @@ -426,9 +426,9 @@ class CTranslatorDXLToPlStmt CDXLTranslateContextBaseTable *base_table_context); // create range table entry from a table descriptor - RangeTblEntry *TranslateDXLTblDescrToRangeTblEntry( - const CDXLTableDescr *table_descr, Index index, - CDXLTranslateContextBaseTable *base_table_context); + Index ProcessDXLTblDescr(const CDXLTableDescr *table_descr, + CDXLTranslateContextBaseTable *base_table_context, + AclMode acl_mode); // translate DXL projection list into a target list List *TranslateDXLProjList( @@ -570,10 +570,12 @@ class CTranslatorDXLToPlStmt // compute directed dispatch segment ids List *TranslateDXLDirectDispatchInfo( - CDXLDirectDispatchInfo *dxl_direct_dispatch_info); + CDXLDirectDispatchInfo *dxl_direct_dispatch_info, + RangeTblEntry *pRTEHashFuncCal); // hash a DXL datum with GPDB's hash function - ULONG GetDXLDatumGPDBHash(CDXLDatumArray *dxl_datum_array); + ULONG GetDXLDatumGPDBHash(CDXLDatumArray *dxl_datum_array, + RangeTblEntry *pRTEHashFuncCal); // translate nest loop colrefs to GPDB nestparams static List *TranslateNestLoopParamList( diff --git a/src/include/gpopt/translate/CTranslatorQueryToDXL.h b/src/include/gpopt/translate/CTranslatorQueryToDXL.h index 990a9f6e555..4a7405dee7c 100644 --- a/src/include/gpopt/translate/CTranslatorQueryToDXL.h +++ b/src/include/gpopt/translate/CTranslatorQueryToDXL.h @@ -129,6 +129,10 @@ class CTranslatorQueryToDXL // CTE producer IDs defined at the current query level UlongBoolHashMap *m_cteid_at_current_query_level_map; + // id of current query (and for nested queries), it's used for correct assigning + // of relation links to target relation of DML query + ULONG m_query_id; + //ctor // private constructor, called from the public factory function QueryToDXLInstance CTranslatorQueryToDXL( diff --git a/src/include/gpopt/translate/CTranslatorRelcacheToDXL.h b/src/include/gpopt/translate/CTranslatorRelcacheToDXL.h index d872bddc432..5590daa04b5 100644 --- a/src/include/gpopt/translate/CTranslatorRelcacheToDXL.h +++ b/src/include/gpopt/translate/CTranslatorRelcacheToDXL.h @@ -36,6 +36,8 @@ extern "C" { #include "naucrates/md/CMDPartConstraintGPDB.h" #include "naucrates/md/CMDRelationGPDB.h" #include "naucrates/md/CMDScalarOpGPDB.h" +#include "naucrates/md/IMDExtStats.h" +#include "naucrates/md/IMDExtStatsInfo.h" #include "naucrates/md/IMDFunction.h" #include "naucrates/md/IMDId.h" #include "naucrates/md/IMDIndex.h" @@ -163,7 +165,7 @@ class CTranslatorRelcacheToDXL ); // check and fall back for unsupported relations - static void CheckUnsupportedRelation(OID rel_oid); + static void CheckUnsupportedRelation(Relation rel); // get type name from the relcache static CMDName *GetTypeName(CMemoryPool *mp, IMDId *mdid); @@ -321,6 +323,10 @@ class CTranslatorRelcacheToDXL CMDAccessor *md_accessor, IMDId *mdid, IMDCacheObject::Emdtype mdtype); + static IMDCacheObject *RetrieveExtStats(CMemoryPool *mp, IMDId *mdid); + + static IMDCacheObject *RetrieveExtStatsInfo(CMemoryPool *mp, IMDId *mdid); + // retrieve a relation from the relcache static IMDRelation *RetrieveRel(CMemoryPool *mp, CMDAccessor *md_accessor, IMDId *mdid); diff --git a/src/include/gpopt/translate/CTranslatorUtils.h b/src/include/gpopt/translate/CTranslatorUtils.h index 7a1927fa528..1c4af6fba2f 100644 --- a/src/include/gpopt/translate/CTranslatorUtils.h +++ b/src/include/gpopt/translate/CTranslatorUtils.h @@ -160,6 +160,7 @@ class CTranslatorUtils CMDAccessor *md_accessor, CIdGenerator *id_generator, const RangeTblEntry *rte, + ULONG assigned_query_id_for_target_rel, BOOL *is_distributed_table = nullptr); // translate a RangeTableEntry into a CDXLLogicalTVF diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 44b54dc68f1..a160893618c 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -2562,8 +2562,6 @@ typedef struct SortState bool am_worker; /* are we a worker? */ SharedSortInfo *shared_info; /* one entry per worker */ - bool noduplicates; /* true if discard duplicate rows */ - bool delayEagerFree; /* is it safe to free memory used by this node, * when this node has outputted its last row? */ TuplesortInstrumentation sortstats; /* holds stats, if the Sort is eagerly free'd */ diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 773b5c27c6f..45eaaa83aea 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -1244,8 +1244,6 @@ typedef struct Sort Oid *sortOperators; /* OIDs of operators to sort them by */ Oid *collations; /* OIDs of collations */ bool *nullsFirst; /* NULLS FIRST/LAST directions */ - /* CDB */ - bool noduplicates; /* TRUE if sort should discard duplicates */ } Sort; /* ---------------- diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h index 75e4c6804d7..adb45371dbc 100644 --- a/src/include/optimizer/plancat.h +++ b/src/include/optimizer/plancat.h @@ -46,6 +46,11 @@ extern double cdb_estimate_partitioned_numtuples(Relation rel); extern int32 get_rel_data_width(Relation rel, int32 *attr_widths); extern int32 get_relation_data_width(Oid relid, int32 *attr_widths); +extern List *GetRelationExtStatistics(Relation relation); + +extern char *GetExtStatisticsName(Oid statOid); +extern List *GetExtStatisticsKinds(Oid statOid); + extern bool relation_excluded_by_constraints(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte); diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h index 326cf26feae..a4166112c98 100644 --- a/src/include/statistics/statistics.h +++ b/src/include/statistics/statistics.h @@ -95,7 +95,7 @@ typedef struct MCVList } MCVList; extern MVNDistinct *statext_ndistinct_load(Oid mvoid); -extern MVDependencies *statext_dependencies_load(Oid mvoid); +extern MVDependencies *statext_dependencies_load(Oid mvoid, bool allow_null); extern MCVList *statext_mcv_load(Oid mvoid); extern void BuildRelationExtStatistics(Relation onerel, double totalrows, diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index bf5a84fdb59..032c60fe1de 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -507,6 +507,7 @@ extern bool optimizer_enable_outerjoin_rewrite; extern bool optimizer_enable_multiple_distinct_aggs; extern bool optimizer_enable_hashjoin_redistribute_broadcast_children; extern bool optimizer_enable_broadcast_nestloop_outer_child; +extern bool optimizer_discard_redistribute_hashjoin; extern bool optimizer_enable_streaming_material; extern bool optimizer_enable_gather_on_segment_for_dml; extern bool optimizer_enable_assert_maxonerow; @@ -532,6 +533,7 @@ extern bool optimizer_prune_unused_columns; extern bool optimizer_enable_redistribute_nestloop_loj_inner_child; extern bool optimizer_force_comprehensive_join_implementation; extern bool optimizer_enable_replicated_table; +extern bool optimizer_enable_foreign_table; /* Optimizer plan enumeration related GUCs */ extern bool optimizer_enumerate_plans; diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h index 56823275fcf..6aec016f772 100644 --- a/src/include/utils/lsyscache.h +++ b/src/include/utils/lsyscache.h @@ -237,18 +237,10 @@ extern bool get_index_isreplident(Oid index_oid); extern bool get_index_isvalid(Oid index_oid); extern bool get_index_isclustered(Oid index_oid); -extern bool relation_is_partitioned(Oid oid); -extern bool index_is_partitioned(Oid oid); -extern List *relation_get_leaf_partitions(Oid oid); -extern bool relation_exists(Oid oid); -extern bool index_exists(Oid oid); -extern bool type_exists(Oid oid); extern bool function_exists(Oid oid); -extern bool operator_exists(Oid oid); extern bool aggregate_exists(Oid oid); extern Oid get_aggregate(const char *aggname, Oid oidType); extern List *get_relation_keys(Oid relid); -extern bool trigger_exists(Oid oid); extern bool check_constraint_exists(Oid oidCheckconstraint); extern List *get_check_constraint_oids(Oid relid); diff --git a/src/include/utils/unsync_guc_name.h b/src/include/utils/unsync_guc_name.h index a66559f0ab6..382a46b6f8b 100644 --- a/src/include/utils/unsync_guc_name.h +++ b/src/include/utils/unsync_guc_name.h @@ -200,7 +200,6 @@ "gp_enable_refresh_fast_path", "gp_enable_relsize_collection", "gp_enable_slow_writer_testmode", - "gp_enable_sort_distinct", "gp_enable_sort_limit", "gp_encoding_check_locale_compatibility", "gp_external_enable_exec", @@ -403,7 +402,7 @@ "optimizer_enable_hashagg", "optimizer_enable_hashjoin", "optimizer_enable_hashjoin_redistribute_broadcast_children", - "optimizer_enable_nljoin", + "optimizer_discard_redistribute_hashjoin", "optimizer_enable_indexjoin", "optimizer_enable_indexonlyscan", "optimizer_enable_indexscan", @@ -429,6 +428,7 @@ "optimizer_enable_space_pruning", "optimizer_enable_streaming_material", "optimizer_enable_tablescan", + "optimizer_enable_foreign_table", "optimizer_enforce_subplans", "optimizer_enumerate_plans", "optimizer_expand_fulljoin", diff --git a/src/test/isolation2/expected/gdd/concurrent_update.out b/src/test/isolation2/expected/gdd/concurrent_update.out index b09c49c80c7..5cecc18fbdf 100644 --- a/src/test/isolation2/expected/gdd/concurrent_update.out +++ b/src/test/isolation2/expected/gdd/concurrent_update.out @@ -239,6 +239,46 @@ DROP 0: drop table tab_update_epq2; DROP 0q: ... +1q: ... +2q: ... + +-- check that orca concurrent delete transaction won't delete tuple, updated in other transaction (which doesn't match predicate anymore) +create table test as select 0 as i distributed randomly; +CREATE 1 +1: begin; +BEGIN +1: update test set i = i + 1; +UPDATE 1 +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +END +2<: <... completed> +DELETE 0 +drop table test; +DROP +1q: ... +2q: ... + +-- check that orca concurrent delete transaction will delete tuple, updated in other transaction (which still matches predicate) +create table test as select 0 as i distributed randomly; +CREATE 1 +1: begin; +BEGIN +1: update test set i = i; +UPDATE 1 +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +END +2<: <... completed> +DELETE 1 +drop table test; +DROP +1q: ... +2q: ... -- test ORCA partition table create table test(a int, b int, c int) partition by range(b) (start (1) end (7) every (3)); diff --git a/src/test/isolation2/expected/gdd/concurrent_update_optimizer.out b/src/test/isolation2/expected/gdd/concurrent_update_optimizer.out new file mode 100644 index 00000000000..362a8c9888c --- /dev/null +++ b/src/test/isolation2/expected/gdd/concurrent_update_optimizer.out @@ -0,0 +1,392 @@ +-- Test concurrent update a table with a varying length type +CREATE TABLE t_concurrent_update(a int, b int, c char(84)); +CREATE +INSERT INTO t_concurrent_update VALUES(1,1,'test'); +INSERT 1 + +1: BEGIN; +BEGIN +1: SET optimizer=off; +SET +1: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; +UPDATE 1 +2: SET optimizer=off; +SET +2&: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; +1: END; +END +2<: <... completed> +UPDATE 1 +1: SELECT * FROM t_concurrent_update; + a | b | c +---+----+-------------------------------------------------------------------------------------- + 1 | 21 | test +(1 row) +1q: ... +2q: ... + +DROP TABLE t_concurrent_update; +DROP + +-- Test the concurrent update transaction order on the segment is reflected on master +1: CREATE TABLE t_concurrent_update(a int, b int); +CREATE +1: INSERT INTO t_concurrent_update VALUES(1,1); +INSERT 1 + +2: BEGIN; +BEGIN +2: SET optimizer=off; +SET +2: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; +UPDATE 1 +3: BEGIN; +BEGIN +3: SET optimizer=off; +SET +-- transaction 3 will wait transaction 2 on the segment +3&: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; + +-- transaction 2 suspend before commit, but it will wake up transaction 3 on segment +2: select gp_inject_fault('before_xact_end_procarray', 'suspend', '', 'isolation2test', '', 1, 1, 0, dbid) FROM gp_segment_configuration WHERE role='p' AND content=-1; + gp_inject_fault +----------------- + Success: +(1 row) +2&: END; +1: select gp_wait_until_triggered_fault('before_xact_end_procarray', 1, dbid) FROM gp_segment_configuration WHERE role='p' AND content=-1; + gp_wait_until_triggered_fault +------------------------------- + Success: +(1 row) +-- transaction 3 should wait transaction 2 commit on master +3<: <... completed> +UPDATE 1 +3&: END; +-- the query should not get the incorrect distributed snapshot: transaction 1 in-progress +-- and transaction 2 finished +1: SELECT * FROM t_concurrent_update; + a | b +---+--- + 1 | 1 +(1 row) +1: select gp_inject_fault('before_xact_end_procarray', 'reset', dbid) FROM gp_segment_configuration WHERE role='p' AND content=-1; + gp_inject_fault +----------------- + Success: +(1 row) +2<: <... completed> +END +3<: <... completed> +END +2q: ... +3q: ... + +1: SELECT * FROM t_concurrent_update; + a | b +---+---- + 1 | 21 +(1 row) +1q: ... + +-- Same test as the above, except the first transaction commits before the +-- second transaction check the wait gxid, it should get the gxid from +-- pg_distributedlog instead of the procarray. +4: BEGIN; +BEGIN +4: SET optimizer=off; +SET +4: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; +UPDATE 1 + +5: BEGIN; +BEGIN +5: SET optimizer=off; +SET +-- suspend before get 'wait gxid' +5: SELECT gp_inject_fault('before_get_distributed_xid', 'suspend', dbid) FROM gp_segment_configuration WHERE role='p' AND content=1; + gp_inject_fault +----------------- + Success: +(1 row) +5&: UPDATE t_concurrent_update SET b=b+10 WHERE a=1; + +6: SELECT gp_wait_until_triggered_fault('before_get_distributed_xid', 1, dbid) FROM gp_segment_configuration WHERE role='p' AND content=1; + gp_wait_until_triggered_fault +------------------------------- + Success: +(1 row) +4: END; +END +4: SELECT gp_inject_fault('before_get_distributed_xid', 'reset', dbid) FROM gp_segment_configuration WHERE role='p' AND content=1; + gp_inject_fault +----------------- + Success: +(1 row) + +5<: <... completed> +UPDATE 1 +5: END; +END +6: SELECT * FROM t_concurrent_update; + a | b +---+---- + 1 | 41 +(1 row) +6: DROP TABLE t_concurrent_update; +DROP +4q: ... +5q: ... +6q: ... + +-- Test update distkey +-- IF we enable the GDD, then the lock maybe downgrade to +-- RowExclusiveLock, when we UPDATE the distribution keys, +-- A SplitUpdate node will add to the Plan, then an UPDATE +-- operator may split to DELETE and INSERT. +-- IF we UPDATE the distribution keys concurrently, the +-- DELETE operator will not execute EvalPlanQual and the +-- INSERT operator can not be *blocked*, so it will +-- generate more tuples in the tables. +-- We raise an error when the GDD is enabled and the +-- distribution keys is updated. + +0: create table tab_update_hashcol (c1 int, c2 int) distributed by(c1); +CREATE +0: insert into tab_update_hashcol values(1,1); +INSERT 1 +0: select * from tab_update_hashcol; + c1 | c2 +----+---- + 1 | 1 +(1 row) + +1: begin; +BEGIN +2: begin; +BEGIN +1: update tab_update_hashcol set c1 = c1 + 1 where c1 = 1; +UPDATE 1 +2&: update tab_update_hashcol set c1 = c1 + 1 where c1 = 1; +1: end; +END +2<: <... completed> +ERROR: EvalPlanQual can not handle subPlan with Motion node +2: end; +END +0: select * from tab_update_hashcol; + c1 | c2 +----+---- + 2 | 1 +(1 row) +0: drop table tab_update_hashcol; +DROP + +-- Test EvalplanQual +-- If we enable the GDD, then the lock maybe downgrade to +-- RowExclusiveLock, so UPDATE/Delete can be executed +-- concurrently, it may trigger the EvalPlanQual function +-- to recheck the qualifications. +-- If the subPlan have Motion node, then we can not execute +-- EvalPlanQual correctly, so we raise an error when +-- GDD is enabled and EvalPlanQual is tiggered. + +0: create table tab_update_epq1 (c1 int, c2 int) distributed randomly; +CREATE +0: create table tab_update_epq2 (c1 int, c2 int) distributed randomly; +CREATE +0: insert into tab_update_epq1 values(1,1); +INSERT 1 +0: insert into tab_update_epq2 values(1,1); +INSERT 1 +0: select * from tab_update_epq1; + c1 | c2 +----+---- + 1 | 1 +(1 row) +0: select * from tab_update_epq2; + c1 | c2 +----+---- + 1 | 1 +(1 row) + +1: set optimizer = off; +SET +2: set optimizer = off; +SET + +1: begin; +BEGIN +2: begin; +BEGIN +1: update tab_update_epq1 set c1 = c1 + 1 where c2 = 1; +UPDATE 1 +2&: update tab_update_epq1 set c1 = tab_update_epq1.c1 + 1 from tab_update_epq2 where tab_update_epq1.c2 = tab_update_epq2.c2; +1: end; +END +2<: <... completed> +ERROR: EvalPlanQual can not handle subPlan with Motion node (seg1 127.0.1.1:6003 pid=76275) +2: end; +END + +0: select * from tab_update_epq1; + c1 | c2 +----+---- + 2 | 1 +(1 row) +0: drop table tab_update_epq1; +DROP +0: drop table tab_update_epq2; +DROP +0q: ... +1q: ... +2q: ... + +-- check that orca concurrent delete transaction won't delete tuple, updated in other transaction (which doesn't match predicate anymore) +create table test as select 0 as i distributed randomly; +CREATE 1 +1: begin; +BEGIN +1: update test set i = i + 1; +UPDATE 1 +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +END +2<: <... completed> +DELETE 0 +drop table test; +DROP +1q: ... +2q: ... + +-- check that orca concurrent delete transaction will delete tuple, updated in other transaction (which still matches predicate) +create table test as select 0 as i distributed randomly; +CREATE 1 +1: begin; +BEGIN +1: update test set i = i; +UPDATE 1 +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +END +2<: <... completed> +DELETE 1 +drop table test; +DROP +1q: ... +2q: ... + +-- test ORCA partition table +create table test(a int, b int, c int) partition by range(b) (start (1) end (7) every (3)); +CREATE +insert into test values (1, 1, 1); +INSERT 1 +1: begin; +BEGIN +1: delete from test where b = 1; +DELETE 1 +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: update test set b = 1; +1: end; +END +2<: <... completed> +UPDATE 0 + +0: select * from test; + a | b | c +---+---+--- +(0 rows) +0: drop table test; +DROP +0q: ... +1q: ... +2q: ... + +-- split update is to implement updating on hash keys, +-- it deletes the tuple and insert a new tuple in a +-- new segment, so it is not easy for other transaction +-- to follow the update link to fetch the new tuple. The +-- other transaction should raise error for such case. +-- the following case should be tested with GDD enabled. +-- See github issue: https://github.com/greenplum-db/gpdb/issues/8919 + +0:create table t_splitupdate_raise_error (a int, b int) distributed by (a); +CREATE +0:insert into t_splitupdate_raise_error values (1, 1); +INSERT 1 + +-- test delete will throw error +1: begin; +BEGIN +1: update t_splitupdate_raise_error set a = a + 1; +UPDATE 1 + +2: begin; +BEGIN +2&: delete from t_splitupdate_raise_error; + +1: end; +END +2<: <... completed> +ERROR: tuple to be locked was already moved to another partition or segment due to concurrent update (seg1 127.0.1.1:6003 pid=76275) + +2: abort; +ABORT +1q: ... +2q: ... + +-- test norm update will throw error +1: begin; +BEGIN +1: update t_splitupdate_raise_error set a = a + 1; +UPDATE 1 + +2: begin; +BEGIN +2&: update t_splitupdate_raise_error set b = 999; + +1: end; +END +2<: <... completed> +ERROR: tuple to be locked was already moved to another partition or segment due to concurrent update (seg0 127.0.1.1:6002 pid=76337) + +2: abort; +ABORT +1q: ... +2q: ... + +-- test select for update will throw error +-- Currently, select for update will reduce lock-level +-- under some very simple cases, see checkCanOptSelectLockingClause +-- for details. + +1: begin; +BEGIN +1: update t_splitupdate_raise_error set a = a + 1; +UPDATE 1 + +2: begin; +BEGIN +-- TODO: turn off orca, we should fix this until ORCA +-- can generate lockrows plannode. +2: set optimizer = off; +SET +2&: select * from t_splitupdate_raise_error for update; + +1: end; +END +2<: <... completed> +ERROR: tuple to be locked was already moved to another partition or segment due to concurrent update (seg0 slice1 127.0.1.1:7002 pid=43866) + +2: abort; +ABORT +1q: ... +2q: ... + +0:drop table t_splitupdate_raise_error; +DROP diff --git a/src/test/isolation2/expected/modify_table_data_corrupt_optimizer.out b/src/test/isolation2/expected/modify_table_data_corrupt_optimizer.out index 97133dfc27b..353b56be769 100644 --- a/src/test/isolation2/expected/modify_table_data_corrupt_optimizer.out +++ b/src/test/isolation2/expected/modify_table_data_corrupt_optimizer.out @@ -72,18 +72,18 @@ explain (costs off) delete from tab1 using tab2, tab3 where tab1.a = tab2.a and Delete on tab1 -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: tab1.b -> Hash Join - Hash Cond: (tab2.a = tab1_1.a) + Hash Cond: (tab2.a = tab1.a) -> Seq Scan on tab2 -> Hash -> Broadcast Motion 3:3 (slice2; segments: 3) -> Hash Join - Hash Cond: (tab3.b = tab1_1.b) + Hash Cond: (tab3.b = tab1.b) -> Seq Scan on tab3 -> Hash - -> Seq Scan on tab1 tab1_1 - Optimizer: Pivotal Optimizer (GPORCA) + -> Seq Scan on tab1 + Optimizer: Pivotal Optimizer (GPORCA) version 3.86.0 (15 rows) begin; BEGIN @@ -99,17 +99,17 @@ explain (costs off) update tab1 set a = 999 from tab2, tab3 where tab1.a = tab2. Update on tab1 -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: tab1.b -> Hash Join - Hash Cond: (tab2.a = tab1_1.a) + Hash Cond: (tab2.a = tab1.a) -> Seq Scan on tab2 -> Hash -> Broadcast Motion 3:3 (slice2; segments: 3) -> Hash Join - Hash Cond: (tab3.b = tab1_1.b) + Hash Cond: (tab3.b = tab1.b) -> Seq Scan on tab3 -> Hash - -> Seq Scan on tab1 tab1_1 + -> Seq Scan on tab1 Optimizer: Pivotal Optimizer (GPORCA) (15 rows) begin; @@ -126,19 +126,19 @@ explain (costs off) delete from tab1 using tab2, tab3 where tab1.a = tab2.a and Delete on tab1 -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: tab1.b -> Hash Join - Hash Cond: (tab2.a = tab1_1.a) + Hash Cond: (tab2.a = tab1.a) -> Seq Scan on tab2 -> Hash -> Broadcast Motion 3:3 (slice2; segments: 3) -> Hash Join - Hash Cond: (tab3.a = tab1_1.b) + Hash Cond: (tab3.a = tab1.b) -> Seq Scan on tab3 -> Hash -> Broadcast Motion 3:3 (slice3; segments: 3) - -> Seq Scan on tab1 tab1_1 - Optimizer: Pivotal Optimizer (GPORCA) + -> Seq Scan on tab1 + Optimizer: Pivotal Optimizer (GPORCA) (16 rows) begin; BEGIN @@ -154,18 +154,18 @@ explain (costs off) update tab1 set a = 999 from tab2, tab3 where tab1.a = tab2. Update on tab1 -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: tab1.b -> Hash Join - Hash Cond: (tab3.a = tab1_1.b) + Hash Cond: (tab3.a = tab1.b) -> Seq Scan on tab3 -> Hash -> Broadcast Motion 3:3 (slice2; segments: 3) -> Hash Join - Hash Cond: (tab2.a = tab1_1.a) + Hash Cond: (tab2.a = tab1.a) -> Seq Scan on tab2 -> Hash -> Broadcast Motion 3:3 (slice3; segments: 3) - -> Seq Scan on tab1 tab1_1 + -> Seq Scan on tab1 Optimizer: Pivotal Optimizer (GPORCA) (16 rows) begin; @@ -189,10 +189,10 @@ explain (costs off) update tab1 set b = b + 1; One-Time Filter: true -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: b -> Split - -> Seq Scan on tab1 tab1_1 - Optimizer: Pivotal Optimizer (GPORCA) + -> Seq Scan on tab1 + Optimizer: Pivotal Optimizer (GPORCA) (9 rows) begin; BEGIN diff --git a/src/test/isolation2/sql/gdd/concurrent_update.sql b/src/test/isolation2/sql/gdd/concurrent_update.sql index 96f911de34e..dde1876126f 100644 --- a/src/test/isolation2/sql/gdd/concurrent_update.sql +++ b/src/test/isolation2/sql/gdd/concurrent_update.sql @@ -128,6 +128,34 @@ DROP TABLE t_concurrent_update; 0: drop table tab_update_epq1; 0: drop table tab_update_epq2; 0q: +1q: +2q: + +-- check that orca concurrent delete transaction won't delete tuple, updated in other transaction (which doesn't match predicate anymore) +create table test as select 0 as i distributed randomly; +1: begin; +1: update test set i = i + 1; +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +2<: +drop table test; +1q: +2q: + +-- check that orca concurrent delete transaction will delete tuple, updated in other transaction (which still matches predicate) +create table test as select 0 as i distributed randomly; +1: begin; +1: update test set i = i; +-- in session 2, in case of ORCA DML invokes EPQ +-- the following SQL will hang due to XID lock +2&: delete from test where i = 0; +1: end; +2<: +drop table test; +1q: +2q: -- test ORCA partition table create table test(a int, b int, c int) partition by range(b) (start (1) end (7) every (3)); diff --git a/src/test/locale/sort-test.py b/src/test/locale/sort-test.py index 53019038ab1..e2f6828db08 100755 --- a/src/test/locale/sort-test.py +++ b/src/test/locale/sort-test.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 import sys, string, locale locale.setlocale(locale.LC_ALL, "") diff --git a/src/test/performance/parse_perf_results.py b/src/test/performance/parse_perf_results.py index fd2497e64c0..9ab429b0cb0 100644 --- a/src/test/performance/parse_perf_results.py +++ b/src/test/performance/parse_perf_results.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 ''' Parse the results of the performance test into a CSV for loading into diff --git a/src/test/regress/expected/DML_over_joins_optimizer.out b/src/test/regress/expected/DML_over_joins_optimizer.out index c0fadaeae7e..9ed171b48fb 100644 --- a/src/test/regress/expected/DML_over_joins_optimizer.out +++ b/src/test/regress/expected/DML_over_joins_optimizer.out @@ -81,7 +81,7 @@ explain update s set b = b + 1 where exists (select 1 from r where s.a = r.b); Update on s (cost=0.00..865.66 rows=34 width=1) -> Hash Semi Join (cost=0.00..862.80 rows=100 width=18) Hash Cond: (s_1.a = r.b) - -> Seq Scan on s s_1 (cost=0.00..431.00 rows=100 width=18) + -> Seq Scan on s (cost=0.00..431.00 rows=100 width=18) -> Hash (cost=431.15..431.15 rows=10000 width=4) -> Result (cost=0.00..431.15 rows=10000 width=4) -> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.14 rows=10000 width=4) @@ -97,7 +97,7 @@ explain delete from s where exists (select 1 from r where s.a = r.b); Delete on s (cost=0.00..865.66 rows=34 width=1) -> Hash Semi Join (cost=0.00..862.80 rows=34 width=18) Hash Cond: (s_1.a = r.b) - -> Seq Scan on s s_1 (cost=0.00..431.00 rows=34 width=18) + -> Seq Scan on s (cost=0.00..431.00 rows=34 width=18) -> Hash (cost=431.15..431.15 rows=3334 width=4) -> Result (cost=0.00..431.15 rows=3334 width=4) -> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.14 rows=3334 width=4) @@ -1896,8 +1896,8 @@ explain (costs off) delete from tab1 using tab2 where tab1.a = tab2.a; ------------------------------------------------------ Delete on tab1 -> Hash Join - Hash Cond: (tab1_1.a = tab2.a) - -> Seq Scan on tab1 tab1_1 + Hash Cond: (tab1.a = tab2.a) + -> Seq Scan on tab1 -> Hash -> Seq Scan on tab2 Optimizer: Pivotal Optimizer (GPORCA) version 3.86.0 @@ -1910,8 +1910,8 @@ explain (costs off) delete from tab1 using tab2 where tab1.a = tab2.b; ------------------------------------------------------------------ Delete on tab1 -> Hash Join - Hash Cond: (tab1_1.a = tab2.b) - -> Seq Scan on tab1 tab1_1 + Hash Cond: (tab1.a = tab2.b) + -> Seq Scan on tab1 -> Hash -> Redistribute Motion 3:3 (slice1; segments: 3) Hash Key: tab2.b @@ -1925,8 +1925,8 @@ explain (costs off) delete from tab1 using tab2 where tab1.b = tab2.b; --------------------------------------------------------------- Delete on tab1 -> Hash Join - Hash Cond: (tab1_1.b = tab2.b) - -> Seq Scan on tab1 tab1_1 + Hash Cond: (tab1.b = tab2.b) + -> Seq Scan on tab1 -> Hash -> Broadcast Motion 3:3 (slice1; segments: 3) -> Seq Scan on tab2 @@ -1966,18 +1966,18 @@ HINT: For non-partitioned tables, run analyze (). For Delete on tab1 -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab1_1.b + Hash Key: tab1.b -> Hash Join - Hash Cond: (tab2.a = tab1_1.a) + Hash Cond: (tab2.a = tab1.a) -> Seq Scan on tab2 -> Hash -> Redistribute Motion 3:3 (slice2; segments: 3) - Hash Key: tab1_1.a + Hash Key: tab1.a -> Hash Join - Hash Cond: (tab3.b = tab1_1.b) + Hash Cond: (tab3.b = tab1.b) -> Seq Scan on tab3 -> Hash - -> Seq Scan on tab1 tab1_1 + -> Seq Scan on tab1 Optimizer: Pivotal Optimizer (GPORCA) version 3.86.0 (16 rows) diff --git a/src/test/regress/expected/bfv_dd_types_optimizer.out b/src/test/regress/expected/bfv_dd_types_optimizer.out index 787cf0003fc..c8780686015 100644 --- a/src/test/regress/expected/bfv_dd_types_optimizer.out +++ b/src/test/regress/expected/bfv_dd_types_optimizer.out @@ -170,7 +170,7 @@ INFO: (slice 1) Dispatch command to SINGLE content -- TODO: this currently not directly dispatched (AGL-1246) select * from direct_test_type_cidr where x = '68.44.55.111'; -INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 +INFO: (slice 1) Dispatch command to SINGLE content x ----------------- 68.44.55.111/32 diff --git a/src/test/regress/expected/bfv_dml_optimizer.out b/src/test/regress/expected/bfv_dml_optimizer.out index a5566f70f54..6907dc07fea 100644 --- a/src/test/regress/expected/bfv_dml_optimizer.out +++ b/src/test/regress/expected/bfv_dml_optimizer.out @@ -186,7 +186,7 @@ explain update update_pk_test set b = 5; QUERY PLAN ---------------------------------------------------------------------------------------- Update on update_pk_test (cost=0.00..431.03 rows=1 width=1) - -> Seq Scan on update_pk_test update_pk_test_1 (cost=0.00..431.00 rows=1 width=14) + -> Seq Scan on update_pk_test (cost=0.00..431.00 rows=1 width=14) Optimizer: Pivotal Optimizer (GPORCA) (3 rows) @@ -198,18 +198,18 @@ select * from update_pk_test order by 1,2; (1 row) explain update update_pk_test set a = 5; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Update on update_pk_test (cost=0.00..431.07 rows=1 width=1) + QUERY PLAN +------------------------------------------------------------------------------------------------------------- + Update on update_pk_test (cost=0.00..431.06 rows=1 width=1) -> Result (cost=0.00..0.00 rows=0 width=0) One-Time Filter: true - -> Result (cost=0.00..431.00 rows=2 width=26) + -> Result (cost=0.00..0.00 rows=0 width=0) -> Sort (cost=0.00..431.00 rows=2 width=22) Sort Key: (DMLAction) -> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=2 width=22) - Hash Key: update_pk_test_1.a + Hash Key: a -> Split (cost=0.00..431.00 rows=1 width=22) - -> Seq Scan on update_pk_test update_pk_test_1 (cost=0.00..431.00 rows=1 width=18) + -> Seq Scan on update_pk_test (cost=0.00..431.00 rows=1 width=18) Optimizer: Pivotal Optimizer (GPORCA) (11 rows) @@ -331,8 +331,8 @@ explain delete from foo using bar where foo.a=bar.a; -> Hash Join (cost=0.00..862.00 rows=1 width=18) Hash Cond: (foo_1.a = bar.a) -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=18) - Hash Key: foo_1.a - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + Hash Key: foo.a + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) -> Hash (cost=431.00..431.00 rows=1 width=4) -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=4) Optimizer: Pivotal Optimizer (GPORCA) @@ -402,7 +402,7 @@ explain delete from foo where foo.a=1; QUERY PLAN ------------------------------------------------------------------ Delete on foo (cost=0.00..431.03 rows=1 width=1) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) Filter: (a = 1) Optimizer: Pivotal Optimizer (GPORCA) (4 rows) @@ -423,8 +423,8 @@ explain delete from foo using bar where foo.a=bar.b; --------------------------------------------------------------------------------------------------- Delete on foo (cost=0.00..862.03 rows=1 width=1) -> Hash Join (cost=0.00..862.00 rows=1 width=18) - Hash Cond: (foo_1.a = bar.b) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + Hash Cond: (foo.a = bar.b) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) -> Hash (cost=431.00..431.00 rows=3 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=3 width=4) -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=4) @@ -448,11 +448,11 @@ explain delete from foo using foo foo_1 where foo_1.a=foo.a; ---------------------------------------------------------------------------------------------------- Delete on foo (cost=0.00..862.29 rows=4 width=1) -> Hash Join (cost=0.00..862.00 rows=10 width=18) - Hash Cond: (foo_1.a = foo_2.a) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=10 width=18) + Hash Cond: (foo.a = foo_1.a) + -> Seq Scan on foo (cost=0.00..431.00 rows=10 width=18) -> Hash (cost=431.00..431.00 rows=30 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=30 width=4) - -> Seq Scan on foo foo_2 (cost=0.00..431.00 rows=4 width=4) + -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=4 width=4) Optimizer: Pivotal Optimizer (GPORCA) (8 rows) @@ -468,7 +468,7 @@ explain delete from foo; QUERY PLAN ------------------------------------------------------------------ Delete on foo (cost=0.00..431.03 rows=1 width=1) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) Optimizer: Pivotal Optimizer (GPORCA) (3 rows) @@ -490,7 +490,7 @@ explain delete from foo using bar; Delete on foo (cost=0.00..1324032.10 rows=1 width=1) -> Nested Loop (cost=0.00..1324032.07 rows=1 width=18) Join Filter: true - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) -> Materialize (cost=0.00..431.00 rows=3 width=1) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=3 width=1) -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=1) @@ -516,8 +516,8 @@ explain delete from foo using bar where foo.b=bar.b; ------------------------------------------------------------------------------------------------------ Delete on foo (cost=0.00..862.56 rows=4 width=1) -> Hash Join (cost=0.00..862.27 rows=10 width=18) - Hash Cond: (foo_1.b = bar.b) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=10 width=18) + Hash Cond: (foo.b = bar.b) + -> Seq Scan on foo (cost=0.00..431.00 rows=10 width=18) -> Hash (cost=431.08..431.08 rows=3000 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.08 rows=3000 width=4) -> Seq Scan on bar (cost=0.00..431.01 rows=334 width=4) @@ -559,8 +559,8 @@ explain update foo set a=4 from bar where foo.a=bar.a; --------------------------------------------------------------------------------------------------- Update on foo (cost=0.00..862.03 rows=1 width=1) -> Hash Join (cost=0.00..862.00 rows=1 width=14) - Hash Cond: (foo_1.a = bar.a) - -> Seq Scan on foo foo_1 (cost=0.00..431.00 rows=1 width=18) + Hash Cond: (foo.a = bar.a) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=18) -> Hash (cost=431.00..431.00 rows=3 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=3 width=4) -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=4) @@ -624,7 +624,7 @@ explain delete from foo using (select a from foo union all select b from bar) v; Delete on foo (cost=0.00..1765376.09 rows=1 width=1) -> Nested Loop (cost=0.00..1765376.07 rows=1 width=14) Join Filter: true - -> Seq Scan on foo foo_2 (cost=0.00..431.00 rows=1 width=14) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=14) -> Materialize (cost=0.00..862.00 rows=3 width=1) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..862.00 rows=3 width=1) -> Append (cost=0.00..862.00 rows=1 width=1) diff --git a/src/test/regress/expected/bfv_joins.out b/src/test/regress/expected/bfv_joins.out index 03b897177ad..9a652ab12a8 100644 --- a/src/test/regress/expected/bfv_joins.out +++ b/src/test/regress/expected/bfv_joins.out @@ -3826,6 +3826,118 @@ explain select * from o1 left join o2 on a1 = a2 left join o3 on a2 is not disti Optimizer: Postgres query optimizer (18 rows) +-- Test case from community Github PR 13722 +-- CBDB_CHERRYPICK_FIXME: PG optimizer will got a assert false case. +-- create table t_13722(id int, tt timestamp) +-- distributed by (id); +-- j->jointype == join_lasj_notin +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- t1.id not in (select id from t_13722 where id != 4) +-- and +-- t1.tt = (select min(tt) from t_13722 where id = t1.id); +-- j->jointype == join_anti +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- not exists (select id from t_13722 where id != 4 and id = t1.id) +-- and t1.tt = (select min(tt) from t_13722 where id = t1.id); +-- drop table t_13722; +-- This test is introduced to verify incorrect result +-- from hash join of char columns is fixed +-- Notice when varchar/text is cast to bpchar and used for +-- comparison, the trailing spaces are ignored +-- When char is cast to varchar/text, it's considered +-- comparison, and the trailing spaces are also ignored +-- Prior to the fix, opclasses belonging to different +-- opfamilies could be grouped as equivalent, and thence +-- deriving incorrect equality hash join conditions +create table foo (varchar_3 varchar(3)) distributed by (varchar_3); +create table bar (char_3 char(3)) distributed by (char_3); +create table baz (text_any text) distributed by (text_any); +insert into foo values ('cd'); -- 0 trailing spaces +insert into bar values ('cd '); -- 1 trailing space +insert into baz values ('cd '); -- 2 trailing spaces +-- varchar cast to bpchar +-- 'cd' matches 'cd', returns 1 row +explain select varchar_3, char_3 from foo join bar on varchar_3=char_3; + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=567.25..155836.25 rows=5055210 width=32) + -> Hash Join (cost=567.25..88433.45 rows=1685070 width=32) + Hash Cond: ((foo.varchar_3)::bpchar = bar.char_3) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..745.00 rows=23700 width=16) + Hash Key: foo.varchar_3 + -> Seq Scan on foo (cost=0.00..271.00 rows=23700 width=16) + -> Hash (cost=271.00..271.00 rows=23700 width=16) + -> Seq Scan on bar (cost=0.00..271.00 rows=23700 width=16) + Optimizer: Postgres query optimizer +(9 rows) + +select varchar_3, char_3 from foo join bar on varchar_3=char_3; + varchar_3 | char_3 +-----------+-------- + cd | cd +(1 row) + +-- char cast to text +-- 'cd' doesn't match 'cd ', returns 0 rows +explain select char_3, text_any from bar join baz on char_3=text_any; + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=430.00..168082.25 rows=3754080 width=48) + -> Hash Join (cost=430.00..118027.85 rows=1251360 width=48) + Hash Cond: ((bar.char_3)::text = baz.text_any) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..745.00 rows=23700 width=16) + Hash Key: (bar.char_3)::text + -> Seq Scan on bar (cost=0.00..271.00 rows=23700 width=16) + -> Hash (cost=210.00..210.00 rows=17600 width=32) + -> Seq Scan on baz (cost=0.00..210.00 rows=17600 width=32) + Optimizer: Postgres query optimizer +(9 rows) + +select char_3, text_any from bar join baz on char_3=text_any; + char_3 | text_any +--------+---------- +(0 rows) + +-- foo - bar join: varchar cast to bpchar +-- 'cd' matches 'cd' +-- foo - baz join: no cast +-- 'cd' doesn't match 'cd ' +-- returns 0 rows +-- Notice ORCA changes join order to minimize motion +explain select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=2141.25..15664266.93 rows=266915088 width=64) + -> Hash Join (cost=2141.25..12105399.09 rows=88971696 width=64) + Hash Cond: ((foo.varchar_3)::text = baz.text_any) + -> Hash Join (cost=567.25..88433.45 rows=1685070 width=32) + Hash Cond: ((foo.varchar_3)::bpchar = bar.char_3) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..745.00 rows=23700 width=16) + Hash Key: foo.varchar_3 + -> Seq Scan on foo (cost=0.00..271.00 rows=23700 width=16) + -> Hash (cost=271.00..271.00 rows=23700 width=16) + -> Seq Scan on bar (cost=0.00..271.00 rows=23700 width=16) + -> Hash (cost=914.00..914.00 rows=52800 width=32) + -> Broadcast Motion 3:3 (slice3; segments: 3) (cost=0.00..914.00 rows=52800 width=32) + -> Seq Scan on baz (cost=0.00..210.00 rows=17600 width=32) + Optimizer: Postgres query optimizer +(14 rows) + +select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; + varchar_3 | char_3 | text_any +-----------+--------+---------- +(0 rows) + -- Clean up. None of the objects we create are very interesting to keep around. reset search_path; set client_min_messages='warning'; diff --git a/src/test/regress/expected/bfv_joins_optimizer.out b/src/test/regress/expected/bfv_joins_optimizer.out index f631eff5204..accc82702f7 100644 --- a/src/test/regress/expected/bfv_joins_optimizer.out +++ b/src/test/regress/expected/bfv_joins_optimizer.out @@ -3838,6 +3838,117 @@ explain select * from o1 left join o2 on a1 = a2 left join o3 on a2 is not disti Optimizer: Pivotal Optimizer (GPORCA) (13 rows) +-- Test case from community Github PR 13722 +-- CBDB_CHERRYPICK_FIXME: PG optimizer will got a assert false case. +-- create table t_13722(id int, tt timestamp) +-- distributed by (id); +-- j->jointype == join_lasj_notin +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- t1.id not in (select id from t_13722 where id != 4) +-- and +-- t1.tt = (select min(tt) from t_13722 where id = t1.id); +-- j->jointype == join_anti +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- not exists (select id from t_13722 where id != 4 and id = t1.id) +-- and t1.tt = (select min(tt) from t_13722 where id = t1.id); +-- drop table t_13722; +-- This test is introduced to verify incorrect result +-- from hash join of char columns is fixed +-- Notice when varchar/text is cast to bpchar and used for +-- comparison, the trailing spaces are ignored +-- When char is cast to varchar/text, it's considered +-- comparison, and the trailing spaces are also ignored +-- Prior to the fix, opclasses belonging to different +-- opfamilies could be grouped as equivalent, and thence +-- deriving incorrect equality hash join conditions +create table foo (varchar_3 varchar(3)) distributed by (varchar_3); +create table bar (char_3 char(3)) distributed by (char_3); +create table baz (text_any text) distributed by (text_any); +insert into foo values ('cd'); -- 0 trailing spaces +insert into bar values ('cd '); -- 1 trailing space +insert into baz values ('cd '); -- 2 trailing spaces +-- varchar cast to bpchar +-- 'cd' matches 'cd', returns 1 row +explain select varchar_3, char_3 from foo join bar on varchar_3=char_3; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.00 rows=1 width=16) + -> Hash Join (cost=0.00..862.00 rows=1 width=16) + Hash Cond: ((foo.varchar_3)::bpchar = bar.char_3) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8) + Hash Key: foo.varchar_3 + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=8) + -> Hash (cost=431.00..431.00 rows=1 width=8) + -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=8) + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +select varchar_3, char_3 from foo join bar on varchar_3=char_3; + varchar_3 | char_3 +-----------+-------- + cd | cd +(1 row) + +-- char cast to text +-- 'cd' doesn't match 'cd ', returns 0 rows +explain select char_3, text_any from bar join baz on char_3=text_any; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..862.00 rows=1 width=16) + -> Hash Join (cost=0.00..862.00 rows=1 width=16) + Hash Cond: ((bar.char_3)::text = baz.text_any) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8) + Hash Key: (bar.char_3)::text + -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=8) + -> Hash (cost=431.00..431.00 rows=1 width=8) + -> Seq Scan on baz (cost=0.00..431.00 rows=1 width=8) + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +select char_3, text_any from bar join baz on char_3=text_any; + char_3 | text_any +--------+---------- +(0 rows) + +-- foo - bar join: varchar cast to bpchar +-- 'cd' matches 'cd' +-- foo - baz join: no cast +-- 'cd' doesn't match 'cd ' +-- returns 0 rows +-- Notice ORCA changes join order to minimize motion +explain select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..1293.00 rows=1 width=24) + -> Hash Join (cost=0.00..1293.00 rows=1 width=24) + Hash Cond: ((foo.varchar_3)::bpchar = bar.char_3) + -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..862.00 rows=1 width=16) + Hash Key: foo.varchar_3 + -> Hash Join (cost=0.00..862.00 rows=1 width=16) + Hash Cond: ((foo.varchar_3)::text = baz.text_any) + -> Seq Scan on foo (cost=0.00..431.00 rows=1 width=8) + -> Hash (cost=431.00..431.00 rows=1 width=8) + -> Seq Scan on baz (cost=0.00..431.00 rows=1 width=8) + -> Hash (cost=431.00..431.00 rows=1 width=8) + -> Seq Scan on bar (cost=0.00..431.00 rows=1 width=8) + Optimizer: Pivotal Optimizer (GPORCA) +(13 rows) + +select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; + varchar_3 | char_3 | text_any +-----------+--------+---------- +(0 rows) + -- Clean up. None of the objects we create are very interesting to keep around. reset search_path; set client_min_messages='warning'; diff --git a/src/test/regress/expected/bfv_planner_optimizer.out b/src/test/regress/expected/bfv_planner_optimizer.out index 5fc13e17c44..5a4ba1a9e5f 100644 --- a/src/test/regress/expected/bfv_planner_optimizer.out +++ b/src/test/regress/expected/bfv_planner_optimizer.out @@ -410,11 +410,12 @@ where x.a > random(); -> Nested Loop Join Filter: true -> Seq Scan on t_hashdist - -> Result - Filter: ((generate_series.generate_series)::double precision > random()) - -> Function Scan on generate_series + -> Materialize + -> Result + Filter: ((generate_series.generate_series)::double precision > random()) + -> Function Scan on generate_series Optimizer: Pivotal Optimizer (GPORCA) -(8 rows) +(9 rows) ---- join qual explain (costs off) select * from @@ -548,13 +549,14 @@ explain (costs off) select * from t_hashdist cross join (select a, count(1) as s -> Nested Loop Join Filter: true -> Seq Scan on t_hashdist - -> Result - Filter: (((count(1)))::double precision > random()) - -> HashAggregate - Group Key: generate_series.generate_series - -> Function Scan on generate_series + -> Materialize + -> Result + Filter: (((count(1)))::double precision > random()) + -> HashAggregate + Group Key: generate_series.generate_series + -> Function Scan on generate_series Optimizer: Pivotal Optimizer (GPORCA) -(10 rows) +(11 rows) -- limit explain (costs off) select * from t_hashdist cross join (select * from generate_series(1, 10) limit random()) x; diff --git a/src/test/regress/expected/direct_dispatch.out b/src/test/regress/expected/direct_dispatch.out index 672a472b7b6..5a23e735d69 100644 --- a/src/test/regress/expected/direct_dispatch.out +++ b/src/test/regress/expected/direct_dispatch.out @@ -615,6 +615,168 @@ INFO: (slice 1) Dispatch command to SINGLE content drop table test_prepare; INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +-- Tests to check direct dispatch if the table is randomly distributed and the +-- filter has condition on gp_segment_id +-- NOTE: Only EXPLAIN query included, output of SELECT query is not shown. +-- Since the table is distributed randomly, the output of SELECT query +-- will differ everytime new table is created, and hence the during comparision +-- the tests will fail. +drop table if exists bar_randDistr; +NOTICE: table "bar_randdistr" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table bar_randDistr(col1 int, col2 int) distributed randomly; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into bar_randDistr select i,i*2 from generate_series(1, 10)i; +INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 +INFO: (slice 1) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +-- Case 1 : simple conditions on gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0; + QUERY PLAN +------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = 0) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or gp_segment_id=2; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = 1) OR (gp_segment_id = 2)) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, count(*) from bar_randDistr group by gp_segment_id; + QUERY PLAN +------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Finalize HashAggregate + Group Key: gp_segment_id + -> Redistribute Motion 3:3 (slice2; segments: 3) + Hash Key: gp_segment_id + -> Partial HashAggregate + Group Key: gp_segment_id + -> Seq Scan on bar_randdistr + Optimizer: Postgres query optimizer +(9 rows) + +-- Case2: Conjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0 and col1 between 1 and 10; + QUERY PLAN +------------------------------------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: ((col1 >= 1) AND (col1 <= 10) AND (gp_segment_id = 0)) + Optimizer: Postgres query optimizer +(4 rows) + +-- Case3: Disjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or (col1=6 and gp_segment_id=2); + QUERY PLAN +------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = 1) OR ((col1 = 6) AND (gp_segment_id = 2))) + Optimizer: Postgres query optimizer +(4 rows) + +-- Case4: Scenario with constant/variable column and constant/variable gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id in (0,1); + QUERY PLAN +----------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = ANY ('{0,1}'::integer[])) AND (col1 = 3)) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id <>1; + QUERY PLAN +------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id <> 1) AND (col1 = 3)) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 between 1 and 5 and gp_segment_id =0; + QUERY PLAN +----------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: ((col1 >= 1) AND (col1 <= 5) AND (gp_segment_id = 0)) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id <> 0; + QUERY PLAN +------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((col1 = ANY ('{1,5}'::integer[])) AND (gp_segment_id <> 0)) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id in (0,1); + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((col1 = ANY ('{1,5}'::integer[])) AND (gp_segment_id = ANY ('{0,1}'::integer[]))) + Optimizer: Postgres query optimizer +(4 rows) + +-- Case5: Scenarios with special conditions +create function afunc() returns integer as $$ begin return 42; end; $$ language plpgsql; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +create function immutable_func() returns integer as $$ begin return 42; end; $$ language plpgsql immutable; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +explain (costs off) select * from bar_randDistr where col1 = 1; + QUERY PLAN +------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: (col1 = 1) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id % 2 = 0; + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id % 2) = 0) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id=immutable_func(); + QUERY PLAN +------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = 42) + Optimizer: Postgres query optimizer +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id=afunc(); + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = afunc()) + Optimizer: Postgres query optimizer +(4 rows) + +drop table if exists bar_randDistr; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 -- test direct dispatch via gp_segment_id qual create table t_test_dd_via_segid(id int); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Cloudberry Database data distribution key for this table. @@ -907,6 +1069,329 @@ INFO: (slice 1) Dispatch command to PARTIAL contents: 1 0 1 | 1 | 1 (2 rows) +--test direct dispatch if distribution column is of varchar type +drop table if exists t1_varchar; +NOTICE: table "t1_varchar" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table t1_varchar(col1_varchar varchar, col2_int int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'col1_varchar' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into t1_varchar values ('a',1); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('b',2); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('c',3); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('d',4); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('e',5); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('97',6); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; + QUERY PLAN +---------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = 'c'::text) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; + QUERY PLAN +----------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text <> 'c'::text) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 1 | e | 5 + 0 | d | 4 + 2 | a | 1 + 2 | 97 | 6 +(5 rows) + +--test direct dispatch if distribution column is of varchar type and disjunction scenario +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); + QUERY PLAN +---------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = ANY ('{a,b}'::text[])) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); +INFO: (slice 1) Dispatch command to PARTIAL contents: 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 2 | a | 1 +(2 rows) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'a'::text) OR ((col1_varchar)::text = 'b'::text)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; +INFO: (slice 1) Dispatch command to PARTIAL contents: 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 2 | a | 1 +(2 rows) + +--test direct dispatch if distribution column is of varchar type, having disjunction condition +-- or an additional conjunction constraint using another table column or both +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; + QUERY PLAN +------------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'c'::text) AND (col2_int = 3)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); + QUERY PLAN +------------------------------------------------------------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col2_int = ANY ('{1,3}'::integer[])) AND ((col1_varchar)::text = 'a'::text)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col2_int <> ALL ('{2,3}'::integer[])) AND ((col1_varchar)::text = 'a'::text)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; + QUERY PLAN +------------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = ANY ('{a,b}'::text[])) AND (col2_int = 2)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; +INFO: (slice 1) Dispatch command to PARTIAL contents: 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on t1_varchar + Filter: ((col2_int = 1) AND (((col1_varchar)::text = 'a'::text) OR ((col1_varchar)::text = 'b'::text))) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; +INFO: (slice 1) Dispatch command to PARTIAL contents: 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +--Test direct dispatch with explicit typecasting +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; + QUERY PLAN +----------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = '97'::text) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | 97 | 6 +(1 row) + +-- explicit cast using "char", generates a scenario of cast function from Dist Colm to datum in CTranslatorExprToDXLUtils::FDirectDispatchable(,,) +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::bpchar = 'c'::character(1)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::bpchar = '2'::character(1)) + Optimizer: Postgres query optimizer +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- +(0 rows) + +--No direct dispatch case, scenario: cast exists but not binary coercible +drop table if exists t3; +NOTICE: table "t3" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table t3 (c1 timestamp without time zone); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into t3 values ('2015-07-03 00:00:00'::timestamp without time zone); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +explain (costs off) select c1 from t3 where c1 = '2015-07-03'::date; + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t3 + Filter: (c1 = '07-03-2015'::date) + Optimizer: Postgres query optimizer +(4 rows) + +select c1 from t3 where c1 = '2015-07-03'::date; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + c1 +-------------------------- + Fri Jul 03 00:00:00 2015 +(1 row) + +drop table t3; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +drop table t1_varchar; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +--check direct dispatch working based on the distribution policy of relation +drop extension if exists citext cascade; +NOTICE: extension "citext" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +drop table if exists srt_dd; +NOTICE: table "srt_dd" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +CREATE EXTENSION citext; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +create table srt_dd (name CITEXT); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'name' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +INSERT INTO srt_dd (name) +VALUES ('abb'), + ('ABA'), + ('ABC'), + ('abd'); +INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 +INFO: (slice 1) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +explain (costs off) select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; + QUERY PLAN +---------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on srt_dd + Filter: ((name)::text = 'ABA'::text) + Optimizer: Postgres query optimizer +(4 rows) + +select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + aba +----- + aba +(1 row) + +explain (costs off) delete from srt_dd where name='ABA'::text; + QUERY PLAN +---------------------------------------------- + Delete on srt_dd + -> Seq Scan on srt_dd + Filter: ((name)::text = 'ABA'::text) + Optimizer: Postgres query optimizer +(4 rows) + +delete from srt_dd where name='ABA'::text; +INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +drop extension if exists citext cascade; +NOTICE: drop cascades to table srt_dd +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +drop table if exists srt_dd; +NOTICE: table "srt_dd" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 -- test direct dispatch via SQLValueFunction and FuncExpr for single row insertion. create table t_sql_value_function1 (a int, b date); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. @@ -1122,6 +1607,7 @@ set allow_system_table_mods=off; -- If opno of clause does not belong to opfamily of distributed key, -- do not use direct dispatch to resolve wrong result -- FIXME: orca still has wrong results +-- CBDB_MERGE_FIXME: known ORCA direct dispatch BUG create table t_14887(a varchar); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. diff --git a/src/test/regress/expected/direct_dispatch_optimizer.out b/src/test/regress/expected/direct_dispatch_optimizer.out index 106c5908058..db7c81ea670 100644 --- a/src/test/regress/expected/direct_dispatch_optimizer.out +++ b/src/test/regress/expected/direct_dispatch_optimizer.out @@ -632,6 +632,168 @@ INFO: (slice 1) Dispatch command to SINGLE content drop table test_prepare; INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +-- Tests to check direct dispatch if the table is randomly distributed and the +-- filter has condition on gp_segment_id +-- NOTE: Only EXPLAIN query included, output of SELECT query is not shown. +-- Since the table is distributed randomly, the output of SELECT query +-- will differ everytime new table is created, and hence the during comparision +-- the tests will fail. +drop table if exists bar_randDistr; +NOTICE: table "bar_randdistr" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table bar_randDistr(col1 int, col2 int) distributed randomly; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into bar_randDistr select i,i*2 from generate_series(1, 10)i; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 +INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +-- Case 1 : simple conditions on gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0; + QUERY PLAN +------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = 0) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or gp_segment_id=2; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = 1) OR (gp_segment_id = 2)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, count(*) from bar_randDistr group by gp_segment_id; + QUERY PLAN +------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> GroupAggregate + Group Key: gp_segment_id + -> Sort + Sort Key: gp_segment_id + -> Redistribute Motion 3:3 (slice2; segments: 3) + Hash Key: gp_segment_id + -> Seq Scan on bar_randdistr + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +-- Case2: Conjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0 and col1 between 1 and 10; + QUERY PLAN +------------------------------------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = 0) AND (col1 >= 1) AND (col1 <= 10)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +-- Case3: Disjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or (col1=6 and gp_segment_id=2); + QUERY PLAN +------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id = 1) OR ((col1 = 6) AND (gp_segment_id = 2))) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +-- Case4: Scenario with constant/variable column and constant/variable gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id in (0,1); + QUERY PLAN +----------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((col1 = 3) AND (gp_segment_id = ANY ('{0,1}'::integer[]))) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id <>1; + QUERY PLAN +------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((col1 = 3) AND (gp_segment_id <> 1)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 between 1 and 5 and gp_segment_id =0; + QUERY PLAN +----------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: ((col1 >= 1) AND (col1 <= 5) AND (gp_segment_id = 0)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id <> 0; + QUERY PLAN +------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((col1 = ANY ('{1,5}'::integer[])) AND (gp_segment_id <> 0)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id in (0,1); + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Gather Motion 2:1 (slice1; segments: 2) + -> Seq Scan on bar_randdistr + Filter: ((col1 = ANY ('{1,5}'::integer[])) AND (gp_segment_id = ANY ('{0,1}'::integer[]))) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +-- Case5: Scenarios with special conditions +create function afunc() returns integer as $$ begin return 42; end; $$ language plpgsql; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +create function immutable_func() returns integer as $$ begin return 42; end; $$ language plpgsql immutable; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +explain (costs off) select * from bar_randDistr where col1 = 1; + QUERY PLAN +------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: (col1 = 1) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id % 2 = 0; + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: ((gp_segment_id % 2) = 0) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id=immutable_func(); + QUERY PLAN +------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = 42) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +explain (costs off) select * from bar_randDistr where gp_segment_id=afunc(); + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on bar_randdistr + Filter: (gp_segment_id = afunc()) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +drop table if exists bar_randDistr; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 -- test direct dispatch via gp_segment_id qual create table t_test_dd_via_segid(id int); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Cloudberry Database data distribution key for this table. @@ -919,6 +1081,327 @@ INFO: (slice 1) Dispatch command to PARTIAL contents: 0 1 0 | 3 | 3 (2 rows) +--test direct dispatch if distribution column is of varchar type +drop table if exists t1_varchar; +NOTICE: table "t1_varchar" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table t1_varchar(col1_varchar varchar, col2_int int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'col1_varchar' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into t1_varchar values ('a',1); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('b',2); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('c',3); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('d',4); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('e',5); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +insert into t1_varchar values ('97',6); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; + QUERY PLAN +---------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = 'c'::text) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; + QUERY PLAN +----------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text <> 'c'::text) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 1 | e | 5 + 0 | d | 4 + 2 | a | 1 + 2 | 97 | 6 +(5 rows) + +--test direct dispatch if distribution column is of varchar type and disjunction scenario +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); + QUERY PLAN +---------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = ANY ('{a,b}'::text[])) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 2 | a | 1 +(2 rows) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'a'::text) OR ((col1_varchar)::text = 'b'::text)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 + 2 | a | 1 +(2 rows) + +--test direct dispatch if distribution column is of varchar type, having disjunction condition +-- or an additional conjunction constraint using another table column or both +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; + QUERY PLAN +------------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'c'::text) AND (col2_int = 3)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); + QUERY PLAN +------------------------------------------------------------------------------------------------ + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'a'::text) AND (col2_int = ANY ('{1,3}'::integer[]))) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = 'a'::text) AND (col2_int <> ALL ('{2,3}'::integer[]))) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; + QUERY PLAN +------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: (((col1_varchar)::text = ANY ('{a,b}'::text[])) AND (col2_int = 2)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 1 | b | 2 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t1_varchar + Filter: ((((col1_varchar)::text = 'a'::text) OR ((col1_varchar)::text = 'b'::text)) AND (col2_int = 1)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | a | 1 +(1 row) + +--Test direct dispatch with explicit typecasting +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; + QUERY PLAN +----------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::text = '97'::text) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | 97 | 6 +(1 row) + +-- explicit cast using "char", generates a scenario of cast function from Dist Colm to datum in CTranslatorExprToDXLUtils::FDirectDispatchable(,,) +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::bpchar = 'c'::character(1)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- + 2 | c | 3 +(1 row) + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; + QUERY PLAN +-------------------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on t1_varchar + Filter: ((col1_varchar)::bpchar = '2'::character(1)) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; +INFO: (slice 1) Dispatch command to SINGLE content + gp_segment_id | col1_varchar | col2_int +---------------+--------------+---------- +(0 rows) + +--No direct dispatch case, scenario: cast exists but not binary coercible +drop table if exists t3; +NOTICE: table "t3" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +create table t3 (c1 timestamp without time zone); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +insert into t3 values ('2015-07-03 00:00:00'::timestamp without time zone); +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +explain (costs off) select c1 from t3 where c1 = '2015-07-03'::date; + QUERY PLAN +------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on t3 + Filter: (c1 = '07-03-2015'::date) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select c1 from t3 where c1 = '2015-07-03'::date; +INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 + c1 +-------------------------- + Fri Jul 03 00:00:00 2015 +(1 row) + +drop table t3; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +drop table t1_varchar; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +--check direct dispatch working based on the distribution policy of relation +drop extension if exists citext cascade; +NOTICE: extension "citext" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +drop table if exists srt_dd; +NOTICE: table "srt_dd" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 +CREATE EXTENSION citext; +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +create table srt_dd (name CITEXT); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'name' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +INSERT INTO srt_dd (name) +VALUES ('abb'), + ('ABA'), + ('ABC'), + ('abd'); +INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +explain (costs off) select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; + QUERY PLAN +---------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) + -> Seq Scan on srt_dd + Filter: ((name)::text = 'ABA'::text) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; +INFO: (slice 1) Dispatch command to SINGLE content + aba +----- + aba +(1 row) + +explain (costs off) delete from srt_dd where name='ABA'::text; + QUERY PLAN +---------------------------------------------- + Delete on srt_dd + -> Seq Scan on srt_dd + Filter: ((name)::text = 'ABA'::text) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + +delete from srt_dd where name='ABA'::text; +INFO: (slice 0) Dispatch command to SINGLE content +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to SINGLE content +drop extension if exists citext cascade; +NOTICE: drop cascades to table srt_dd +INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 +INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 +drop table if exists srt_dd; +NOTICE: table "srt_dd" does not exist, skipping +INFO: Distributed transaction command 'Distributed Commit (one-phase)' to ALL contents: 0 1 2 -- test direct dispatch via SQLValueFunction and FuncExpr for single row insertion. create table t_sql_value_function1 (a int, b date); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. @@ -1142,6 +1625,7 @@ set allow_system_table_mods=off; -- If opno of clause does not belong to opfamily of distributed key, -- do not use direct dispatch to resolve wrong result -- FIXME: orca still has wrong results +-- CBDB_MERGE_FIXME: known ORCA direct dispatch BUG create table t_14887(a varchar); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. @@ -1149,17 +1633,16 @@ insert into t_14887 values('a '); explain select * from t_14887 where a = 'a'::bpchar; QUERY PLAN ------------------------------------------------------------------------------ - Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=8) + Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..431.00 rows=1 width=8) -> Seq Scan on t_14887 (cost=0.00..431.00 rows=1 width=8) Filter: ((a)::bpchar = 'a'::bpchar) Optimizer: Pivotal Optimizer (GPORCA) (4 rows) select * from t_14887 where a = 'a'::bpchar; - a ------- - a -(1 row) + a +--- +(0 rows) -- texteq does not belong to the hash opfamily of the table's citext distkey. -- But from the implementation can deduce: texteq ==> citext_eq, and we can @@ -1176,7 +1659,7 @@ insert into t_14887 values('A'),('a'); explain select * from t_14887 where a = 'a'::text; QUERY PLAN ------------------------------------------------------------------------------ - Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=8) + Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..431.00 rows=1 width=8) -> Seq Scan on t_14887 (cost=0.00..431.00 rows=1 width=8) Filter: ((a)::text = 'a'::text) Optimizer: Pivotal Optimizer (GPORCA) diff --git a/src/test/regress/expected/gporca.out b/src/test/regress/expected/gporca.out index ea19f6611b2..682abd463ad 100644 --- a/src/test/regress/expected/gporca.out +++ b/src/test/regress/expected/gporca.out @@ -12375,7 +12375,6 @@ insert into tcorr1 values (1,99); insert into tcorr2 values (1,1); analyze tcorr1; analyze tcorr2; -set optimizer_trace_fallback to on; explain select * from tcorr1 out @@ -12674,7 +12673,6 @@ analyze tbitmap; set optimizer_join_order = query; set optimizer_enable_hashjoin = off; set optimizer_enable_groupagg = off; -set optimizer_trace_fallback = on; set enable_sort = off; -- 1 simple btree explain (costs off) @@ -13174,7 +13172,6 @@ explain (costs off) select count(*), t2.c from roj1 t1 left join roj2 t2 on t1.a (11 rows) reset optimizer_enable_motion_redistribute; -reset optimizer_trace_fallback; reset enable_sort; -- simple check for btree indexes on AO tables create table t_ao_btree(a int, b int) @@ -13195,7 +13192,6 @@ create index t_ao_btree_ix on t_ao_btree using btree(a,b); analyze t_ao_btree; analyze tpart_ao_btree; analyze tpart_dim; -set optimizer_trace_fallback to on; set optimizer_enable_hashjoin to off; -- this should use a bitmap scan on the btree index select * from t_ao_btree where a = 3 and b = 3; @@ -13329,10 +13325,8 @@ select enable_xform('CXformInnerJoin2NLJoin'); -- end_ignore reset optimizer_enable_hashjoin; -reset optimizer_trace_fallback; -- Tests converted from MDPs that use tables partitioned on text columns and similar types, -- which can't be handled in ORCA MDPs, since they would require calling the GPDB executor -set optimizer_trace_fallback = on; -- GroupingOnSameTblCol-2.mdp -- from dxl create table asset_records( @@ -13740,7 +13734,6 @@ select * from v where year > 1; 2019 (1 row) -reset optimizer_trace_fallback; create table sqall_t1(a int) distributed by (a); insert into sqall_t1 values (1), (2), (3); set optimizer_join_order='query'; @@ -14028,7 +14021,6 @@ reset optimizer_xform_bind_threshold; reset statement_timeout; -- an agg of a non-SRF with a nested SRF should be treated as a SRF, the -- optimizer must not eliminate the SRF or it can produce incorrect results -set optimizer_trace_fallback = on; create table nested_srf(a text); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. @@ -14089,7 +14081,6 @@ select count(*) from (select trim(regexp_split_to_table((a)::text, ','::text)) f 0 (1 row) -reset optimizer_trace_fallback; --- if the inner child is already distributed on the join column, orca should --- not place any motion on the inner child CREATE TABLE tone (a int, b int, c int); @@ -14614,7 +14605,6 @@ NOTICE: table "empty_cte_tl_test" does not exist, skipping create table empty_cte_tl_test(id int); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Greenplum Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. -set optimizer_trace_fallback = on; with cte as ( select from empty_cte_tl_test ) @@ -14625,7 +14615,22 @@ where id in(select id from cte); ---- (0 rows) -reset optimizer_trace_fallback; +-- test that we use default cardinality estimate (40) for non-comparable types +create table ts_tbl (ts timestamp); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'ts' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create index ts_tbl_idx on ts_tbl(ts); +insert into ts_tbl select to_timestamp('99991231'::text, 'YYYYMMDD'::text) from generate_series(1,100); +analyze ts_tbl; +explain select * from ts_tbl where ts = to_timestamp('99991231'::text, 'YYYYMMDD'::text); + QUERY PLAN +--------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..2.75 rows=100 width=8) + -> Seq Scan on ts_tbl (cost=0.00..1.42 rows=33 width=8) + Filter: (ts = 'Fri Dec 31 00:00:00 9999 PST'::timestamp with time zone) + Optimizer: Postgres query optimizer +(4 rows) + WITH conf AS ( SELECT setting FROM pg_catalog.pg_config @@ -14636,3 +14641,4 @@ select * from conf; (1 row) +reset optimizer_trace_fallback; diff --git a/src/test/regress/expected/gporca_optimizer.out b/src/test/regress/expected/gporca_optimizer.out index aaad05b7cf0..138bbaadf28 100644 --- a/src/test/regress/expected/gporca_optimizer.out +++ b/src/test/regress/expected/gporca_optimizer.out @@ -12498,7 +12498,6 @@ insert into tcorr1 values (1,99); insert into tcorr2 values (1,1); analyze tcorr1; analyze tcorr2; -set optimizer_trace_fallback to on; explain select * from tcorr1 out @@ -12803,7 +12802,6 @@ analyze tbitmap; set optimizer_join_order = query; set optimizer_enable_hashjoin = off; set optimizer_enable_groupagg = off; -set optimizer_trace_fallback = on; set enable_sort = off; -- 1 simple btree explain (costs off) @@ -13180,7 +13178,8 @@ select * from foo join (select a, a::bigint*a::bigint as aa from tbtree) proj on -> Nested Loop Join Filter: ((foo.a = tbtree.a) AND (foo.b = (((tbtree.a)::bigint * (tbtree.a)::bigint)))) -> Seq Scan on foo - -> Seq Scan on tbtree + -> Materialize + -> Seq Scan on tbtree Optimizer: Pivotal Optimizer (GPORCA) (6 rows) @@ -13207,8 +13206,8 @@ from foo l1 where b in (select ab on l2.a=tbtree_derived.a and l2.b=tbtree_derived.b where l2.c = 1 ); - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Result Filter: (SubPlan 1) -> Gather Motion 3:1 (slice1; segments: 3) @@ -13220,12 +13219,13 @@ from foo l1 where b in (select ab -> Gather Motion 3:1 (slice3; segments: 3) -> Seq Scan on foo foo_1 Filter: (c = 1) - -> Result - -> Materialize - -> Gather Motion 3:1 (slice2; segments: 3) - -> Seq Scan on tbtree + -> Materialize + -> Result + -> Materialize + -> Gather Motion 3:1 (slice2; segments: 3) + -> Seq Scan on tbtree Optimizer: Pivotal Optimizer (GPORCA) -(16 rows) +(17 rows) -- 16 group by columns are not a superset of the distribution columns - no index scan explain (costs off) @@ -13310,7 +13310,6 @@ explain (costs off) select count(*), t2.c from roj1 t1 left join roj2 t2 on t1.a (12 rows) reset optimizer_enable_motion_redistribute; -reset optimizer_trace_fallback; reset enable_sort; -- simple check for btree indexes on AO tables create table t_ao_btree(a int, b int) @@ -13331,7 +13330,6 @@ create index t_ao_btree_ix on t_ao_btree using btree(a,b); analyze t_ao_btree; analyze tpart_ao_btree; analyze tpart_dim; -set optimizer_trace_fallback to on; set optimizer_enable_hashjoin to off; -- this should use a bitmap scan on the btree index select * from t_ao_btree where a = 3 and b = 3; @@ -13471,10 +13469,8 @@ select enable_xform('CXformInnerJoin2NLJoin'); -- end_ignore reset optimizer_enable_hashjoin; -reset optimizer_trace_fallback; -- Tests converted from MDPs that use tables partitioned on text columns and similar types, -- which can't be handled in ORCA MDPs, since they would require calling the GPDB executor -set optimizer_trace_fallback = on; -- GroupingOnSameTblCol-2.mdp -- from dxl create table asset_records( @@ -13860,7 +13856,6 @@ select * from v where year > 1; 2019 (1 row) -reset optimizer_trace_fallback; create table sqall_t1(a int) distributed by (a); insert into sqall_t1 values (1), (2), (3); set optimizer_join_order='query'; @@ -14136,7 +14131,6 @@ reset optimizer_xform_bind_threshold; reset statement_timeout; -- an agg of a non-SRF with a nested SRF should be treated as a SRF, the -- optimizer must not eliminate the SRF or it can produce incorrect results -set optimizer_trace_fallback = on; create table nested_srf(a text); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. @@ -14205,7 +14199,6 @@ DETAIL: Feature not supported: Unexpected target list entries in ProjectSet nod 0 (1 row) -reset optimizer_trace_fallback; --- if the inner child is already distributed on the join column, orca should --- not place any motion on the inner child CREATE TABLE tone (a int, b int, c int); @@ -14493,15 +14486,16 @@ ON t1.tradingday = t2.tradingday; -> Dynamic Index Scan on t_clientproductind2_pkey on t_clientproductind2 Index Cond: (((tradingday)::text >= '20190715'::text) AND ((tradingday)::text <= '20190715'::text) AND ((tradingday)::text = '20190715'::text)) Number of partitions to scan: 1 - -> GroupAggregate - Group Key: t_clientinstrumentind2.tradingday - -> Sort - Sort Key: t_clientinstrumentind2.tradingday - -> Redistribute Motion 3:3 (slice2; segments: 3) - Hash Key: t_clientinstrumentind2.tradingday - -> Dynamic Index Scan on t_clientinstrumentind2_pkey on t_clientinstrumentind2 - Index Cond: ((tradingday >= '20190715'::text) AND (tradingday <= '20190715'::text) AND (tradingday = '20190715'::text)) - Number of partitions to scan: 1 + -> Materialize + -> GroupAggregate + Group Key: t_clientinstrumentind2.tradingday + -> Sort + Sort Key: t_clientinstrumentind2.tradingday + -> Redistribute Motion 3:3 (slice2; segments: 3) + Hash Key: t_clientinstrumentind2.tradingday + -> Dynamic Index Scan on t_clientinstrumentind2_pkey on t_clientinstrumentind2 + Index Cond: ((tradingday >= '20190715'::text) AND (tradingday <= '20190715'::text) AND (tradingday = '20190715'::text)) + Number of partitions to scan: 1 Optimizer: Pivotal Optimizer (GPORCA) (22 rows) @@ -14518,6 +14512,8 @@ INNER JOIN ( WHERE t.tradingday BETWEEN'20190715'AND '20190715' GROUP BY t.tradingday)t2 ON t1.tradingday = t2.tradingday; +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: No plan has been computed for required properties tradingday | ins_spaninsarbitrageratio | tradingday | prod_spaninsarbitrageratio ------------+---------------------------+------------+---------------------------- 20190715 | 1 | 20190715 | 0.9233716475 @@ -14604,17 +14600,17 @@ where t.j = tt.j; -> Result (cost=0.00..0.00 rows=0 width=0) -> Explicit Redistribute Motion 1:3 (slice1; segments: 1) (cost=0.00..862.00 rows=1 width=18) -> Hash Join (cost=0.00..862.00 rows=1 width=18) - Hash Cond: (window_agg_test_1.j = window_agg_test_2.j) + Hash Cond: (window_agg_test.j = window_agg_test_1.j) -> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=14) - -> Seq Scan on window_agg_test window_agg_test_1 (cost=0.00..431.00 rows=1 width=14) + -> Seq Scan on window_agg_test (cost=0.00..431.00 rows=1 width=14) -> Hash (cost=431.00..431.00 rows=1 width=8) -> WindowAgg (cost=0.00..431.00 rows=1 width=8) - Order By: window_agg_test_2.j + Order By: window_agg_test_1.j -> Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..431.00 rows=1 width=8) - Merge Key: window_agg_test_2.j + Merge Key: window_agg_test_1.j -> Sort (cost=0.00..431.00 rows=1 width=8) - Sort Key: window_agg_test_2.j - -> Seq Scan on window_agg_test window_agg_test_2 (cost=0.00..431.00 rows=1 width=8) + Sort Key: window_agg_test_1.j + -> Seq Scan on window_agg_test window_agg_test_1 (cost=0.00..431.00 rows=1 width=8) Optimizer: Pivotal Optimizer (GPORCA) (16 rows) @@ -14640,14 +14636,18 @@ explain select c2 from quad_func_cast(); (2 rows) explain select (c1).r from quad_func_cast(); - QUERY PLAN +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: FIELDSELECT + QUERY PLAN ------------------------------------------------------------------- Function Scan on quad_func_cast (cost=0.00..0.01 rows=1 width=8) Optimizer: Postgres query optimizer (2 rows) explain select (c2).i from quad_func_cast(); - QUERY PLAN +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: FIELDSELECT + QUERY PLAN ------------------------------------------------------------------- Function Scan on quad_func_cast (cost=0.00..0.01 rows=1 width=8) Optimizer: Postgres query optimizer @@ -14666,12 +14666,16 @@ select c2 from quad_func_cast(); (1 row) select (c1).r from quad_func_cast(); +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: FIELDSELECT r ----- 1.1 (1 row) select (c2).i from quad_func_cast(); +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: FIELDSELECT i --- @@ -14725,7 +14729,6 @@ NOTICE: table "empty_cte_tl_test" does not exist, skipping create table empty_cte_tl_test(id int); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Greenplum Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. -set optimizer_trace_fallback = on; with cte as ( select from empty_cte_tl_test ) @@ -14738,7 +14741,22 @@ DETAIL: Feature not supported: Empty target list ---- (0 rows) -reset optimizer_trace_fallback; +-- test that we use default cardinality estimate (40) for non-comparable types +create table ts_tbl (ts timestamp); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'ts' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create index ts_tbl_idx on ts_tbl(ts); +insert into ts_tbl select to_timestamp('99991231'::text, 'YYYYMMDD'::text) from generate_series(1,100); +analyze ts_tbl; +explain select * from ts_tbl where ts = to_timestamp('99991231'::text, 'YYYYMMDD'::text); + QUERY PLAN +------------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..6.01 rows=40 width=8) + -> Index Scan using ts_tbl_idx on ts_tbl (cost=0.00..6.00 rows=14 width=8) + Index Cond: (ts = 'Fri Dec 31 00:00:00 9999 PST'::timestamp with time zone) + Optimizer: Pivotal Optimizer (GPORCA) +(4 rows) + WITH conf AS ( SELECT setting FROM pg_catalog.pg_config @@ -14749,3 +14767,4 @@ select * from conf; (1 row) +reset optimizer_trace_fallback; diff --git a/src/test/regress/expected/inherit_optimizer.out b/src/test/regress/expected/inherit_optimizer.out index a2265212145..3efa7a8e25a 100644 --- a/src/test/regress/expected/inherit_optimizer.out +++ b/src/test/regress/expected/inherit_optimizer.out @@ -1927,9 +1927,9 @@ explain (costs off) select * from list_parted where a = 'ab' or a in (null, 'cd' (5 rows) explain (costs off) select * from list_parted where a = 'ab'; - QUERY PLAN ------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + QUERY PLAN +---------------------------------------------------- + Gather Motion 1:1 (slice1; segments: 1) -> Dynamic Seq Scan on list_parted Number of partitions to scan: 1 Filter: ((a)::text = 'ab'::text) diff --git a/src/test/regress/expected/join_gp.out b/src/test/regress/expected/join_gp.out index 6722f5a8246..3f2c8cf077b 100644 --- a/src/test/regress/expected/join_gp.out +++ b/src/test/regress/expected/join_gp.out @@ -1519,7 +1519,7 @@ select * from foo where exists (select 1 from bar where foo.a = bar.b); -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join diff --git a/src/test/regress/expected/join_hash_optimizer.out b/src/test/regress/expected/join_hash_optimizer.out index 23eaedbd6f7..516d35fcd11 100644 --- a/src/test/regress/expected/join_hash_optimizer.out +++ b/src/test/regress/expected/join_hash_optimizer.out @@ -1150,8 +1150,10 @@ WHERE Filter: (((hjtest_2.c * 5)) < 55) -> Result Output: (hjtest_2.c * 5) - -> Result - Output: 1 + -> Materialize + Output: (1) + -> Result + Output: 1 SubPlan 2 -> Result Output: (hjtest_2.c * 5) @@ -1225,8 +1227,10 @@ WHERE Filter: (((hjtest_2.c * 5)) < 55) -> Result Output: (hjtest_2.c * 5) - -> Result - Output: 1 + -> Materialize + Output: (1) + -> Result + Output: 1 SubPlan 2 -> Result Output: (hjtest_2.c * 5) diff --git a/src/test/regress/expected/join_optimizer.out b/src/test/regress/expected/join_optimizer.out index 503c0af1519..4b73785d627 100644 --- a/src/test/regress/expected/join_optimizer.out +++ b/src/test/regress/expected/join_optimizer.out @@ -3372,8 +3372,8 @@ select * from tenk1 join int4_tbl on f1 = twothousand, q1, q2 where q1 = thousand or q2 = thousand; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Gather Motion 3:1 (slice1; segments: 3) -> Hash Join Hash Cond: (tenk1.twothousand = int4_tbl.f1) diff --git a/src/test/regress/expected/notin_optimizer.out b/src/test/regress/expected/notin_optimizer.out index 46052b7e4f2..7bf4f53773d 100644 --- a/src/test/regress/expected/notin_optimizer.out +++ b/src/test/regress/expected/notin_optimizer.out @@ -1198,11 +1198,11 @@ explain select c1 from t1 where c1::absint not in Filter: (NOT CASE WHEN ((count((true))) > '0'::bigint) THEN CASE WHEN ((sum((CASE WHEN (((t1.c1)::absint = ((t1n.c1n)::absint)) IS NULL) THEN 1 ELSE 0 END))) = (count((true)))) THEN NULL::boolean ELSE true END ELSE false END) -> HashAggregate (cost=0.00..1324035.89 rows=4 width=20) Group Key: t1.c1, t1.ctid, t1.gp_segment_id - -> Nested Loop Left Join (cost=0.00..1324035.88 rows=11 width=19) + -> Nested Loop Left Join (cost=0.00..1324035.89 rows=11 width=19) Join Filter: (((t1.c1)::absint = ((t1n.c1n)::absint)) IS NOT FALSE) -> Seq Scan on t1 (cost=0.00..431.00 rows=4 width=14) - -> Result (cost=0.00..431.00 rows=7 width=5) - -> Materialize (cost=0.00..431.00 rows=7 width=4) + -> Materialize (cost=0.00..431.00 rows=7 width=5) + -> Result (cost=0.00..431.00 rows=7 width=5) -> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=7 width=4) -> Seq Scan on t1n (cost=0.00..431.00 rows=3 width=4) Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 diff --git a/src/test/regress/expected/partition_join.out b/src/test/regress/expected/partition_join.out index d18d34ce0f4..80bde64b3db 100644 --- a/src/test/regress/expected/partition_join.out +++ b/src/test/regress/expected/partition_join.out @@ -2693,7 +2693,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2707,7 +2707,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice4; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2721,7 +2721,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice6; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2962,7 +2962,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2976,7 +2976,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice4; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2990,7 +2990,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice6; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -3800,7 +3800,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -3813,7 +3813,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice3; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -3826,7 +3826,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice4; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4029,7 +4029,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4042,7 +4042,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice3; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4055,7 +4055,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice4; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4293,7 +4293,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4469,7 +4469,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4482,7 +4482,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice3; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -4495,7 +4495,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice4; segments: 3) Hash Key: (RowIdExpr) -> Hash Join diff --git a/src/test/regress/expected/partition_prune_optimizer.out b/src/test/regress/expected/partition_prune_optimizer.out index 42844e5881f..f254fed1cd7 100644 --- a/src/test/regress/expected/partition_prune_optimizer.out +++ b/src/test/regress/expected/partition_prune_optimizer.out @@ -1344,7 +1344,7 @@ explain (costs off) select * from coercepart where a = any ('{ab,bc}'); explain (costs off) select * from coercepart where a = any ('{ab,null}'); QUERY PLAN --------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> Dynamic Seq Scan on coercepart Number of partitions to scan: 1 Filter: ((a)::text = ANY ('{ab,NULL}'::text[])) @@ -1364,7 +1364,7 @@ explain (costs off) select * from coercepart where a = any (null::text[]); explain (costs off) select * from coercepart where a = all ('{ab}'); QUERY PLAN ---------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> Dynamic Seq Scan on coercepart Number of partitions to scan: 1 Filter: ((a)::text = ALL ('{ab}'::text[])) @@ -1384,7 +1384,7 @@ explain (costs off) select * from coercepart where a = all ('{ab,bc}'); explain (costs off) select * from coercepart where a = all ('{ab,null}'); QUERY PLAN --------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> Dynamic Seq Scan on coercepart Number of partitions to scan: 1 Filter: ((a)::text = ALL ('{ab,NULL}'::text[])) @@ -3994,16 +3994,16 @@ explain (costs off) select * from listp1 where a = 2; (4 rows) explain (costs off) update listp1 set a = 1 where a = 2; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on listp1 -> Result One-Time Filter: true -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: listp1_1.a + Hash Key: a -> Split - -> Seq Scan on listp1 listp1_1 + -> Seq Scan on listp1 Filter: (a = 2) Optimizer: Pivotal Optimizer (GPORCA) (10 rows) @@ -4020,16 +4020,16 @@ explain (costs off) select * from listp1 where a = 2; (4 rows) explain (costs off) update listp1 set a = 1 where a = 2; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on listp1 -> Result One-Time Filter: true -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: listp1_1.a + Hash Key: a -> Split - -> Seq Scan on listp1 listp1_1 + -> Seq Scan on listp1 Filter: (a = 2) Optimizer: Pivotal Optimizer (GPORCA) (10 rows) diff --git a/src/test/regress/expected/pg_lsn_optimizer.out b/src/test/regress/expected/pg_lsn_optimizer.out index 2dd7481ce90..ab6f0b0132d 100644 --- a/src/test/regress/expected/pg_lsn_optimizer.out +++ b/src/test/regress/expected/pg_lsn_optimizer.out @@ -142,12 +142,13 @@ SELECT DISTINCT (i || '/' || j)::pg_lsn f -> Result Filter: (generate_series_2.generate_series <= 10) -> Function Scan on generate_series generate_series_2 - -> Result - Filter: ((generate_series_1.generate_series > 0) AND (generate_series_1.generate_series <= 10)) - -> Function Scan on generate_series generate_series_1 + -> Materialize + -> Result + Filter: ((generate_series_1.generate_series > 0) AND (generate_series_1.generate_series <= 10)) + -> Function Scan on generate_series generate_series_1 -> Function Scan on generate_series - Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 -(16 rows) + Optimizer: Pivotal Optimizer (GPORCA) +(17 rows) SELECT DISTINCT (i || '/' || j)::pg_lsn f FROM generate_series(1, 10) i, diff --git a/src/test/regress/expected/portals_optimizer.out b/src/test/regress/expected/portals_optimizer.out index 15bd1728695..d6a0877b907 100644 --- a/src/test/regress/expected/portals_optimizer.out +++ b/src/test/regress/expected/portals_optimizer.out @@ -1176,9 +1176,10 @@ explain (costs off) declare c1 cursor for select (select 42) as x; Nested Loop Left Join Join Filter: true -> Result - -> Result + -> Materialize + -> Result Optimizer: Pivotal Optimizer (GPORCA) -(5 rows) +(6 rows) explain (costs off) declare c1 scroll cursor for select (select 42) as x; QUERY PLAN @@ -1186,9 +1187,10 @@ explain (costs off) declare c1 scroll cursor for select (select 42) as x; Nested Loop Left Join Join Filter: true -> Result - -> Result + -> Materialize + -> Result Optimizer: Pivotal Optimizer (GPORCA) -(5 rows) +(6 rows) declare c1 scroll cursor for select (select 42) as x; fetch all in c1; diff --git a/src/test/regress/expected/qp_correlated_query_optimizer.out b/src/test/regress/expected/qp_correlated_query_optimizer.out index c1dbff9158e..9175ecd6501 100644 --- a/src/test/regress/expected/qp_correlated_query_optimizer.out +++ b/src/test/regress/expected/qp_correlated_query_optimizer.out @@ -206,26 +206,27 @@ select * from A,B where exists (select * from C where B.i not in (select C.i fro Join Filter: true -> Broadcast Motion 3:3 (slice4; segments: 3) -> Seq Scan on a - -> Result - Filter: ((SubPlan 1) > '0'::bigint) - -> Seq Scan on b - SubPlan 1 - -> Aggregate - -> Nested Loop - Join Filter: true - -> Result - Filter: ((CASE WHEN (sum((CASE WHEN (b.i = c_1.i) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (c_1.i IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (b.i IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (b.i = c_1.i) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END) = true) - -> Aggregate - -> Result - -> Materialize - -> Broadcast Motion 3:3 (slice3; segments: 3) - -> Seq Scan on c c_1 - Filter: (i <> 10) - -> Materialize - -> Broadcast Motion 3:3 (slice2; segments: 3) - -> Seq Scan on c - Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 -(24 rows) + -> Materialize + -> Result + Filter: ((SubPlan 1) > '0'::bigint) + -> Seq Scan on b + SubPlan 1 + -> Aggregate + -> Nested Loop + Join Filter: true + -> Result + Filter: ((CASE WHEN (sum((CASE WHEN (b.i = c_1.i) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (c_1.i IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (b.i IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (b.i = c_1.i) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END) = true) + -> Aggregate + -> Result + -> Materialize + -> Broadcast Motion 3:3 (slice3; segments: 3) + -> Seq Scan on c c_1 + Filter: (i <> 10) + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on c + Optimizer: Pivotal Optimizer (GPORCA) +(25 rows) select * from A,B where exists (select * from C where B.i not in (select C.i from C where C.i != 10)); i | j | i | j diff --git a/src/test/regress/expected/qp_orca_fallback.out b/src/test/regress/expected/qp_orca_fallback.out index d0a7fbb4f27..0d34a26ad3f 100644 --- a/src/test/regress/expected/qp_orca_fallback.out +++ b/src/test/regress/expected/qp_orca_fallback.out @@ -239,6 +239,14 @@ explain select count(*) from foo group by a; Optimizer: Postgres query optimizer (5 rows) +-- Orca should fallback for RTE_TABLEFUNC RTE type +explain SELECT * FROM xmltable('/root' passing '' COLUMNS element text); + QUERY PLAN +------------------------------------------------------------------------ + Table Function Scan on "xmltable" (cost=0.00..1.00 rows=100 width=32) + Optimizer: Postgres query optimizer +(2 rows) + create table ext_part(a int) partition by list(a); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. diff --git a/src/test/regress/expected/qp_orca_fallback_optimizer.out b/src/test/regress/expected/qp_orca_fallback_optimizer.out index d0139182cc9..b9387ef52d5 100644 --- a/src/test/regress/expected/qp_orca_fallback_optimizer.out +++ b/src/test/regress/expected/qp_orca_fallback_optimizer.out @@ -56,7 +56,7 @@ explain update constr_tab set b = 10; QUERY PLAN -------------------------------------------------------------------------------- Update on constr_tab (cost=0.00..431.04 rows=1 width=1) - -> Seq Scan on constr_tab constr_tab_1 (cost=0.00..431.00 rows=1 width=22) + -> Seq Scan on constr_tab (cost=0.00..431.00 rows=1 width=22) Optimizer: Pivotal Optimizer (GPORCA) (3 rows) @@ -113,7 +113,7 @@ explain update constr_tab set a = 10; -> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=2 width=30) Hash Key: constr_tab_1.a -> Split (cost=0.00..431.00 rows=1 width=30) - -> Seq Scan on constr_tab constr_tab_1 (cost=0.00..431.00 rows=1 width=26) + -> Seq Scan on constr_tab (cost=0.00..431.00 rows=1 width=26) Optimizer: Pivotal Optimizer (GPORCA) (9 rows) @@ -287,6 +287,16 @@ DETAIL: No plan has been computed for required properties Optimizer: Postgres query optimizer (5 rows) +-- Orca should fallback for RTE_TABLEFUNC RTE type +explain SELECT * FROM xmltable('/root' passing '' COLUMNS element text); +INFO: GPORCA failed to produce a plan, falling back to planner +DETAIL: Feature not supported: RangeTableEntry of type Table Function + QUERY PLAN +------------------------------------------------------------------------ + Table Function Scan on "xmltable" (cost=0.00..1.00 rows=100 width=32) + Optimizer: Postgres query optimizer +(2 rows) + create table ext_part(a int) partition by list(a); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. diff --git a/src/test/regress/expected/qp_subquery_optimizer.out b/src/test/regress/expected/qp_subquery_optimizer.out index 5414069ba69..251242d9408 100644 --- a/src/test/regress/expected/qp_subquery_optimizer.out +++ b/src/test/regress/expected/qp_subquery_optimizer.out @@ -1448,8 +1448,8 @@ explain delete from TabDel1 where TabDel1.a not in (select a from TabDel3); -- d --------------------------------------------------------------------------------------------------- Delete on tabdel1 (cost=0.00..862.04 rows=1 width=1) -> Hash Left Anti Semi (Not-In) Join (cost=0.00..862.00 rows=1 width=18) - Hash Cond: (tabdel1_1.a = tabdel3.a) - -> Seq Scan on tabdel1 tabdel1_1 (cost=0.00..431.00 rows=1 width=18) + Hash Cond: (tabdel1.a = tabdel3.a) + -> Seq Scan on tabdel1 (cost=0.00..431.00 rows=1 width=18) -> Hash (cost=431.00..431.00 rows=1 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=4) -> Seq Scan on tabdel3 (cost=0.00..431.00 rows=1 width=4) @@ -1461,8 +1461,8 @@ explain delete from TabDel2 where TabDel2.a not in (select a from TabDel4); -- s --------------------------------------------------------------------------------------------------- Delete on tabdel2 (cost=0.00..862.03 rows=1 width=1) -> Hash Left Anti Semi (Not-In) Join (cost=0.00..862.00 rows=1 width=18) - Hash Cond: (tabdel2_1.a = tabdel4.a) - -> Seq Scan on tabdel2 tabdel2_1 (cost=0.00..431.00 rows=1 width=18) + Hash Cond: (tabdel2.a = tabdel4.a) + -> Seq Scan on tabdel2 (cost=0.00..431.00 rows=1 width=18) -> Hash (cost=431.00..431.00 rows=3 width=4) -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=3 width=4) -> Seq Scan on tabdel4 (cost=0.00..431.00 rows=1 width=4) diff --git a/src/test/regress/expected/qp_targeted_dispatch_optimizer.out b/src/test/regress/expected/qp_targeted_dispatch_optimizer.out index 008470335df..abf4565f511 100644 --- a/src/test/regress/expected/qp_targeted_dispatch_optimizer.out +++ b/src/test/regress/expected/qp_targeted_dispatch_optimizer.out @@ -323,7 +323,7 @@ INFO: (slice 0) Dispatch command to ALL contents: 0 1 2 INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2 INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2 select * from bytea where bytea1='d' and cidr1='0.0.0.1'; -INFO: (slice 1) Dispatch command to ALL contents: 0 1 2 +INFO: (slice 1) Dispatch command to SINGLE content bytea1 | cidr1 --------+------------ \x64 | 0.0.0.1/32 diff --git a/src/test/regress/expected/rpt_optimizer.out b/src/test/regress/expected/rpt_optimizer.out index c4ee293eb2a..e03f173df7c 100644 --- a/src/test/regress/expected/rpt_optimizer.out +++ b/src/test/regress/expected/rpt_optimizer.out @@ -831,10 +831,11 @@ explain (costs off) select * from t_replicate_volatile, t_hashdist where t_repli -> Nested Loop Join Filter: true -> Seq Scan on t_hashdist - -> Seq Scan on t_replicate_volatile - Filter: ((a)::double precision > random()) + -> Materialize + -> Seq Scan on t_replicate_volatile + Filter: ((a)::double precision > random()) Optimizer: Pivotal Optimizer (GPORCA) -(7 rows) +(8 rows) -- join qual explain (costs off) select * from t_hashdist, t_replicate_volatile x, t_replicate_volatile y where x.a + y.a > random(); @@ -959,15 +960,16 @@ explain (costs off) select * from t_hashdist cross join (select a, sum(b) as s f -> Nested Loop Join Filter: true -> Seq Scan on t_hashdist - -> Result - Filter: (((sum(t_replicate_volatile.b)))::double precision > random()) - -> GroupAggregate - Group Key: t_replicate_volatile.a - -> Sort - Sort Key: t_replicate_volatile.a - -> Seq Scan on t_replicate_volatile + -> Materialize + -> Result + Filter: (((sum(t_replicate_volatile.b)))::double precision > random()) + -> GroupAggregate + Group Key: t_replicate_volatile.a + -> Sort + Sort Key: t_replicate_volatile.a + -> Seq Scan on t_replicate_volatile Optimizer: Pivotal Optimizer (GPORCA) -(12 rows) +(13 rows) -- insert explain (costs off) insert into t_replicate_volatile select random() from t_replicate_volatile; diff --git a/src/test/regress/expected/spgist_optimizer.out b/src/test/regress/expected/spgist_optimizer.out index 5b20f124581..bc2c79503af 100644 --- a/src/test/regress/expected/spgist_optimizer.out +++ b/src/test/regress/expected/spgist_optimizer.out @@ -75,7 +75,7 @@ explain (costs off) select * from spgist_domain_tbl where f1 = 'fo'; QUERY PLAN ------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> Seq Scan on spgist_domain_tbl Filter: ((f1)::text = 'fo'::text) Optimizer: Pivotal Optimizer (GPORCA) diff --git a/src/test/regress/expected/stats_ext_optimizer.out b/src/test/regress/expected/stats_ext_optimizer.out index e8dd488be71..b2839d13b05 100644 --- a/src/test/regress/expected/stats_ext_optimizer.out +++ b/src/test/regress/expected/stats_ext_optimizer.out @@ -250,7 +250,7 @@ SELECT 1 FROM pg_statistic_ext WHERE stxrelid = 'stxdinp'::regclass; SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinp GROUP BY 1, 2'); estimated | actual -----------+-------- - 57 | 10 + 10 | 10 (1 row) DROP TABLE stxdinp; @@ -438,19 +438,19 @@ SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY ctid SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 69 | 11 + 11 | 11 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY b, c'); estimated | actual -----------+-------- - 69 | 11 + 11 | 11 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b, c'); estimated | actual -----------+-------- - 316 | 11 + 11 | 11 (1 row) -- partial improvement (match on attributes) @@ -485,13 +485,13 @@ SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, ( SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b, c, d'); estimated | actual -----------+-------- - 316 | 11 + 11 | 11 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY b, c, d'); estimated | actual -----------+-------- - 69 | 11 + 11 | 11 (1 row) TRUNCATE TABLE ndistinct; @@ -514,25 +514,25 @@ SELECT s.stxkind, d.stxdndistinct SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 125 | 221 + 221 | 221 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b, c'); estimated | actual -----------+-------- - 997 | 1000 + 1000 | 1000 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b, c, d'); estimated | actual -----------+-------- - 997 | 1000 + 1000 | 1000 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY b, c, d'); estimated | actual -----------+-------- - 182 | 323 + 323 | 323 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, d'); @@ -711,7 +711,7 @@ SELECT s.stxkind, d.stxdndistinct SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 125 | 221 + 221 | 221 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (2*c)'); @@ -783,7 +783,7 @@ ANALYZE ndistinct; SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 16 | 9 + 9 | 9 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (b+1)'); @@ -829,7 +829,7 @@ ANALYZE ndistinct; SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 16 | 9 + 9 | 9 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (b+1)'); @@ -875,7 +875,7 @@ ANALYZE ndistinct; SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 16 | 9 + 9 | 9 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (b+1)'); @@ -921,7 +921,7 @@ ANALYZE ndistinct; SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 16 | 9 + 9 | 9 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (b+1)'); @@ -971,7 +971,7 @@ ANALYZE ndistinct; SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, b'); estimated | actual -----------+-------- - 16 | 9 + 9 | 9 (1 row) SELECT * FROM check_estimated_rows('SELECT COUNT(*) FROM ndistinct GROUP BY a, (b+1)'); @@ -1267,13 +1267,13 @@ SELECT dependencies FROM pg_stats_ext WHERE statistics_name = 'func_deps_stat'; SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'''); estimated | actual -----------+-------- - 2 | 50 + 50 | 50 (1 row) SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'' AND c = 1'); estimated | actual -----------+-------- - 1 | 50 + 50 | 50 (1 row) -- IN @@ -1436,7 +1436,7 @@ ANALYZE functional_dependencies; SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'' AND c = 1'); estimated | actual -----------+-------- - 1 | 50 + 50 | 50 (1 row) DROP STATISTICS func_deps_stat; @@ -1821,31 +1821,31 @@ ANALYZE functional_dependencies_multi; SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies_multi WHERE a = 0 AND b = 0'); estimated | actual -----------+-------- - 182 | 714 + 714 | 714 (1 row) SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies_multi WHERE 0 = a AND 0 = b'); estimated | actual -----------+-------- - 182 | 714 + 714 | 714 (1 row) SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies_multi WHERE c = 0 AND d = 0'); estimated | actual -----------+-------- - 74 | 454 + 455 | 454 (1 row) SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies_multi WHERE a = 0 AND b = 0 AND c = 0 AND d = 0'); estimated | actual -----------+-------- - 12 | 64 + 25 | 64 (1 row) SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies_multi WHERE 0 = a AND b = 0 AND 0 = c AND d = 0'); estimated | actual -----------+-------- - 12 | 64 + 25 | 64 (1 row) DROP TABLE functional_dependencies_multi; diff --git a/src/test/regress/expected/subselect_gp.out b/src/test/regress/expected/subselect_gp.out index cd3c95daa7a..f35c5e66c2b 100644 --- a/src/test/regress/expected/subselect_gp.out +++ b/src/test/regress/expected/subselect_gp.out @@ -1917,7 +1917,7 @@ select * from dedup_reptab r where r.a in (select t.a/10 from dedup_tab t); Group Key: (RowIdExpr) -> Sort Locus: Hashed - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Locus: Hashed Hash Key: (RowIdExpr) @@ -1975,7 +1975,7 @@ select * from dedup_srf() r(a) where r.a in (select t.a/10 from dedup_tab t); -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2004,7 +2004,7 @@ select * from dedup_srf_stable() r(a) where r.a in (select t.a/10 from dedup_tab -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2033,7 +2033,7 @@ select * from dedup_srf_volatile() r(a) where r.a in (select t.a/10 from dedup_t -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -2113,7 +2113,7 @@ select * from dedup_func_volatile() r(a) where r.a in (select t.a/10 from dedup_ -> Unique Group Key: (RowIdExpr) -> Sort - Sort Key (Distinct): (RowIdExpr) + Sort Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: (RowIdExpr) -> Hash Join @@ -3313,3 +3313,138 @@ drop table sublink_outer_table; drop table sublink_inner_table; reset optimizer; reset enable_hashagg; +-- Ensure sub-queries with order by outer reference can be decorrelated and executed correctly. +create table r(a int, b int, c int) distributed by (a); +create table s(a int, b int, c int) distributed by (a); +insert into r values (1,2,3); +insert into s values (1,2,10); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(9 rows) + +select * from r where b in (select b from s where c=10 order by r.c); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c limit 2); + QUERY PLAN +----------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on r + Filter: (SubPlan 1) + SubPlan 1 + -> Limit + -> Result + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(11 rows) + +select * from r where b in (select b from s where c=10 order by r.c limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(9 rows) + +select * from r where b in (select b from s where c=10 order by r.c, b); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b limit 2); + QUERY PLAN +----------------------------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on r + Filter: (SubPlan 1) + SubPlan 1 + -> Limit + -> Sort + Sort Key: s.b + -> Result + -> Materialize + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(13 rows) + +select * from r where b in (select b from s where c=10 order by r.c, b limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by c); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(9 rows) + +select * from r where b in (select b from s where c=10 order by c); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by c limit 2); + QUERY PLAN +------------------------------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = "ANY_subquery".b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 1:3 (slice2; segments: 1) + -> Subquery Scan on "ANY_subquery" + -> Limit + -> Gather Motion 3:1 (slice3; segments: 3) + -> Limit + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Postgres query optimizer +(13 rows) + +select * from r where b in (select b from s where c=10 order by c limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + diff --git a/src/test/regress/expected/subselect_gp_optimizer.out b/src/test/regress/expected/subselect_gp_optimizer.out index 824f9e1a673..ad2773ca979 100644 --- a/src/test/regress/expected/subselect_gp_optimizer.out +++ b/src/test/regress/expected/subselect_gp_optimizer.out @@ -193,8 +193,8 @@ explain select * from mrs_t1 where x in (select x-95 from mrs_t1) or x < 5; -> Sort (cost=0.00..431.00 rows=7 width=14) Sort Key: mrs_t1_1.x, mrs_t1_1.ctid, mrs_t1_1.gp_segment_id -> Seq Scan on mrs_t1 mrs_t1_1 (cost=0.00..431.00 rows=7 width=14) - -> Result (cost=0.00..431.00 rows=20 width=5) - -> Materialize (cost=0.00..431.00 rows=20 width=4) + -> Materialize (cost=0.00..431.00 rows=20 width=5) + -> Result (cost=0.00..431.00 rows=20 width=5) -> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=20 width=4) -> Seq Scan on mrs_t1 (cost=0.00..431.00 rows=7 width=4) Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 @@ -376,10 +376,10 @@ explain select * from csq_m1 where x not in (select x from csq_d1) or x < -100; -> Redistribute Motion 1:3 (slice3) (cost=0.00..1293.00 rows=4 width=19) -> Nested Loop Left Join (cost=0.00..1293.00 rows=2 width=19) Join Filter: ((csq_m1.x = csq_d1.x) IS NOT FALSE) - -> Seq Scan on csq_m1 (cost=0.00..431.00 rows=1 width=14) - -> Result (cost=0.00..431.00 rows=1 width=5) - -> Materialize (cost=0.00..431.00 rows=1 width=4) - -> Gather Motion 3:1 (slice4; segments: 3) (cost=0.00..431.00 rows=2 width=4) + -> Seq Scan on csq_m1 (cost=0.00..431.00 rows=3 width=14) + -> Materialize (cost=0.00..431.00 rows=3 width=5) + -> Result (cost=0.00..431.00 rows=3 width=5) + -> Gather Motion 3:1 (slice4; segments: 3) (cost=0.00..431.00 rows=3 width=4) -> Seq Scan on csq_d1 (cost=0.00..431.00 rows=1 width=4) Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 (23 rows) @@ -406,11 +406,11 @@ explain select * from csq_d1 where x not in (select x from csq_m1) or x < -100; -> Sort (cost=0.00..431.00 rows=1 width=14) Sort Key: csq_d1.x, csq_d1.ctid, csq_d1.gp_segment_id -> Seq Scan on csq_d1 (cost=0.00..431.00 rows=1 width=14) - -> Result (cost=0.00..431.00 rows=3 width=5) - -> Materialize (cost=0.00..431.00 rows=3 width=4) - -> Broadcast Motion 1:3 (slice2) (cost=0.00..431.00 rows=9 width=4) - -> Seq Scan on csq_m1 (cost=0.00..431.00 rows=1 width=4) - Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0 + -> Materialize (cost=0.00..431.00 rows=3 width=5) + -> Result (cost=0.00..431.00 rows=3 width=5) + -> Broadcast Motion 1:3 (slice2) (cost=0.00..431.00 rows=3 width=4) + -> Seq Scan on csq_m1 (cost=0.00..431.00 rows=3 width=4) + Optimizer: Pivotal Optimizer (GPORCA) (15 rows) select * from csq_d1 where x not in (select x from csq_m1) or x < -100; -- (4) @@ -2766,8 +2766,8 @@ explain (verbose, costs off) with run_dt as ( ) select * from run_dt, extra_flow_dist1 where dt < '2010-01-01'::date; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Gather Motion 3:1 (slice1; segments: 3) Output: ((SubPlan 1)), extra_flow_dist1.a, extra_flow_dist1.b -> Nested Loop @@ -2775,21 +2775,23 @@ where dt < '2010-01-01'::date; Join Filter: true -> Seq Scan on subselect_gp.extra_flow_dist1 Output: extra_flow_dist1.a, extra_flow_dist1.b - -> Result + -> Materialize Output: ((SubPlan 1)) - Filter: (((SubPlan 1)) < '01-01-2010'::date) - -> Seq Scan on subselect_gp.extra_flow_rand - Output: (SubPlan 1) - SubPlan 1 - -> Result - Output: extra_flow_dist.c - Filter: (extra_flow_dist.b = extra_flow_rand.a) - -> Materialize - Output: extra_flow_dist.b, extra_flow_dist.c - -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Result + Output: ((SubPlan 1)) + Filter: (((SubPlan 1)) < '01-01-2010'::date) + -> Seq Scan on subselect_gp.extra_flow_rand + Output: (SubPlan 1) + SubPlan 1 + -> Result + Output: extra_flow_dist.c + Filter: (extra_flow_dist.b = extra_flow_rand.a) + -> Materialize Output: extra_flow_dist.b, extra_flow_dist.c - -> Seq Scan on subselect_gp.extra_flow_dist + -> Broadcast Motion 3:3 (slice2; segments: 3) Output: extra_flow_dist.b, extra_flow_dist.c + -> Seq Scan on subselect_gp.extra_flow_dist + Output: extra_flow_dist.b, extra_flow_dist.c Optimizer: Pivotal Optimizer (GPORCA) (23 rows) @@ -3414,3 +3416,137 @@ drop table sublink_outer_table; drop table sublink_inner_table; reset optimizer; reset enable_hashagg; +-- Ensure sub-queries with order by outer reference can be decorrelated and executed correctly. +create table r(a int, b int, c int) distributed by (a); +create table s(a int, b int, c int) distributed by (a); +insert into r values (1,2,3); +insert into s values (1,2,10); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +select * from r where b in (select b from s where c=10 order by r.c); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c limit 2); + QUERY PLAN +------------------------------------------------------------ + Hash Semi Join + Hash Cond: (r.b = s.b) + -> Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on r + -> Hash + -> Limit + -> Gather Motion 3:1 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(10 rows) + +select * from r where b in (select b from s where c=10 order by r.c limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +select * from r where b in (select b from s where c=10 order by r.c, b); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b limit 2); + QUERY PLAN +------------------------------------------------------------ + Hash Semi Join + Hash Cond: (r.b = s.b) + -> Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on r + -> Hash + -> Limit + -> Gather Motion 3:1 (slice2; segments: 3) + Merge Key: s.b + -> Sort + Sort Key: s.b + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(13 rows) + +select * from r where b in (select b from s where c=10 order by r.c, b limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by c); + QUERY PLAN +--------------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Hash Semi Join + Hash Cond: (r.b = s.b) + -> Seq Scan on r + -> Hash + -> Broadcast Motion 3:3 (slice2; segments: 3) + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(9 rows) + +select * from r where b in (select b from s where c=10 order by c); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + +explain (costs off) select * from r where b in (select b from s where c=10 order by c limit 2); + QUERY PLAN +------------------------------------------------------------ + Hash Semi Join + Hash Cond: (r.b = s.b) + -> Gather Motion 3:1 (slice1; segments: 3) + -> Seq Scan on r + -> Hash + -> Limit + -> Gather Motion 3:1 (slice2; segments: 3) + Merge Key: s.c + -> Sort + Sort Key: s.c + -> Seq Scan on s + Filter: (c = 10) + Optimizer: Pivotal Optimizer (GPORCA) +(13 rows) + +select * from r where b in (select b from s where c=10 order by c limit 2); + a | b | c +---+---+--- + 1 | 2 | 3 +(1 row) + diff --git a/src/test/regress/expected/subselect_optimizer.out b/src/test/regress/expected/subselect_optimizer.out index 53e6fa4781c..bc15d008067 100644 --- a/src/test/regress/expected/subselect_optimizer.out +++ b/src/test/regress/expected/subselect_optimizer.out @@ -262,16 +262,19 @@ select 1 = all (select (select 1)); Join Filter: true -> Result Output: true - -> Nested Loop Left Join + -> Materialize Output: (1) - Join Filter: true - -> Result - Output: true - -> Result - Output: 1 + -> Nested Loop Left Join + Output: (1) + Join Filter: true + -> Result + Output: true + -> Materialize + Output: (1) + -> Result + Output: 1 Optimizer: Pivotal Optimizer (GPORCA) - Settings: optimizer=on -(14 rows) +(17 rows) select 1 = all (select (select 1)); ?column? @@ -1315,22 +1318,24 @@ select * from (3 not in (select * from (values (1), (2)) ss1)), (false) ) ss; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Append -> Nested Loop Left Join Output: ((CASE WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (3 IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END) = true) Join Filter: true -> Result Output: true - -> Aggregate - Output: CASE WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (3 IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END - -> Values Scan on "Values" - Output: CASE WHEN (3 = column1) THEN 1 ELSE 0 END, CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END + -> Materialize + Output: (CASE WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (3 IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END) + -> Aggregate + Output: CASE WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) IS NULL) THEN true WHEN (sum((CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END)) > '0'::bigint) THEN NULL::boolean WHEN (3 IS NULL) THEN NULL::boolean WHEN (sum((CASE WHEN (3 = column1) THEN 1 ELSE 0 END)) = '0'::bigint) THEN true ELSE false END + -> Values Scan on "Values" + Output: CASE WHEN (3 = column1) THEN 1 ELSE 0 END, CASE WHEN (column1 IS NULL) THEN 1 ELSE 0 END -> Result Output: false Optimizer: Pivotal Optimizer (GPORCA) -(13 rows) +(15 rows) select * from (values diff --git a/src/test/regress/expected/tpch500GB.out b/src/test/regress/expected/tpch500GB.out index 7a36575cfba..49e9040904e 100755 --- a/src/test/regress/expected/tpch500GB.out +++ b/src/test/regress/expected/tpch500GB.out @@ -2005,7 +2005,7 @@ order by -> Unique (cost=78801360.21..78983928.42 rows=18256821 width=22) Group By: orders.ctid -> Sort (cost=78801360.21..78892644.32 rows=18256821 width=22) - Sort Key (Distinct): orders.ctid + Sort Key: orders.ctid -> Hash Join (cost=14835362.82..71460313.52 rows=18256821 width=22) Hash Cond: lineitem.l_orderkey = orders.o_orderkey -> Seq Scan on lineitem (cost=0.00..51767512.60 rows=489638315 width=8) diff --git a/src/test/regress/expected/tsearch_optimizer.out b/src/test/regress/expected/tsearch_optimizer.out index 428dcd8aa29..1381b7c5ca2 100644 --- a/src/test/regress/expected/tsearch_optimizer.out +++ b/src/test/regress/expected/tsearch_optimizer.out @@ -2389,9 +2389,10 @@ select * from test_tsquery, to_tsquery('new') q where txtsample @@ q; -> Nested Loop Join Filter: (txtsample @@ ('''new'''::tsquery)) -> Seq Scan on test_tsquery - -> Result + -> Materialize + -> Result Optimizer: Pivotal Optimizer (GPORCA) -(6 rows) +(7 rows) -- to_tsquery(regconfig, text) is an immutable function. -- That allows us to get rid of using function scan and join at all. @@ -2403,9 +2404,10 @@ select * from test_tsquery, to_tsquery('english', 'new') q where txtsample @@ q; -> Nested Loop Join Filter: (txtsample @@ ('''new'''::tsquery)) -> Seq Scan on test_tsquery - -> Result + -> Materialize + -> Result Optimizer: Pivotal Optimizer (GPORCA) -(6 rows) +(7 rows) -- test finding items in GIN's pending list create temp table pendtest (ts tsvector); diff --git a/src/test/regress/expected/updatable_views_optimizer.out b/src/test/regress/expected/updatable_views_optimizer.out index 4f7e45cad06..ae7141c517c 100644 --- a/src/test/regress/expected/updatable_views_optimizer.out +++ b/src/test/regress/expected/updatable_views_optimizer.out @@ -432,9 +432,9 @@ EXPLAIN (costs off) UPDATE rw_view1 SET a=6 WHERE a=5; -> Sort Sort Key: (DMLAction) -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: base_tbl_1.a + Hash Key: a -> Split - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: ((a = 5) AND (a > 0)) Optimizer: Pivotal Optimizer (GPORCA) (12 rows) @@ -443,7 +443,7 @@ EXPLAIN (costs off) DELETE FROM rw_view1 WHERE a=5; QUERY PLAN ------------------------------------------------------------- Delete on base_tbl - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: ((a = 5) AND (a > 0)) Optimizer: Pivotal Optimizer (GPORCA) (4 rows) @@ -526,8 +526,8 @@ SELECT * FROM rw_view2; (3 rows) EXPLAIN (costs off) UPDATE rw_view2 SET aaa=5 WHERE aaa=4; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Update on base_tbl -> Result One-Time Filter: true @@ -535,18 +535,18 @@ EXPLAIN (costs off) UPDATE rw_view2 SET aaa=5 WHERE aaa=4; -> Sort Sort Key: (DMLAction) -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: base_tbl_1.a + Hash Key: a -> Split - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: ((a = 4) AND (a < 10) AND (a > 0)) Optimizer: Pivotal Optimizer (GPORCA) -(10 rows) +(12 rows) EXPLAIN (costs off) DELETE FROM rw_view2 WHERE aaa=4; QUERY PLAN ------------------------------------------------------------- Delete on base_tbl - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: ((a = 4) AND (a < 10) AND (a > 0)) Optimizer: Pivotal Optimizer (GPORCA) (4 rows) @@ -733,13 +733,13 @@ EXPLAIN (costs off) UPDATE rw_view2 SET a=3 WHERE a=2; ------------------------------------------------------------------------------- Update on base_tbl -> Hash Join - Hash Cond: (base_tbl_1.a = base_tbl_2.a) - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + Hash Cond: (base_tbl.a = base_tbl_1.a) + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: (a = 2) -> Hash -> Result - Filter: ((base_tbl_2.a = 2) AND (base_tbl_2.a < 10)) - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_2 + Filter: ((base_tbl_1.a = 2) AND (base_tbl_1.a < 10)) + -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 Index Cond: (a > 0) Optimizer: Pivotal Optimizer (GPORCA) (11 rows) @@ -749,13 +749,13 @@ EXPLAIN (costs off) DELETE FROM rw_view2 WHERE a=2; ------------------------------------------------------------------------------- Delete on base_tbl -> Hash Join - Hash Cond: (base_tbl_1.a = base_tbl_2.a) - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 + Hash Cond: (base_tbl.a = base_tbl_1.a) + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: (a = 2) -> Hash -> Result - Filter: ((base_tbl_2.a = 2) AND (base_tbl_2.a < 10)) - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_2 + Filter: ((base_tbl_1.a = 2) AND (base_tbl_1.a < 10)) + -> Index Scan using base_tbl_pkey on base_tbl base_tbl_1 Index Cond: (a > 0) Optimizer: Pivotal Optimizer (GPORCA) (11 rows) @@ -2343,7 +2343,7 @@ EXPLAIN (costs off) INSERT INTO rw_view1 VALUES (2, 'New row 2'); Update on base_tbl -> Nested Loop Semi Join Join Filter: true - -> Index Scan using base_tbl_pkey on base_tbl base_tbl_2 + -> Index Scan using base_tbl_pkey on base_tbl Index Cond: (id = 2) -> Materialize -> Broadcast Motion 1:3 (slice1; segments: 1) diff --git a/src/test/regress/expected/update_gp_optimizer.out b/src/test/regress/expected/update_gp_optimizer.out index ee83cebb0b1..9b66b994432 100644 --- a/src/test/regress/expected/update_gp_optimizer.out +++ b/src/test/regress/expected/update_gp_optimizer.out @@ -126,14 +126,14 @@ WHERE t1.user_vie_project_code_pk = keo1.user_vie_project_code_pk; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on keo1 -> Hash Join - Hash Cond: ((keo1_1.user_vie_project_code_pk)::text = (keo1_2.user_vie_project_code_pk)::text) - -> Seq Scan on keo1 keo1_1 + Hash Cond: ((keo1.user_vie_project_code_pk)::text = (keo1_1.user_vie_project_code_pk)::text) + -> Seq Scan on keo1 -> Hash -> Broadcast Motion 3:3 (slice1; segments: 3) -> Hash Join - Hash Cond: ((keo1_2.user_vie_project_code_pk)::text = (keo2.projects_pk)::text) + Hash Cond: ((keo1_1.user_vie_project_code_pk)::text = (keo2.projects_pk)::text) -> Hash Join - Hash Cond: ((max((keo3.sky_per)::text)) = (keo1_2.user_vie_fiscal_year_period_sk)::text) + Hash Cond: ((max((keo3.sky_per)::text)) = (keo1_1.user_vie_fiscal_year_period_sk)::text) -> Redistribute Motion 1:3 (slice2; segments: 1) -> Aggregate -> Hash Join @@ -156,7 +156,7 @@ WHERE t1.user_vie_project_code_pk = keo1.user_vie_project_code_pk; -> Seq Scan on keo4 keo4_1 -> Hash -> Broadcast Motion 3:3 (slice8; segments: 3) - -> Seq Scan on keo1 keo1_2 + -> Seq Scan on keo1 keo1_1 -> Hash -> Broadcast Motion 3:3 (slice9; segments: 3) -> Seq Scan on keo2 @@ -186,17 +186,17 @@ EXPLAIN (COSTS OFF) DELETE FROM keo5 WHERE x IN (SELECT x FROM keo5 WHERE EXISTS ------------------------------------------------------------------------------------ Delete on keo5 -> Hash Semi Join - Hash Cond: (keo5_1.x = keo5_3.x) - -> Seq Scan on keo5 keo5_1 + Hash Cond: (keo5.x = keo5_2.x) + -> Seq Scan on keo5 -> Hash -> Nested Loop Semi Join Join Filter: true - -> Seq Scan on keo5 keo5_3 + -> Seq Scan on keo5 keo5_2 -> Materialize -> Broadcast Motion 1:3 (slice1; segments: 1) -> Limit -> Gather Motion 3:1 (slice2; segments: 3) - -> Seq Scan on keo5 keo5_2 + -> Seq Scan on keo5 keo5_1 Filter: (x < 2) Optimizer: Pivotal Optimizer (GPORCA) (15 rows) @@ -444,9 +444,9 @@ EXPLAIN (COSTS OFF ) UPDATE tab3 SET C1 = C1 + 1, C5 = C5+1; One-Time Filter: true -> Result -> Redistribute Motion 3:3 (slice1; segments: 3) - Hash Key: tab3_1.c1, tab3_1.c2, tab3_1.c3 + Hash Key: c1, c2, c3 -> Split - -> Seq Scan on tab3 tab3_1 + -> Seq Scan on tab3 Optimizer: Pivotal Optimizer (GPORCA) (9 rows) diff --git a/src/test/regress/expected/window_optimizer.out b/src/test/regress/expected/window_optimizer.out index 59c2635901b..1cafcebc08d 100644 --- a/src/test/regress/expected/window_optimizer.out +++ b/src/test/regress/expected/window_optimizer.out @@ -3218,7 +3218,7 @@ SELECT * FROM WHERE depname = 'sales'; QUERY PLAN --------------------------------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> WindowAgg Partition By: (((depname)::text || 'A'::text)), depname -> Sort @@ -3297,7 +3297,7 @@ SELECT * FROM WHERE depname = 'sales'; QUERY PLAN --------------------------------------------------------------------------- - Gather Motion 3:1 (slice1; segments: 3) + Gather Motion 1:1 (slice1; segments: 1) -> WindowAgg Partition By: depname, empno Order By: enroll_date diff --git a/src/test/regress/sql/bfv_joins.sql b/src/test/regress/sql/bfv_joins.sql index d15f03b4f0b..2b1cdcea508 100644 --- a/src/test/regress/sql/bfv_joins.sql +++ b/src/test/regress/sql/bfv_joins.sql @@ -434,6 +434,75 @@ explain select * from o1 left join o2 on a1 = a2 left join o3 on a2 is not disti explain select * from o1 left join o2 on a1 = a2 left join o3 on a2 is not distinct from a3 and b2 is distinct from b3; explain select * from o1 left join o2 on a1 = a2 left join o3 on a2 is not distinct from a3 and b2 = b3; +-- Test case from community Github PR 13722 +-- CBDB_CHERRYPICK_FIXME: PG optimizer will got a assert false case. +-- create table t_13722(id int, tt timestamp) +-- distributed by (id); + +-- j->jointype == join_lasj_notin +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- t1.id not in (select id from t_13722 where id != 4) +-- and +-- t1.tt = (select min(tt) from t_13722 where id = t1.id); + +-- j->jointype == join_anti +-- select +-- t1.* +-- from +-- t_13722 t1 +-- where +-- not exists (select id from t_13722 where id != 4 and id = t1.id) +-- and t1.tt = (select min(tt) from t_13722 where id = t1.id); + +-- drop table t_13722; + +-- This test is introduced to verify incorrect result +-- from hash join of char columns is fixed +-- Notice when varchar/text is cast to bpchar and used for +-- comparison, the trailing spaces are ignored +-- When char is cast to varchar/text, it's considered +-- comparison, and the trailing spaces are also ignored + +-- Prior to the fix, opclasses belonging to different +-- opfamilies could be grouped as equivalent, and thence +-- deriving incorrect equality hash join conditions + +--start_ignore +drop table foo; +drop table bar; +drop table baz; +--end_ignore +create table foo (varchar_3 varchar(3)) distributed by (varchar_3); +create table bar (char_3 char(3)) distributed by (char_3); +create table baz (text_any text) distributed by (text_any); +insert into foo values ('cd'); -- 0 trailing spaces +insert into bar values ('cd '); -- 1 trailing space +insert into baz values ('cd '); -- 2 trailing spaces + +-- varchar cast to bpchar +-- 'cd' matches 'cd', returns 1 row +explain select varchar_3, char_3 from foo join bar on varchar_3=char_3; +select varchar_3, char_3 from foo join bar on varchar_3=char_3; + +-- char cast to text +-- 'cd' doesn't match 'cd ', returns 0 rows +explain select char_3, text_any from bar join baz on char_3=text_any; +select char_3, text_any from bar join baz on char_3=text_any; + +-- foo - bar join: varchar cast to bpchar +-- 'cd' matches 'cd' +-- foo - baz join: no cast +-- 'cd' doesn't match 'cd ' +-- returns 0 rows +-- Notice ORCA changes join order to minimize motion +explain select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; +select varchar_3, char_3, text_any from foo join bar on varchar_3=char_3 +join baz on varchar_3=text_any; -- Clean up. None of the objects we create are very interesting to keep around. reset search_path; diff --git a/src/test/regress/sql/direct_dispatch.sql b/src/test/regress/sql/direct_dispatch.sql index ab8bafafff0..0ad061fb367 100644 --- a/src/test/regress/sql/direct_dispatch.sql +++ b/src/test/regress/sql/direct_dispatch.sql @@ -293,6 +293,48 @@ execute p3(1); execute p3(1); drop table test_prepare; +-- Tests to check direct dispatch if the table is randomly distributed and the +-- filter has condition on gp_segment_id + +-- NOTE: Only EXPLAIN query included, output of SELECT query is not shown. +-- Since the table is distributed randomly, the output of SELECT query +-- will differ everytime new table is created, and hence the during comparision +-- the tests will fail. + +drop table if exists bar_randDistr; +create table bar_randDistr(col1 int, col2 int) distributed randomly; +insert into bar_randDistr select i,i*2 from generate_series(1, 10)i; + +-- Case 1 : simple conditions on gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0; +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or gp_segment_id=2; +explain (costs off) select gp_segment_id, count(*) from bar_randDistr group by gp_segment_id; + +-- Case2: Conjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=0 and col1 between 1 and 10; + +-- Case3: Disjunction scenario with filter condition on gp_segment_id and column +explain (costs off) select gp_segment_id, * from bar_randDistr where gp_segment_id=1 or (col1=6 and gp_segment_id=2); + +-- Case4: Scenario with constant/variable column and constant/variable gp_segment_id +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id in (0,1); +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 =3 and gp_segment_id <>1; +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 between 1 and 5 and gp_segment_id =0; +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id <> 0; +explain (costs off) select gp_segment_id, * from bar_randDistr where col1 in (1,5) and gp_segment_id in (0,1); + +-- Case5: Scenarios with special conditions +create function afunc() returns integer as $$ begin return 42; end; $$ language plpgsql; +create function immutable_func() returns integer as $$ begin return 42; end; $$ language plpgsql immutable; + +explain (costs off) select * from bar_randDistr where col1 = 1; +explain (costs off) select * from bar_randDistr where gp_segment_id % 2 = 0; +explain (costs off) select * from bar_randDistr where gp_segment_id=immutable_func(); +explain (costs off) select * from bar_randDistr where gp_segment_id=afunc(); + +drop table if exists bar_randDistr; + + -- test direct dispatch via gp_segment_id qual create table t_test_dd_via_segid(id int); insert into t_test_dd_via_segid select * from generate_series(1, 6); @@ -349,6 +391,88 @@ select gp_segment_id, * from t_test_dd_via_segid_conj where a in (1,3) and gp_se explain (costs off) select gp_segment_id, * from t_test_dd_via_segid_conj where a in (1,3) and gp_segment_id in (0,1); select gp_segment_id, * from t_test_dd_via_segid_conj where a in (1,3) and gp_segment_id in (0,1); +--test direct dispatch if distribution column is of varchar type +drop table if exists t1_varchar; +create table t1_varchar(col1_varchar varchar, col2_int int); +insert into t1_varchar values ('a',1); +insert into t1_varchar values ('b',2); +insert into t1_varchar values ('c',3); +insert into t1_varchar values ('d',4); +insert into t1_varchar values ('e',5); +insert into t1_varchar values ('97',6); + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'; + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; +select gp_segment_id, * from t1_varchar where col1_varchar <>'c'; + +--test direct dispatch if distribution column is of varchar type and disjunction scenario +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); +select gp_segment_id, * from t1_varchar where col1_varchar in ('a','b'); + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' or col1_varchar = 'b'; + +--test direct dispatch if distribution column is of varchar type, having disjunction condition +-- or an additional conjunction constraint using another table column or both +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; +select gp_segment_id, * from t1_varchar where col1_varchar = 'c' and col2_int=3; + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int in (1,3); + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); +select gp_segment_id, * from t1_varchar where col1_varchar = 'a' and col2_int not in (2,3); + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; +select gp_segment_id, * from t1_varchar where col1_varchar in ('a', 'b') and col2_int=2; + +explain (costs off) select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; +select gp_segment_id, * from t1_varchar where (col1_varchar = 'a' or col1_varchar = 'b') and col2_int=1; + +--Test direct dispatch with explicit typecasting +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; +select gp_segment_id, * from t1_varchar where col1_varchar = 97::VARCHAR; + +-- explicit cast using "char", generates a scenario of cast function from Dist Colm to datum in CTranslatorExprToDXLUtils::FDirectDispatchable(,,) +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; +select gp_segment_id, * from t1_varchar where col1_varchar = 'c'::char; + +explain (costs off) select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; +select gp_segment_id, * from t1_varchar where col1_varchar = '2'::char; + +--No direct dispatch case, scenario: cast exists but not binary coercible +drop table if exists t3; +create table t3 (c1 timestamp without time zone); +insert into t3 values ('2015-07-03 00:00:00'::timestamp without time zone); + +explain (costs off) select c1 from t3 where c1 = '2015-07-03'::date; +select c1 from t3 where c1 = '2015-07-03'::date; + +drop table t3; +drop table t1_varchar; + +--check direct dispatch working based on the distribution policy of relation +drop extension if exists citext cascade; +drop table if exists srt_dd; +CREATE EXTENSION citext; +create table srt_dd (name CITEXT); +INSERT INTO srt_dd (name) +VALUES ('abb'), + ('ABA'), + ('ABC'), + ('abd'); + +explain (costs off) select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; +select LOWER(name) as aba FROM srt_dd WHERE name = 'ABA'::text; + +explain (costs off) delete from srt_dd where name='ABA'::text; +delete from srt_dd where name='ABA'::text; + +drop extension if exists citext cascade; +drop table if exists srt_dd; + -- test direct dispatch via SQLValueFunction and FuncExpr for single row insertion. create table t_sql_value_function1 (a int, b date); create table t_sql_value_function2 (a date); @@ -475,6 +599,7 @@ set allow_system_table_mods=off; -- If opno of clause does not belong to opfamily of distributed key, -- do not use direct dispatch to resolve wrong result -- FIXME: orca still has wrong results +-- CBDB_MERGE_FIXME: known ORCA direct dispatch BUG create table t_14887(a varchar); insert into t_14887 values('a '); explain select * from t_14887 where a = 'a'::bpchar; diff --git a/src/test/regress/sql/gporca.sql b/src/test/regress/sql/gporca.sql index b28146c8abf..2d45be27750 100644 --- a/src/test/regress/sql/gporca.sql +++ b/src/test/regress/sql/gporca.sql @@ -2671,7 +2671,6 @@ insert into tcorr2 values (1,1); analyze tcorr1; analyze tcorr2; -set optimizer_trace_fallback to on; explain select * @@ -2816,7 +2815,6 @@ analyze tbitmap; set optimizer_join_order = query; set optimizer_enable_hashjoin = off; set optimizer_enable_groupagg = off; -set optimizer_trace_fallback = on; set enable_sort = off; -- 1 simple btree @@ -2926,7 +2924,6 @@ select count(*), t2.c from roj1 t1 left join roj2 t2 on t1.a = t2.c group by t2. explain (costs off) select count(*), t2.c from roj1 t1 left join roj2 t2 on t1.a = t2.c group by t2.c; reset optimizer_enable_motion_redistribute; -reset optimizer_trace_fallback; reset enable_sort; -- simple check for btree indexes on AO tables @@ -2952,7 +2949,6 @@ analyze t_ao_btree; analyze tpart_ao_btree; analyze tpart_dim; -set optimizer_trace_fallback to on; set optimizer_enable_hashjoin to off; -- this should use a bitmap scan on the btree index @@ -2986,11 +2982,9 @@ select enable_xform('CXformInnerJoin2NLJoin'); -- end_ignore reset optimizer_enable_hashjoin; -reset optimizer_trace_fallback; -- Tests converted from MDPs that use tables partitioned on text columns and similar types, -- which can't be handled in ORCA MDPs, since they would require calling the GPDB executor -set optimizer_trace_fallback = on; -- GroupingOnSameTblCol-2.mdp -- from dxl @@ -3236,7 +3230,6 @@ with v(year) as ( select 2019::int) select * from v where year > 1; -reset optimizer_trace_fallback; create table sqall_t1(a int) distributed by (a); insert into sqall_t1 values (1), (2), (3); @@ -3367,7 +3360,6 @@ reset statement_timeout; -- an agg of a non-SRF with a nested SRF should be treated as a SRF, the -- optimizer must not eliminate the SRF or it can produce incorrect results -set optimizer_trace_fallback = on; create table nested_srf(a text); insert into nested_srf values ('abc,def,ghi'); @@ -3387,7 +3379,6 @@ insert into nested_srf values (NULL); select * from (select trim(regexp_split_to_table((a)::text, ','::text)) from nested_srf)a; select count(*) from (select trim(regexp_split_to_table((a)::text, ','::text)) from nested_srf)a; -reset optimizer_trace_fallback; --- if the inner child is already distributed on the join column, orca should --- not place any motion on the inner child CREATE TABLE tone (a int, b int, c int); @@ -3589,14 +3580,20 @@ select c from mix_func_cast(); drop table if exists empty_cte_tl_test; create table empty_cte_tl_test(id int); -set optimizer_trace_fallback = on; with cte as ( select from empty_cte_tl_test ) select * from empty_cte_tl_test where id in(select id from cte); -reset optimizer_trace_fallback; + +-- test that we use default cardinality estimate (40) for non-comparable types +create table ts_tbl (ts timestamp); +create index ts_tbl_idx on ts_tbl(ts); +insert into ts_tbl select to_timestamp('99991231'::text, 'YYYYMMDD'::text) from generate_series(1,100); +analyze ts_tbl; +explain select * from ts_tbl where ts = to_timestamp('99991231'::text, 'YYYYMMDD'::text); + WITH conf AS ( SELECT setting @@ -3604,6 +3601,7 @@ WITH conf AS ( WHERE name = 'LDFLAGS_EX') select * from conf; +reset optimizer_trace_fallback; -- start_ignore DROP SCHEMA orca CASCADE; -- end_ignore diff --git a/src/test/regress/sql/qp_orca_fallback.sql b/src/test/regress/sql/qp_orca_fallback.sql index d25436e090e..f31be1997f9 100644 --- a/src/test/regress/sql/qp_orca_fallback.sql +++ b/src/test/regress/sql/qp_orca_fallback.sql @@ -103,6 +103,9 @@ set optimizer_enable_hashagg = off; set optimizer_enable_groupagg = off; explain select count(*) from foo group by a; +-- Orca should fallback for RTE_TABLEFUNC RTE type +explain SELECT * FROM xmltable('/root' passing '' COLUMNS element text); + create table ext_part(a int) partition by list(a); create table p1(a int); create external web table p2_ext (like p1) EXECUTE 'cat something.txt' FORMAT 'TEXT'; diff --git a/src/test/regress/sql/subselect_gp.sql b/src/test/regress/sql/subselect_gp.sql index b8ba35930b1..9efd19f2bee 100644 --- a/src/test/regress/sql/subselect_gp.sql +++ b/src/test/regress/sql/subselect_gp.sql @@ -1319,3 +1319,21 @@ drop table sublink_outer_table; drop table sublink_inner_table; reset optimizer; reset enable_hashagg; + +-- Ensure sub-queries with order by outer reference can be decorrelated and executed correctly. +create table r(a int, b int, c int) distributed by (a); +create table s(a int, b int, c int) distributed by (a); +insert into r values (1,2,3); +insert into s values (1,2,10); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c); +select * from r where b in (select b from s where c=10 order by r.c); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c limit 2); +select * from r where b in (select b from s where c=10 order by r.c limit 2); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b); +select * from r where b in (select b from s where c=10 order by r.c, b); +explain (costs off) select * from r where b in (select b from s where c=10 order by r.c, b limit 2); +select * from r where b in (select b from s where c=10 order by r.c, b limit 2); +explain (costs off) select * from r where b in (select b from s where c=10 order by c); +select * from r where b in (select b from s where c=10 order by c); +explain (costs off) select * from r where b in (select b from s where c=10 order by c limit 2); +select * from r where b in (select b from s where c=10 order by c limit 2);