Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
87c2e27
Enhancement: skip redundant part-prop requests
yjhjstz Oct 13, 2026
54cf3f4
Enhancement: reuse child contexts of a request
yjhjstz Oct 15, 2026
e33f99e
fix(orca): never build index conditions on INCLUDE-only index columns
yjhjstz Sep 3, 2026
99fa673
test: pin index-only scan choice in memoize expr_key case for ORCA
yjhjstz Sep 4, 2026
d54c268
fix(orca): keep INCLUDE columns in the bitmap index width comparison
yjhjstz Oct 21, 2026
89eb1e7
Trace per-node buffer accesses for EXPLAIN (ANALYZE, BUFFERS)
Waloid24 Oct 26, 2026
1480f4f
interconnect: prune cursor IC history table by local xid, not distrib…
yjhjstz Sep 3, 2026
18cbbcc
Drop unused variable in extended_protocol_resqueue
tuhaihe Oct 27, 2026
8782ef0
Fix MERGE into replicated tables
roseduan Nov 9, 2026
f589c2b
Keep backend headers out of frontend src/common
tuhaihe Oct 27, 2026
f2ad06b
Let an extension share runtime information between QEs
leborchuk Oct 15, 2026
ddcd2e9
Feature: Anser runtime filters for hash joins
leborchuk Oct 15, 2026
b4d32b8
Export Anser's C API and rework the filter pushdown
leborchuk Oct 15, 2026
c6e6461
Fix four ways Anser could drop rows or hang a session
leborchuk Oct 15, 2026
1f9ab15
Fix Anser defects found in review and CI
leborchuk Oct 16, 2026
da37b64
Fix recycling connections with unflushed output
leborchuk Nov 2, 2026
c7c58ac
Rework Anser delivery into NEXT-driven chunks
leborchuk Nov 2, 2026
6592d64
Feature: RPT+ transfer-plan analysis extension
leborchuk Oct 23, 2026
7906766
Fix RPT transfer planning and error handling
leborchuk Nov 9, 2026
840adb9
Feature: Add RPT backward eligibility survey
leborchuk Nov 10, 2026
05c12ee
Feature: Prepare RPT forward InitPlan construction
leborchuk Nov 10, 2026
439272d
Feature: Execute RPT forward reducer InitPlans
leborchuk Nov 10, 2026
50ee54c
Fix RPT key safety, walkers and regression tests
leborchuk Nov 12, 2026
c0e3637
Feature: Inject RPT backward runtime filters
leborchuk Nov 13, 2026
eb8fd7b
Fix RPT installcheck test-extension dependency
leborchuk Nov 13, 2026
532164f
Fix RPT graph pruning and regression fixtures
leborchuk Nov 13, 2026
3f19233
Enhancement: Simplify RPT controls and examples
leborchuk Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build-cloudberry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ jobs:
"make_configs":["src/test/regress:installcheck-good"],
"pg_settings":{"optimizer":"on"}
},
{"test":"ic-anser",
"make_configs":["gpcontrib/anser:installcheck-with-install"]
},
{"test":"ic-rpt",
"make_configs":["gpcontrib/robust_predicate_transfer:installcheck-with-install"]
},
{"test":"pax-ic-good-opt-off",
"make_configs":[
"contrib/pax_storage/:pax-test",
Expand Down
6 changes: 6 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ The PostgreSQL software includes:
contrib/pgcrypto/imath.c
see licenses/LICENSE-imath.txt

RPT+ transfer-graph code adapted from dynamic-predicate-transfer:
gpcontrib/robust_predicate_transfer/include/rpt.h
gpcontrib/robust_predicate_transfer/src/rptgraph.cpp
gpcontrib/robust_predicate_transfer/src/rptplan.cpp
see licenses/LICENSE-mit-duckdb-rpt.txt

----------------------------
Apache License v2.0 with LLVM Exceptions

Expand Down
9 changes: 9 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ This product includes software originally developed by VMware.

Greenplum Database
Copyright (c) 2004-2020 VMware, Inc. or its affiliates. All Rights Reserved.

---------------------------------------------------------------------------

This product includes RPT+ transfer-graph code in
gpcontrib/robust_predicate_transfer adapted from the
dynamic-predicate-transfer artifact:
https://github.com/embryo-labs/dynamic-predicate-transfer

Copyright 2018-2025 Stichting DuckDB Foundation
68 changes: 68 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ GCOV
enable_debug
enable_orafce
enable_faultinjector
with_rpt
with_anser
enable_debug_extensions
enable_gpfdist
enable_strong_random
Expand Down Expand Up @@ -889,6 +891,8 @@ enable_atomics
enable_strong_random
enable_gpfdist
enable_debug_extensions
with_anser
with_rpt
enable_faultinjector
enable_orafce
enable_debug
Expand Down Expand Up @@ -1657,6 +1661,9 @@ Optional Packages:
--with-libraries=DIRS look for additional libraries in DIRS
--with-libs=DIRS alternative spelling of --with-libraries
--with-pgport=PORTNUM set default port number [5432]
--with-anser build the Anser runtime-filter extension
--with-rpt build the RPT+ transfer-plan extension (requires
--with-anser)
--with-blocksize=BLOCKSIZE
set table block size in kB [8]
--with-segsize=SEGSIZE set table segment size in GB [1]
Expand Down Expand Up @@ -3597,6 +3604,67 @@ fi



#
# Anser adaptive information sharing (runtime filters)
#



# Check whether --with-anser was given.
if test "${with_anser+set}" = set; then :
withval=$with_anser;
case $withval in
yes)
:
;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --with-anser option" "$LINENO" 5
;;
esac

else
with_anser=no

fi




#
# Robust predicate transfer (RPT+ over Anser)
#



# Check whether --with-rpt was given.
if test "${with_rpt+set}" = set; then :
withval=$with_rpt;
case $withval in
yes)
:
;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --with-rpt option" "$LINENO" 5
;;
esac

