diff --git a/pg15_tests/passing_tests.tsv b/pg15_tests/passing_tests.tsv index ca88b46f2b8f..a4438041a707 100644 --- a/pg15_tests/passing_tests.tsv +++ b/pg15_tests/passing_tests.tsv @@ -16,11 +16,12 @@ JAVA org.yb.pgsql.TestPgCacheConsistency#testCatalogVersionLogging JAVA org.yb.pgsql.TestPgConfiguration JAVA org.yb.pgsql.TestPgConnection JAVA org.yb.pgsql.TestPgConnection#testConnectionKillsAndRestarts -JAVA org.yb.pgsql.TestPgCostModelSeekNextEstimation#testSeekNextEstimationBitmapScan +JAVA org.yb.pgsql.TestPgCostModelSeekNextEstimation JAVA org.yb.pgsql.TestPgDepend#testForSuperfluousEntries JAVA org.yb.pgsql.TestPgDepend#testSequenceDeletionWithCascade JAVA org.yb.pgsql.TestPgDepend#testTableWithSequenceDeletion JAVA org.yb.pgsql.TestPgDepend#testViewDeletionWithCascade +JAVA org.yb.pgsql.TestPgExplainAnalyze JAVA org.yb.pgsql.TestPgExplainAnalyzeColocated JAVA org.yb.pgsql.TestPgExplainAnalyzeMetrics JAVA org.yb.pgsql.TestPgExplainAnalyzeScans#testFetchLimitCosting @@ -87,6 +88,7 @@ JAVA org.yb.pgsql.TestPgRegressPushdown#testPgRegressPushdown JAVA org.yb.pgsql.TestPgRegressPushdownKey JAVA org.yb.pgsql.TestPgRegressReplicaIdentity JAVA org.yb.pgsql.TestPgRegressReplicationSlot#testPgRegressReplicationSlot +JAVA org.yb.pgsql.TestPgRegressTAQO JAVA org.yb.pgsql.TestPgRegressTable JAVA org.yb.pgsql.TestPgRegressTablegroup JAVA org.yb.pgsql.TestPgRegressTabletSplit diff --git a/pg15_tests/test_D35351.sh b/pg15_tests/test_D35351.sh new file mode 100644 index 000000000000..055d654e9089 --- /dev/null +++ b/pg15_tests/test_D35351.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +source "${BASH_SOURCE[0]%/*}"/common.sh + +failing_java_test TestPgRegressParallel +grep_in_java_test \ + "Failed tests: [yb_select_parallel]" \ + TestPgRegressParallel + +failing_java_test TestPgRegressPlanner +grep_in_java_test \ + "Failed tests: [yb_planner_size_estimates]" \ + TestPgRegressPlanner diff --git a/src/postgres/src/backend/optimizer/path/costsize.c b/src/postgres/src/backend/optimizer/path/costsize.c index 4f0c6cc01984..8d71a3444f80 100644 --- a/src/postgres/src/backend/optimizer/path/costsize.c +++ b/src/postgres/src/backend/optimizer/path/costsize.c @@ -7578,11 +7578,6 @@ void yb_cost_index(IndexPath *path, PlannerInfo *root, double loop_count, bool partial_path) { -#ifdef YB_TODO - /* - * Gaurav: this function needs changes to work with pg15. Particularly, - * deconstruct_indexquals no longer exists - */ IndexOptInfo *index = path->indexinfo; Relation index_rel = RelationIdGetRelation(path->indexinfo->indexoid); bool is_primary_index = index_rel->rd_index->indisprimary; @@ -7600,7 +7595,6 @@ yb_cost_index(IndexPath *path, PlannerInfo *root, double loop_count, List *index_conditions; int index_col; ListCell *lc; - ListCell *lci; RangeTblEntry *rte; Oid baserel_oid; int32 index_tuple_width; @@ -7714,10 +7708,12 @@ yb_cost_index(IndexPath *path, PlannerInfo *root, double loop_count, index_conditions_on_each_column = palloc0(sizeof(List*) * index->nkeycolumns); index_conditions = NIL; index_col = 0; - forboth(lc, path->indexquals, lci, path->indexqualcols) + + foreach(lc, path->indexclauses) { - RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); - int index_qual_col = lfirst_int(lci); + IndexClause *iclause = lfirst_node(IndexClause, lc); + ListCell *lc2; + int index_qual_col = iclause->indexcol; while (index_col != index_qual_col) { @@ -7725,21 +7721,23 @@ yb_cost_index(IndexPath *path, PlannerInfo *root, double loop_count, Assert(index_col < index->nkeycolumns); } - if (path->path.param_info) + foreach (lc2, iclause->indexquals) { - Relids batched = YB_PATH_REQ_OUTER_BATCHED(&path->path); - RestrictInfo *batched_rinfo = yb_get_batched_restrictinfo( + RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc2); + if (path->path.param_info) + { + Relids batched = YB_PATH_REQ_OUTER_BATCHED(&path->path); + RestrictInfo *batched_rinfo = yb_get_batched_restrictinfo( rinfo, batched, path->path.parent->relids); - if (batched_rinfo) + if (batched_rinfo) rinfo = batched_rinfo; + } + index_conditions_on_each_column[index_col] = + lappend(index_conditions_on_each_column[index_col], rinfo); + index_conditions = lappend(index_conditions, rinfo); } - - index_conditions_on_each_column[index_col] = - lappend(index_conditions_on_each_column[index_col], rinfo); - index_conditions = lappend(index_conditions, rinfo); } - bool yb_exist_conditions_on_all_hash_keys_ = yb_exist_conditions_on_all_hash_keys(index, index_conditions_on_each_column); @@ -8140,7 +8138,6 @@ yb_cost_index(IndexPath *path, PlannerInfo *root, double loop_count, path->path.startup_cost = startup_cost; path->path.total_cost = startup_cost + run_cost; yb_parallel_cost((Path *) path); -#endif } /* diff --git a/src/postgres/src/test/regress/expected/yb_parallel_append.out b/src/postgres/src/test/regress/expected/yb_parallel_append.out index abbde8c94779..a2e6e847f653 100644 --- a/src/postgres/src/test/regress/expected/yb_parallel_append.out +++ b/src/postgres/src/test/regress/expected/yb_parallel_append.out @@ -109,14 +109,14 @@ select * from t, t1 where t.k = t1.k union all select * from t, t2 where t.k = t -- partitioned table explain (costs off) select * from lp; - QUERY PLAN ------------------------------- + QUERY PLAN +----------------------------------- Append - -> Seq Scan on lp_ad - -> Seq Scan on lp_bc - -> Seq Scan on lp_ef - -> Seq Scan on lp_null - -> Seq Scan on lp_default + -> Seq Scan on lp_ad lp_1 + -> Seq Scan on lp_bc lp_2 + -> Seq Scan on lp_ef lp_3 + -> Seq Scan on lp_null lp_4 + -> Seq Scan on lp_default lp_5 (6 rows) select * from lp; @@ -192,14 +192,14 @@ select * from t, t1 where t.k = t1.k union all select * from t, t2 where t.k = t -- partitioned table explain (costs off) select * from lp; - QUERY PLAN ------------------------------------- + QUERY PLAN +----------------------------------------- Gather Workers Planned: 2 -> Parallel Append - -> Seq Scan on lp_ad - -> Seq Scan on lp_bc - -> Seq Scan on lp_ef - -> Seq Scan on lp_null - -> Seq Scan on lp_default + -> Seq Scan on lp_ad lp_1 + -> Seq Scan on lp_bc lp_2 + -> Seq Scan on lp_ef lp_3 + -> Seq Scan on lp_null lp_4 + -> Seq Scan on lp_default lp_5 (8 rows) diff --git a/src/postgres/src/test/regress/expected/yb_select_parallel.out b/src/postgres/src/test/regress/expected/yb_select_parallel.out index d3d72136bf8b..3e345b44ed8a 100644 --- a/src/postgres/src/test/regress/expected/yb_select_parallel.out +++ b/src/postgres/src/test/regress/expected/yb_select_parallel.out @@ -25,15 +25,15 @@ explain (costs off) ------------------------------------------------- Aggregate -> Append - -> Seq Scan on part_pa_test_p1 pa2 - -> Seq Scan on part_pa_test_p2 pa2_1 + -> Seq Scan on part_pa_test_p1 pa2_1 + -> Seq Scan on part_pa_test_p2 pa2_2 SubPlan 2 -> Result SubPlan 1 -> Append - -> Seq Scan on part_pa_test_p1 pa1 + -> Seq Scan on part_pa_test_p1 pa1_1 Storage Filter: (a = pa2.a) - -> Seq Scan on part_pa_test_p2 pa1_1 + -> Seq Scan on part_pa_test_p2 pa1_2 Storage Filter: (a = pa2.a) (12 rows)