Skip to content

Commit 6dfc433

Browse files
committed
Align scan terminology: Shared Scan and ShareInputScan.
The plan node appears as 'Shared Scan' in user's EXPLAIN output, while internally it's represented as ShareInputScan type. Most codes use the correct terms, but some places incorrectly mix: - 'shared input scan' in codebase (should be 'ShareInputScan') - 'Share Scan' in EXPLAIN (should be 'Shared Scan') This change aligns all usage while preserving existing correct references. Authored-by: Zhang Mingli [email protected]
1 parent 8b01eaf commit 6dfc433

File tree

23 files changed

+64
-64
lines changed

23 files changed

+64
-64
lines changed

contrib/pax_storage/src/test/regress/expected/qp_with_clause.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11089,7 +11089,7 @@ ORDER BY 1, 2, 3, 4 DESC LIMIT 25;
1108911089
35NAME | 7 | 5NAME | 1
1109011090
(25 rows)
1109111091

11092-
-- Test that SharedInputScan within the same slice is always executed
11092+
-- Test that ShareInputScan within the same slice is always executed
1109311093
set gp_cte_sharing=on;
1109411094
-- start_ignore
1109511095
CREATE TABLE car (a int, b int);

contrib/pax_storage/src/test/regress/expected/query_finish_pending.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ select gp_inject_fault('execsort_sort_bounded_heap', 'status', 2);
9292

9393
(1 row)
9494