else
with_rpt=no

fi



if test "$with_rpt" = yes && test "$with_anser" != yes; then
as_fn_error $? "--with-rpt requires --with-anser" "$LINENO" 5
fi

#
# Enable fault injector
#
Expand Down
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,23 @@ PGAC_ARG_BOOL(enable, debug-extensions, yes,
[exclude debug extensions in gpcontrib])
AC_SUBST(enable_debug_extensions)

#
# Anser adaptive information sharing (runtime filters)
#
PGAC_ARG_BOOL(with, anser, no,
[build the Anser runtime-filter extension])
AC_SUBST(with_anser)

#
# Robust predicate transfer (RPT+ over Anser)
#
PGAC_ARG_BOOL(with, rpt, no,
[build the RPT+ transfer-plan extension (requires --with-anser)])
AC_SUBST(with_rpt)
if test "$with_rpt" = yes && test "$with_anser" != yes; then
AC_MSG_ERROR([--with-rpt requires --with-anser])
fi

#
# Enable fault injector
#
Expand Down
32 changes: 17 additions & 15 deletions contrib/interconnect/udp/ic_udpifc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "nodes/pg_list.h"
#include "nodes/print.h"
#include "miscadmin.h"
#include "storage/proc.h"
#include "libpq/libpq-be.h"
#include "port/atomics.h"
#include "port/pg_crc32c.h"
Expand Down Expand Up @@ -353,11 +354,18 @@ struct ReceiveControlInfo
CursorICHistoryTable cursorHistoryTable;

