提交 214d418b 编写于 作者: J Joao Pereira

Tests for Explain and Explain analyze with the output XML and JSON

Add other variables fields
Add explain test to the parallel group for GreenPlum
Add optimizer tests
上级 d39ff53e
此差异已折叠。
......@@ -25,7 +25,7 @@ test: spi_processed64bit
test: python_processed64bit
test: leastsquares opr_sanity_gp decode_expr bitmapscan bitmapscan_ao case_gp limit_gp notin percentile join_gp union_gp gpcopy gp_create_table gp_create_view window_views
test: filter gpctas gpdist matrix toast sublink table_functions olap_setup complex opclass_ddl information_schema guc_env_var guc_gp gp_explain distributed_transactions
test: filter gpctas gpdist matrix toast sublink table_functions olap_setup complex opclass_ddl information_schema guc_env_var guc_gp gp_explain distributed_transactions explain_format
test: bitmap_index gp_dump_query_oids analyze gp_owner_permission incremental_analyze
test: indexjoin as_alias regex_gp gpparams with_clause transient_types gp_rules
......
......@@ -16,11 +16,97 @@ CREATE TABLE apples(id int PRIMARY KEY, type text);
CREATE TABLE locations(id int PRIMARY KEY, address text);
CREATE TABLE boxes(id int PRIMARY KEY, apple_id int REFERENCES apples(id), location_id int REFERENCES locations(id));
--- Check Explain Text output
--- Check Explain Text format output
-- explain_processing_off
EXPLAIN SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
--- Check Explain Analyze Text output
--- Check Explain Analyze Text output that include the slices information
-- explain_processing_off
EXPLAIN (ANALYZE) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
-- YAML Required replaces for costs and time changes
-- start_matchsubs
-- m/ Loops: \d+ /
-- s/ Loops: \d+\s+/ Loops: # /
-- m/ Cost: \d+\.\d+ /
-- s/ Cost: \d+\.\d+\s+/ Cost: ###.## /
-- m/ Rows: \d+ /
-- s/ Rows: \d+\s+/ Rows: ##### /
-- m/ Plan Width: \d+ /
-- s/ Plan Width: \d+\s+/ Plan Width: ## /
-- m/ Time: \d+\.\d+ /
-- s/ Time: \d+\.\d+\s+/ Time: ##.### /
-- m/Total Runtime: \d+\.\d+/
-- s/Total Runtime: \d+\.\d+/Total Runtime: ##.###/
-- m/Segments: \d+\s+/
-- s/Segments: \d+\s+/Segments: #/
-- m/PQO version \d+\.\d+\.\d+"\s+/
-- s/PQO version \d+\.\d+\.\d+"\s+/PQO version ##.##.##"/
-- end_matchsubs
-- Check Explain YAML output
EXPLAIN (FORMAT YAML) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
--- Check Explain Analyze YAML output that include the slices information
-- explain_processing_off
EXPLAIN (ANALYZE, FORMAT YAML) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
-- JSON Required replaces for costs and time changes
-- start_matchsubs
-- m/ Loops": \d+,?\s+/
-- s/ Loops": \d+,?\s+/ Loops": #, /
-- m/ Cost": \d+\.\d+, /
-- s/ Cost": \d+\.\d+,\s+/ Cost": ###.##, /
-- m/ Rows": \d+, /
-- s/ Rows": \d+,\s+/ Rows": #####, /
-- m/"Plan Width": \d+,? /
-- s/"Plan Width": \d+,?\s+/"Plan Width": ##, /
-- m/ Time": \d+\.\d+, /
-- s/ Time": \d+\.\d+,\s+/ Time": ##.###, /
-- m/Total Runtime": \d+\.\d+,?\s+/
-- s/Total Runtime": \d+\.\d+,?\s+/Total Runtime": ##.###,/
-- m/"Memory used": \d+,?\s+/
-- s/"Memory used": \d+,?\s+/"Memory used": ####,/
-- m/"Segments": \d+,\s+/
-- s/"Segments": \d+,\s+/"Segments": #,/
-- end_matchsubs
-- explain_processing_off
-- Check Explain JSON output
EXPLAIN (FORMAT JSON) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
--- Check Explain Analyze JSON output that include the slices information
-- explain_processing_off
EXPLAIN (ANALYZE, FORMAT JSON) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
-- XML Required replaces for costs and time changes
-- start_matchsubs
-- m/Cost>\d+\.\d+<\/[^>]+\-Cost>\s+/
-- s/Cost>\d+\.\d+<\/([^>]+)\-Cost>\s+/Cost>###.##<\/$1-Cost>/
-- m/Plan-Rows>\d+<\/Plan-Rows>\s+/
-- s/Plan-Rows>\d+<\/Plan-Rows>\s+/Plan-Rows>###<\/Plan-Rows>/
-- m/Plan-Width>\d+<\/Plan-Width>\s+/
-- s/Plan-Width>\d+<\/Plan-Width>\s+/Plan-Width>###<\/Plan-Width>/
-- m/Segments>\d+<\/Segments>\s+/
-- s/Segments>\d+<\/Segments>\s+/Segments>##<\/Segments>/
-- m/-Time>\d+\.\d+<\/[^>]+\-Time>\s+/
-- s/-Time>\d+\.\d+<\/([^>]+)\-Time>\s+/-Time>##.###<\/$1-Time>/
-- m/Total-Runtime>\d+\.\d+<\/Total-Runtime>\s+/
-- s/Total-Runtime>\d+\.\d+<\/Total-Runtime>\s+/Total-Runtime>##.###<\/Total-Runtime>/
-- m/Memory-used>\d+<\/Memory-used>\s+/
-- s/Memory-used>\d+<\/Memory-used>\s+/Memory-used>###<\/Memory-used>/
-- m/PQO version \d+\.\d+\.\d+/
-- s/PQO version \d+\.\d+\.\d+/PQO version ##.##.##/
-- end_matchsubs
-- explain_processing_off
-- Check Explain XML output
EXPLAIN (FORMAT XML) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
-- explain_processing_off
-- Check Explain Analyze XML output
EXPLAIN (ANALYZE, FORMAT XML) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN locations ON locations.id = boxes.location_id;
-- explain_processing_on
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册