95-
-- test if shared input scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
95+
-- test if Share Input Scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
9696
-- where the child is a Sort node
9797
drop table if exists testsisc;
9898
NOTICE: table "testsisc" does not exist, skipping
@@ -104,7 +104,7 @@ insert into testsisc select i, i % 1000, i % 100000, i % 75 from
104104
(select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar;
105105
set gp_resqueue_print_operator_memory_limits=on;
106106
set statement_mem='2MB';
107-
-- ORCA does not generate SharedInputScan with a Sort node underneath it. For
107+
-- ORCA does not generate ShareInputScan with a Sort node underneath it. For
108108
-- the following query, ORCA disregards the order by inside the cte definition;
109109
-- planner on the other hand does not.
110110
set optimizer=off;
@@ -114,8 +114,8 @@ select gp_inject_fault('execshare_input_next', 'reset', 2);
114114
Success:
115115
(1 row)
116116

117-
-- Set QueryFinishPending to true after SharedInputScan has retrieved the first tuple.
118-
-- This will eagerly free the memory context of shared input scan's child node.
117+
-- Set QueryFinishPending to true after ShareInputScan has retrieved the first tuple.
118+
-- This will eagerly free the memory context of Share Input Scan's child node.
119119
select gp_inject_fault('execshare_input_next', 'finish_pending', 2);
120120
gp_inject_fault
121121
-----------------
@@ -137,16 +137,16 @@ select gp_inject_fault('execshare_input_next', 'status', 2);
137137

138138
(1 row)
139139

140-
-- test if shared input scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
140+
-- test if Share Input Scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
141141
-- where the child is a Sort node and sort_mk algorithm is used
142142
select gp_inject_fault('execshare_input_next', 'reset', 2);
143143
gp_inject_fault
144144
-----------------
145145
Success:
146146
(1 row)
147147

148-
-- Set QueryFinishPending to true after SharedInputScan has retrieved the first tuple.
149-
-- This will eagerly free the memory context of shared input scan's child node.
148+
-- Set QueryFinishPending to true after ShareInputScan has retrieved the first tuple.
149+
-- This will eagerly free the memory context of Share Input Scan's child node.
150150
select gp_inject_fault('execshare_input_next', 'finish_pending', 2);
151151
gp_inject_fault
152152
-----------------

contrib/pax_storage/src/test/regress/input/temp_tablespaces.source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CREATE TABLE tts_foo (i int, j int) distributed by(i);
4545
insert into tts_foo select i, i from generate_series(1,80000)i;
4646
ANALYZE tts_foo;
4747
set gp_cte_sharing=on;
48-
-- CBDB_PARALLEL_FIXME: since we disabled shared input scan in parallel mode, sisc_xslice_temp_files
48+
-- CBDB_PARALLEL_FIXME: since we disabled Share Input Scan in parallel mode, sisc_xslice_temp_files
4949
-- will never be triggered. We need set max_parallel_workers_per_gather to 0 in this case.
5050
set max_parallel_workers_per_gather = 0;
5151

contrib/pax_storage/src/test/regress/output/temp_tablespaces.source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CREATE TABLE tts_foo (i int, j int) distributed by(i);
5656
insert into tts_foo select i, i from generate_series(1,80000)i;
5757
ANALYZE tts_foo;
5858
set gp_cte_sharing=on;
59-
-- CBDB_PARALLEL_FIXME: since we disabled shared input scan in parallel mode, sisc_xslice_temp_files
59+
-- CBDB_PARALLEL_FIXME: since we disabled Share Input Scan in parallel mode, sisc_xslice_temp_files
6060
-- will never be triggered. We need set max_parallel_workers_per_gather to 0 in this case.
6161
set max_parallel_workers_per_gather = 0;
6262
-- CASE 1: when temp_tablespaces is set, hashagg and share-input-scan

contrib/pax_storage/src/test/regress/sql/qp_with_clause.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10329,7 +10329,7 @@ WHERE e.deptno = dc1.deptno AND
1032910329
m.deptno = dmc1.dept_mgr_no
1033010330
ORDER BY 1, 2, 3, 4 DESC LIMIT 25;
1033110331

10332-
-- Test that SharedInputScan within the same slice is always executed
10332+
-- Test that ShareInputScan within the same slice is always executed
1033310333
set gp_cte_sharing=on;
1033410334

1033510335
-- start_ignore

contrib/pax_storage/src/test/regress/sql/query_finish_pending.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ reset enable_parallel;
3838

3939
select gp_inject_fault('execsort_sort_bounded_heap', 'status', 2);
4040

41-
-- test if shared input scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
41+
-- test if Share Input Scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
4242
-- where the child is a Sort node
4343
drop table if exists testsisc;
4444
create table testsisc (i1 int, i2 int, i3 int, i4 int);
@@ -48,13 +48,13 @@ insert into testsisc select i, i % 1000, i % 100000, i % 75 from
4848

4949
set gp_resqueue_print_operator_memory_limits=on;
5050
set statement_mem='2MB';
51-
-- ORCA does not generate SharedInputScan with a Sort node underneath it. For
51+
-- ORCA does not generate ShareInputScan with a Sort node underneath it. For
5252
-- the following query, ORCA disregards the order by inside the cte definition;
5353
-- planner on the other hand does not.
5454
set optimizer=off;
5555
select gp_inject_fault('execshare_input_next', 'reset', 2);
56-
-- Set QueryFinishPending to true after SharedInputScan has retrieved the first tuple.
57-
-- This will eagerly free the memory context of shared input scan's child node.
56+
-- Set QueryFinishPending to true after ShareInputScan has retrieved the first tuple.
57+
-- This will eagerly free the memory context of Share Input Scan's child node.
5858
select gp_inject_fault('execshare_input_next', 'finish_pending', 2);
5959

6060
set enable_parallel = off;
@@ -64,13 +64,13 @@ select * from cte c1, cte c2 limit 2;
6464

6565
select gp_inject_fault('execshare_input_next', 'status', 2);
6666

67-
-- test if shared input scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
67+
-- test if Share Input Scan deletes memory correctly when QueryFinishPending and its child has been eagerly freed,
6868
-- where the child is a Sort node and sort_mk algorithm is used
6969

7070

7171
select gp_inject_fault('execshare_input_next', 'reset', 2);
72-
-- Set QueryFinishPending to true after SharedInputScan has retrieved the first tuple.
73-
-- This will eagerly free the memory context of shared input scan's child node.
72+
-- Set QueryFinishPending to true after ShareInputScan has retrieved the first tuple.
73+
-- This will eagerly free the memory context of Share Input Scan's child node.
7474
select gp_inject_fault('execshare_input_next', 'finish_pending', 2);
7575

7676
with cte as (select i2 from testsisc order by i2)

src/backend/cdb/cdbmutate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,8 @@ shareinput_peekmot(ApplyShareInputContext *ctxt)
825825
* plan.
826826
*
827827
* To work around that issue, create a CTE for each shared input node, with
828-
* columns that match the target list of the SharedInputScan's subplan,
829-
* and replace the target list entries of the SharedInputScan with
828+
* columns that match the target list of the ShareInputScan's subplan,
829+
* and replace the target list entries of the ShareInputScan with
830830
* Vars that point to the CTE instead of the child plan.
831831
*/
832832
Plan *
@@ -893,8 +893,8 @@ replace_shareinput_targetlists_walker(Node *node, PlannerInfo *root, bool fPop)
893893
/*
894894
* Replace all the target list entries.
895895
*
896-
* SharedInputScan nodes are not projection-capable, so the target
897-
* list of the SharedInputScan matches the subplan's target list.
896+
* ShareInputScan nodes are not projection-capable, so the target
897+
* list of the ShareInputScan matches the subplan's target list.
898898
*/
899899
newtargetlist = NIL;
900900
attno = 1;

src/backend/executor/nodeShareInputScan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
/*
7777
* In a cross-slice ShareinputScan, the producer and consumer processes
7878
* communicate using shared memory. There's a hash table containing one
79-
* 'shareinput_share_state' for each in-progress shared input scan.
79+
* 'shareinput_share_state' for each in-progress Share Input Scan.
8080
*
8181
* The hash table itself,, and the fields within every entry, are protected
8282
* by ShareInputScanLock. (Although some operations get away without the
@@ -631,11 +631,11 @@ ExecSquelchShareInputScan(ShareInputScanState *node, bool force)
631631
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
632632

633633
/*
634-
* If this SharedInputScan is shared within the same slice then its
634+
* If this ShareInputScan is shared within the same slice then its
635635
* subtree may still need to be executed and the motions in the subtree
636636
* cannot yet be stopped. Thus, don't recurse in this case.
637637
*
638-
* In squelching a cross-slice SharedInputScan writer, we need to ensure
638+
* In squelching a cross-slice ShareInputScan writer, we need to ensure
639639
* we don't block any reader on other slices as a result of not
640640
* materializing the shared plan.
641641
*

src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4210,7 +4210,7 @@ CTranslatorDXLToPlStmt::TranslateDXLCTEProducerToSharedScan(
42104210
CDXLPhysicalCTEProducer::Cast(cte_producer_dxlnode->GetOperator());
42114211
ULONG cte_id = cte_prod_dxlop->Id();
42124212

4213-
// create the shared input scan representing the CTE Producer
4213+
// create the Share Input Scan representing the CTE Producer
42144214
ShareInputScan *shared_input_scan = MakeNode(ShareInputScan);
42154215
shared_input_scan->share_id = cte_id;
42164216
shared_input_scan->discard_output = true;

src/backend/gporca/libgpopt/src/translate/CTranslatorDXLToExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void CTranslatorDXLToExpr::PruneCTEs()
367367
poper->RecalOutputColumns(umask, pprgpcrsz);
368368

369369
// Align consumer and producer output columns.
370-
// In fact, we can support the column projection in consumer(SharedInputScan).
370+
// In fact, we can support the column projection in consumer(ShareInputScan).
371371
// However, non-requested columns in consumer(which from producer) may be added to the consumer,
372372
// which will make the plan for consumer(support projection) very complicated.
373373
//

0 commit comments

Comments
 (0)