/*
* Last distributed transaction id when SetupUDPInterconnect is called.
* Coupled with cursorHistoryTable, it is used to handle multiple
* concurrent cursor cases.
* Local (virtual) transaction id of the top-level transaction the last
* time SetupUDPInterconnect was called. Coupled with cursorHistoryTable,
* it is used to handle multiple concurrent cursor cases: entries may only
* be pruned once we are in a different transaction.
*
* We deliberately use MyProc->lxid rather than the distributed xid: a
* distributed xid is only assigned lazily to transactions that write (or
* are dispatched two-phase), so for autocommit read-only statements it is
* always InvalidDistributedTransactionId and the "different transaction"
* test would never fire, letting the history table grow without bound.
*/
DistributedTransactionId lastDXatId;
LocalTransactionId lastLxid;
};

/*
Expand Down Expand Up @@ -1892,7 +1900,7 @@ InitMotionUDPIFC(int *listenerSocketFd, int32 *listenerPort)

/* allocate a buffer for sending disorder messages */
rx_control_info.disorderBuffer = palloc0(MIN_PACKET_SIZE);
rx_control_info.lastDXatId = InvalidTransactionId;
rx_control_info.lastLxid = InvalidLocalTransactionId;
rx_control_info.lastTornIcId = 0;
initCursorICHistoryTable(&rx_control_info.cursorHistoryTable);

Expand Down Expand Up @@ -3571,19 +3579,13 @@ SetupUDPIFCInterconnect_Internal(SliceTable *sliceTable)

