提交 6133a493 编写于 作者: H Heikki Linnakangas

Fix test case to pass with ORCA.

The explain plan with ORCA spells Seq Scan as Table Scan. Add alternative
expected output for that.
上级 c47ad451
-- Helper function, to return the EXPLAIN ANALYZE output of a query as a normal
-- result set, so that you can manipulate it further.
create or replace function get_explain_output(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute 'EXPLAIN ANALYZE ' || explain_query
loop
return next explainrow;
end loop;
end;
$$ language plpgsql;
--
-- Test explain_memory_verbosity option
--
CREATE TABLE explaintest (id int4);
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.
INSERT INTO explaintest SELECT generate_series(1, 10);
EXPLAIN ANALYZE SELECT * FROM explaintest;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=10 width=4)
Rows out: 10 rows at destination with 0.412 ms to first row, 0.425 ms to end, start offset by 0.288 ms.
-> Table Scan on explaintest (cost=0.00..431.00 rows=4 width=4)
Rows out: Avg 3.3 rows x 3 workers. Max 5 rows (seg1) with 0.021 ms to first row, 0.023 ms to end, start offset by 0.607 ms.
Slice statistics:
(slice0) Executor memory: 318K bytes.
(slice1) Executor memory: 50K bytes avg x 3 workers, 50K bytes max (seg0).
Statement statistics:
Memory used: 128000K bytes
Settings: optimizer=on
Optimizer status: PQO version 2.5.0
Total runtime: 1.269 ms
(12 rows)
set explain_memory_verbosity='summary';
-- The plan should consist of a Gather and a Seq Scan, with a
-- "Memory: ..." line on both nodes.
SELECT COUNT(*) from
get_explain_output($$
SELECT * FROM explaintest;
$$) as et
WHERE et like '%Memory: %';
count
-------
2
(1 row)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册