-- pg_orca default init file for gpdiff.pl
--
-- Format: SQL-style comments containing perl regex operators.
-- Use -- start_matchsubs / -- end_matchsubs blocks for line substitutions.
-- Use -- start_matchignore / -- end_matchignore blocks for lines to drop.
--
-- To activate: pass --init-file=test/init_file to test.sh,
-- or set GPD_INIT_FILES=test/init_file before running.

-- start_matchsubs
--
-- # GROUP BY CUBE/ROLLUP with a partial ORDER BY produces non-deterministic
-- # secondary row ordering from MixedAggregate hash tables.  Append
-- # "-- order none" so atmsort sorts all result rows before comparing.
-- m/FROM few GROUP BY CUBE\(.*?\) ORDER BY \S+;$/
-- s/(FROM few GROUP BY CUBE\(.*?\) ORDER BY \S+;)$/$1 -- order none/
--
-- # Normalize EXPLAIN cost estimates so plan-shape tests are cost-agnostic.
-- # Uncomment to enable:
-- # m/\(cost=[\d.]+\.\.[\d.]+\s+rows=\d+\s+width=\d+\)/
-- # s/\(cost=[\d.]+\.\.[\d.]+\s+rows=\d+\s+width=\d+\)/(cost=###..### rows=### width=###)/g
--
-- # Normalize actual timing from EXPLAIN ANALYZE:
-- # m/actual time=[\d.]+\.\.[\d.]+\s+rows=\d+\s+loops=\d+/
-- # s/actual time=[\d.]+\.\.[\d.]+\s+rows=\d+\s+loops=\d+/actual time=###..### rows=### loops=###/g
--
-- # Normalize Planning/Execution Time lines:
-- # m/^(?:Planning|Execution) Time: [\d.]+ ms/
-- # s/^((?:Planning|Execution) Time): [\d.]+ ms$/$1: ### ms/
--
--
-- # ORCA does not inline SQL SRFs, so error context says "statement 1"
-- # instead of "during inlining". Normalize to the ORCA form.
-- m/CONTEXT:.*SQL function .* during inlining/
-- s/during inlining/statement 1/
--
-- end_matchsubs

-- start_matchignore
--
-- # Ignore "Optimizer: ..." lines in EXPLAIN output when ORCA is active.
-- m/^ Optimizer: pg_orca/
--
--
-- # ORCA does not push outer quals below the view's own filter, so snoop()
-- # is never evaluated on private rows (e.g. 'Dick' with visibility='private').
-- # The standard planner leaks this via low-COST predicate reordering;
-- # ORCA's conservative pushdown is actually safer. Ignore the extra NOTICE.
-- m/^NOTICE:  snooped value: Dick$/
--
-- # For mixed DISTINCT/non-DISTINCT aggregates that cannot share transition
-- # state, ORCA processes each aggregate in a separate pass rather than
-- # interleaving row-by-row.  The NOTICE count is correct; only the
-- # per-row ordering differs.  Ignore these transfn NOTICEs so the diff
-- # focuses on result correctness, not call ordering.
-- m/^NOTICE:  avg_transfn called with /
-- m/^NOTICE:  sum_transfn called with /
--
-- end_matchignore