if (Gp_role == GP_ROLE_DISPATCH)
{
DistributedTransactionId distTransId = 0;
TransactionId localTransId = 0;
TransactionId subtransId = 0;

GetAllTransactionXids(&(distTransId),
&(localTransId),
&(subtransId));
LocalTransactionId curLxid = MyProc->lxid;

/*
* Prune only when we are not in the save transaction and there is a
* Prune only when we are not in the same transaction and there is a
* large number of entries in the table
*/
if (distTransId != rx_control_info.lastDXatId && rx_control_info.cursorHistoryTable.count > (2 * CURSOR_IC_TABLE_SIZE))
if (curLxid != rx_control_info.lastLxid && rx_control_info.cursorHistoryTable.count > (2 * CURSOR_IC_TABLE_SIZE))
{
if (gp_log_interconnect >= GPVARS_VERBOSITY_DEBUG)
elog(DEBUG1, "prune cursor history table (count %d), icid %d", rx_control_info.cursorHistoryTable.count, sliceTable->ic_instance_id);
Expand All @@ -3593,7 +3595,7 @@ SetupUDPIFCInterconnect_Internal(SliceTable *sliceTable)
addCursorIcEntry(&rx_control_info.cursorHistoryTable, sliceTable->ic_instance_id, gp_command_count);

/* save the latest transaction id. */
rx_control_info.lastDXatId = distTransId;
rx_control_info.lastLxid = curLxid;
}

/* now we'll do some setup for each of our Receiving Motion Nodes. */
Expand Down
40 changes: 40 additions & 0 deletions contrib/pax_storage/src/test/regress/expected/gp_explain.out
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ begin
end loop;
end;
$$ language plpgsql;
-- Run EXPLAIN ANALYZE BUFFERS, preserving the positions of buffer statistics
create or replace function explain_buffers_filter(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute
'EXPLAIN (ANALYZE, BUFFERS, COSTS OFF, TIMING OFF, SUMMARY OFF) ' || explain_query
loop
if explainrow ~ '^\s*Buffers:' then
explainrow := regexp_replace(explainrow, 'Buffers:.*$', 'Buffers: N');
else
explainrow := regexp_replace(explainrow,
'\m\d+([kK]B?)\M', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'\m\d+(x)', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'-?\m\d+\M', 'N', 'g');
end if;
return next explainrow;
end loop;
end;
$$ language plpgsql;
-- Test explain wal option
CREATE TABLE explainwal (id int4);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Apache Cloudberry data distribution key for this table.
Expand Down Expand Up @@ -104,6 +127,23 @@ NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' a
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
INSERT INTO explaintest SELECT generate_series(1, 10);
ANALYZE explaintest;
-- Compare normalized buffer placement
-- explain_processing_off
SELECT plan_line
FROM explain_buffers_filter($$
SELECT * FROM explaintest;
$$) WITH ORDINALITY AS plan(plan_line, line_number)
ORDER BY line_number;
plan_line
------------------------------------------------------------------
Gather Motion N:N (slice1; segments: N) (actual rows=N loops=N)
-> Seq Scan on explaintest (actual rows=N loops=N)
Buffers: N
Planning:
Buffers: N
Optimizer: Postgres query optimizer
(6 rows)

EXPLAIN ANALYZE SELECT * FROM explaintest;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ begin
end loop;
end;
$$ language plpgsql;
-- Run EXPLAIN ANALYZE BUFFERS, preserving the positions of buffer statistics
create or replace function explain_buffers_filter(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute
'EXPLAIN (ANALYZE, BUFFERS, COSTS OFF, TIMING OFF, SUMMARY OFF) ' || explain_query
loop
if explainrow ~ '^\s*Buffers:' then
explainrow := regexp_replace(explainrow, 'Buffers:.*$', 'Buffers: N');
else
explainrow := regexp_replace(explainrow,
'\m\d+([kK]B?)\M', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'\m\d+(x)', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'-?\m\d+\M', 'N', 'g');
end if;
return next explainrow;
end loop;
end;
$$ language plpgsql;
-- Test explain wal option
CREATE TABLE explainwal (id int4);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Apache Cloudberry data distribution key for this table.
Expand Down Expand Up @@ -104,6 +127,23 @@ NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' a
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
INSERT INTO explaintest SELECT generate_series(1, 10);
ANALYZE explaintest;
-- Compare normalized buffer placement
-- explain_processing_off
SELECT plan_line
FROM explain_buffers_filter($$
SELECT * FROM explaintest;
$$) WITH ORDINALITY AS plan(plan_line, line_number)
ORDER BY line_number;
plan_line
------------------------------------------------------------------
Gather Motion N:N (slice1; segments: N) (actual rows=N loops=N)
-> Seq Scan on explaintest (actual rows=N loops=N)
Buffers: N
Planning:
Buffers: N
Optimizer: GPORCA
(6 rows)

EXPLAIN ANALYZE SELECT * FROM explaintest;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------
Expand Down
32 changes: 32 additions & 0 deletions contrib/pax_storage/src/test/regress/sql/gp_explain.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@ begin
end;
$$ language plpgsql;

-- Run EXPLAIN ANALYZE BUFFERS, preserving the positions of buffer statistics
create or replace function explain_buffers_filter(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute
'EXPLAIN (ANALYZE, BUFFERS, COSTS OFF, TIMING OFF, SUMMARY OFF) ' || explain_query
loop
if explainrow ~ '^\s*Buffers:' then
explainrow := regexp_replace(explainrow, 'Buffers:.*$', 'Buffers: N');
else
explainrow := regexp_replace(explainrow,
'\m\d+([kK]B?)\M', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'\m\d+(x)', 'N\1', 'g');
explainrow := regexp_replace(explainrow,
'-?\m\d+\M', 'N', 'g');
end if;
return next explainrow;
end loop;
end;
$$ language plpgsql;

-- Test explain wal option
CREATE TABLE explainwal (id int4);

Expand Down Expand Up @@ -94,6 +118,14 @@ CREATE TABLE explaintest (id int4);
INSERT INTO explaintest SELECT generate_series(1, 10);
ANALYZE explaintest;

-- Compare normalized buffer placement
-- explain_processing_off
SELECT plan_line
FROM explain_buffers_filter($$
SELECT * FROM explaintest;
$$) WITH ORDINALITY AS plan(plan_line, line_number)
ORDER BY line_number;

EXPLAIN ANALYZE SELECT * FROM explaintest;

set explain_memory_verbosity='summary';
Expand Down
Loading