7411 lines
356 KiB
Plaintext
7411 lines
356 KiB
Plaintext
-- ======================================================================================================================================
|
|
-- README: For details, see "postgres_fdw.sql".
|
|
-- This test case was written by us. Test for cstore.
|
|
-- ======================================================================================================================================
|
|
create database postgresfdw_test_db_cstore;
|
|
\c postgresfdw_test_db_cstore
|
|
set show_fdw_remote_plan = on;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: create FDW objects
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
CREATE EXTENSION postgres_fdw;
|
|
CREATE SERVER testserver1 FOREIGN DATA WRAPPER postgres_fdw;
|
|
DO $d$
|
|
BEGIN
|
|
EXECUTE $$CREATE SERVER loopback FOREIGN DATA WRAPPER postgres_fdw
|
|
OPTIONS (dbname '$$||current_database()||$$',
|
|
port '$$||current_setting('port')||$$'
|
|
)$$;
|
|
EXECUTE $$CREATE SERVER loopback2 FOREIGN DATA WRAPPER postgres_fdw
|
|
OPTIONS (dbname '$$||current_database()||$$',
|
|
port '$$||current_setting('port')||$$'
|
|
)$$;
|
|
EXECUTE $$CREATE SERVER loopback3 FOREIGN DATA WRAPPER postgres_fdw
|
|
OPTIONS (dbname '$$||current_database()||$$',
|
|
port '$$||current_setting('port')||$$'
|
|
)$$;
|
|
END;
|
|
$d$;
|
|
CREATE USER MAPPING FOR public SERVER testserver1
|
|
OPTIONS (user 'value', password 'value');
|
|
CREATE USER MAPPING FOR CURRENT_USER SERVER loopback;
|
|
CREATE USER MAPPING FOR CURRENT_USER SERVER loopback2;
|
|
CREATE USER MAPPING FOR public SERVER loopback3;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: create objects used through FDW loopback server
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
CREATE TYPE user_enum AS ENUM ('foo', 'bar', 'buz');
|
|
CREATE SCHEMA "S 1";
|
|
CREATE TABLE "S 1"."T 1" (
|
|
"C 1" int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text,
|
|
c4 timestamptz,
|
|
c5 timestamp,
|
|
c6 varchar(10),
|
|
c7 char(10),
|
|
c8 text,
|
|
CONSTRAINT t1_pkey PRIMARY KEY ("C 1")
|
|
) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "T 1"
|
|
CREATE TABLE "S 1"."T 2" (
|
|
c1 int NOT NULL,
|
|
c2 text,
|
|
CONSTRAINT t2_pkey PRIMARY KEY (c1)
|
|
) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "T 2"
|
|
CREATE TABLE "S 1"."T 3" (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text,
|
|
CONSTRAINT t3_pkey PRIMARY KEY (c1)
|
|
) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t3_pkey" for table "T 3"
|
|
CREATE TABLE "S 1"."T 4" (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text,
|
|
CONSTRAINT t4_pkey PRIMARY KEY (c1)
|
|
) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t4_pkey" for table "T 4"
|
|
-- Disable autovacuum for these tables to avoid unexpected effects of that
|
|
ALTER TABLE "S 1"."T 1" SET (autovacuum_enabled = 'false');
|
|
ALTER TABLE "S 1"."T 2" SET (autovacuum_enabled = 'false');
|
|
ALTER TABLE "S 1"."T 3" SET (autovacuum_enabled = 'false');
|
|
ALTER TABLE "S 1"."T 4" SET (autovacuum_enabled = 'false');
|
|
INSERT INTO "S 1"."T 1"
|
|
SELECT id,
|
|
id % 10,
|
|
to_char(id, 'FM00000'),
|
|
'1970-01-01'::timestamptz + ((id % 100) || ' days')::interval,
|
|
'1970-01-01'::timestamp + ((id % 100) || ' days')::interval,
|
|
id % 10,
|
|
id % 10,
|
|
'foo'::user_enum
|
|
FROM generate_series(1, 1000) id;
|
|
INSERT INTO "S 1"."T 2"
|
|
SELECT id,
|
|
'AAA' || to_char(id, 'FM000')
|
|
FROM generate_series(1, 100) id;
|
|
INSERT INTO "S 1"."T 3"
|
|
SELECT id,
|
|
id + 1,
|
|
'AAA' || to_char(id, 'FM000')
|
|
FROM generate_series(1, 100) id;
|
|
DELETE FROM "S 1"."T 3" WHERE c1 % 2 != 0; -- delete for outer join tests
|
|
INSERT INTO "S 1"."T 4"
|
|
SELECT id,
|
|
id + 1,
|
|
'AAA' || to_char(id, 'FM000')
|
|
FROM generate_series(1, 100) id;
|
|
DELETE FROM "S 1"."T 4" WHERE c1 % 3 != 0; -- delete for outer join tests
|
|
ANALYZE "S 1"."T 1";
|
|
ANALYZE "S 1"."T 2";
|
|
ANALYZE "S 1"."T 3";
|
|
ANALYZE "S 1"."T 4";
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: create foreign tables
|
|
-- --------------------------------------
|
|
--
|
|
-- ======================================================================================================================================
|
|
CREATE FOREIGN TABLE ft1 (
|
|
c0 int,
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text,
|
|
c4 timestamptz,
|
|
c5 timestamp,
|
|
c6 varchar(10),
|
|
c7 char(10) default 'ft1',
|
|
c8 user_enum
|
|
) SERVER loopback;
|
|
ALTER FOREIGN TABLE ft1 DROP COLUMN c0;
|
|
CREATE FOREIGN TABLE ft2 (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
cx int,
|
|
c3 text,
|
|
c4 timestamptz,
|
|
c5 timestamp,
|
|
c6 varchar(10),
|
|
c7 char(10) default 'ft2',
|
|
c8 user_enum
|
|
) SERVER loopback;
|
|
ALTER FOREIGN TABLE ft2 DROP COLUMN cx;
|
|
CREATE FOREIGN TABLE ft4 (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text
|
|
) SERVER loopback OPTIONS (schema_name 'S 1', table_name 'T 3');
|
|
CREATE FOREIGN TABLE ft5 (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text
|
|
) SERVER loopback OPTIONS (schema_name 'S 1', table_name 'T 4');
|
|
CREATE FOREIGN TABLE ft6 (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text
|
|
) SERVER loopback2 OPTIONS (schema_name 'S 1', table_name 'T 4');
|
|
CREATE FOREIGN TABLE ft7 (
|
|
c1 int NOT NULL,
|
|
c2 int NOT NULL,
|
|
c3 text
|
|
) SERVER loopback3 OPTIONS (schema_name 'S 1', table_name 'T 4');
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: tests for validator
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
-- requiressl and some other parameters are omitted because
|
|
-- valid values for them depend on configure options
|
|
ALTER SERVER testserver1 OPTIONS (
|
|
use_remote_estimate 'false',
|
|
updatable 'true',
|
|
fdw_startup_cost '123.456',
|
|
fdw_tuple_cost '0.123',
|
|
service 'value',
|
|
connect_timeout 'value',
|
|
dbname 'value',
|
|
host 'value',
|
|
hostaddr 'value',
|
|
port 'value',
|
|
application_name 'value',
|
|
keepalives 'value',
|
|
keepalives_idle 'value',
|
|
keepalives_interval 'value',
|
|
sslcompression 'value',
|
|
sslmode 'value',
|
|
sslcert 'value',
|
|
sslkey 'value',
|
|
sslrootcert 'value',
|
|
sslcrl 'value',
|
|
krbsrvname 'value'
|
|
);
|
|
ALTER FOREIGN TABLE ft1 OPTIONS (schema_name 'S 1', table_name 'T 1');
|
|
ALTER FOREIGN TABLE ft2 OPTIONS (schema_name 'S 1', table_name 'T 1');
|
|
ALTER FOREIGN TABLE ft1 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
|
|
ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
|
|
\det+
|
|
List of foreign tables
|
|
Schema | Table | Server | FDW Options | Description
|
|
--------+-------+-----------+---------------------------------------+-------------
|
|
public | ft1 | loopback | (schema_name 'S 1', table_name 'T 1') |
|
|
public | ft2 | loopback | (schema_name 'S 1', table_name 'T 1') |
|
|
public | ft4 | loopback | (schema_name 'S 1', table_name 'T 3') |
|
|
public | ft5 | loopback | (schema_name 'S 1', table_name 'T 4') |
|
|
public | ft6 | loopback2 | (schema_name 'S 1', table_name 'T 4') |
|
|
public | ft7 | loopback3 | (schema_name 'S 1', table_name 'T 4') |
|
|
(6 rows)
|
|
|
|
-- Now we should be able to run ANALYZE.
|
|
-- To exercise multiple code paths, we use local stats on ft1
|
|
-- and remote-estimate mode on ft2.
|
|
ANALYZE ft1;
|
|
ALTER FOREIGN TABLE ft2 OPTIONS (use_remote_estimate 'true');
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: simple queries
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
-- single table without alias
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c3 ASC NULLS LAST, "C 1" ASC NULLS LAST LIMIT 10::bigint OFFSET 100::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c3 ASC NULLS LAST, "C 1" ASC NULLS LAST LIMIT 10::bigint OFFSET 100::bigint
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Limit
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Sort
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Sort Key: "T 1".c3, "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(17 rows)
|
|
|
|
SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
-----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
101 | 1 | 00101 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
102 | 2 | 00102 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
103 | 3 | 00103 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
104 | 4 | 00104 | Mon Jan 05 00:00:00 1970 PST | Mon Jan 05 00:00:00 1970 | 4 | 4 | foo
|
|
105 | 5 | 00105 | Tue Jan 06 00:00:00 1970 PST | Tue Jan 06 00:00:00 1970 | 5 | 5 | foo
|
|
106 | 6 | 00106 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
107 | 7 | 00107 | Thu Jan 08 00:00:00 1970 PST | Thu Jan 08 00:00:00 1970 | 7 | 7 | foo
|
|
108 | 8 | 00108 | Fri Jan 09 00:00:00 1970 PST | Fri Jan 09 00:00:00 1970 | 8 | 8 | foo
|
|
109 | 9 | 00109 | Sat Jan 10 00:00:00 1970 PST | Sat Jan 10 00:00:00 1970 | 9 | 9 | foo
|
|
110 | 0 | 00110 | Sun Jan 11 00:00:00 1970 PST | Sun Jan 11 00:00:00 1970 | 0 | 0 | foo
|
|
(10 rows)
|
|
|
|
-- whole-row reference
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: t1.*, c3, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c3 ASC NULLS LAST, "C 1" ASC NULLS LAST LIMIT 10::bigint OFFSET 100::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c3 ASC NULLS LAST, "C 1" ASC NULLS LAST LIMIT 10::bigint OFFSET 100::bigint
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Limit
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Sort
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Sort Key: "T 1".c3, "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(17 rows)
|
|
|
|
SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
t1
|
|
--------------------------------------------------------------------------------------------
|
|
(101,1,00101,"Fri Jan 02 00:00:00 1970 PST","Fri Jan 02 00:00:00 1970",1,"1 ",foo)
|
|
(102,2,00102,"Sat Jan 03 00:00:00 1970 PST","Sat Jan 03 00:00:00 1970",2,"2 ",foo)
|
|
(103,3,00103,"Sun Jan 04 00:00:00 1970 PST","Sun Jan 04 00:00:00 1970",3,"3 ",foo)
|
|
(104,4,00104,"Mon Jan 05 00:00:00 1970 PST","Mon Jan 05 00:00:00 1970",4,"4 ",foo)
|
|
(105,5,00105,"Tue Jan 06 00:00:00 1970 PST","Tue Jan 06 00:00:00 1970",5,"5 ",foo)
|
|
(106,6,00106,"Wed Jan 07 00:00:00 1970 PST","Wed Jan 07 00:00:00 1970",6,"6 ",foo)
|
|
(107,7,00107,"Thu Jan 08 00:00:00 1970 PST","Thu Jan 08 00:00:00 1970",7,"7 ",foo)
|
|
(108,8,00108,"Fri Jan 09 00:00:00 1970 PST","Fri Jan 09 00:00:00 1970",8,"8 ",foo)
|
|
(109,9,00109,"Sat Jan 10 00:00:00 1970 PST","Sat Jan 10 00:00:00 1970",9,"9 ",foo)
|
|
(110,0,00110,"Sun Jan 11 00:00:00 1970 PST","Sun Jan 11 00:00:00 1970",0,"0 ",foo)
|
|
(10 rows)
|
|
|
|
-- empty result
|
|
SELECT * FROM ft1 WHERE false;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+----+----+----+----+----+----
|
|
(0 rows)
|
|
|
|
-- with WHERE clause
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1';
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c7 >= '1'::bpchar)) AND (("C 1" = 101)) AND ((c6 = '1'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c7 >= '1'::bpchar)) AND (("C 1" = 101)) AND ((c6 = '1'::text))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (("T 1".c7 >= '1'::bpchar) AND ("T 1"."C 1" = 101) AND (("T 1".c6)::text = '1'::text))
|
|
|
|
(13 rows)
|
|
|
|
SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1';
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
-----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
101 | 1 | 00101 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
-- with FOR UPDATE/SHARE
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.*
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 101)) FOR UPDATE
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 101)) FOR UPDATE
|
|
failed to get remote plan, error massage is:
|
|
SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
|
|
(10 rows)
|
|
|
|
SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 101)) FOR UPDATE
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.*
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 102)) FOR SHARE
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 102)) FOR SHARE
|
|
failed to get remote plan, error massage is:
|
|
SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
|
|
(10 rows)
|
|
|
|
SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 102)) FOR SHARE
|
|
-- aggregate
|
|
SELECT COUNT(*) FROM ft1 t1;
|
|
count
|
|
-------
|
|
1000
|
|
(1 row)
|
|
|
|
-- subquery
|
|
SELECT * FROM ft1 t1 WHERE t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 <= 10) ORDER BY c1;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST | Mon Jan 05 00:00:00 1970 | 4 | 4 | foo
|
|
5 | 5 | 00005 | Tue Jan 06 00:00:00 1970 PST | Tue Jan 06 00:00:00 1970 | 5 | 5 | foo
|
|
6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
7 | 7 | 00007 | Thu Jan 08 00:00:00 1970 PST | Thu Jan 08 00:00:00 1970 | 7 | 7 | foo
|
|
8 | 8 | 00008 | Fri Jan 09 00:00:00 1970 PST | Fri Jan 09 00:00:00 1970 | 8 | 8 | foo
|
|
9 | 9 | 00009 | Sat Jan 10 00:00:00 1970 PST | Sat Jan 10 00:00:00 1970 | 9 | 9 | foo
|
|
10 | 0 | 00010 | Sun Jan 11 00:00:00 1970 PST | Sun Jan 11 00:00:00 1970 | 0 | 0 | foo
|
|
(10 rows)
|
|
|
|
-- subquery+MAX
|
|
SELECT * FROM ft1 t1 WHERE t1.c3 = (SELECT MAX(c3) FROM ft2 t2) ORDER BY c1;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
------+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1000 | 0 | 01000 | Thu Jan 01 00:00:00 1970 PST | Thu Jan 01 00:00:00 1970 | 0 | 0 | foo
|
|
(1 row)
|
|
|
|
-- used in CTE
|
|
WITH t1 AS (SELECT * FROM ft1 WHERE c1 <= 10) SELECT t2.c1, t2.c2, t2.c3, t2.c4 FROM t1, ft2 t2 WHERE t1.c1 = t2.c1 ORDER BY t1.c1;
|
|
c1 | c2 | c3 | c4
|
|
----+----+-------+------------------------------
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST
|
|
5 | 5 | 00005 | Tue Jan 06 00:00:00 1970 PST
|
|
6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST
|
|
7 | 7 | 00007 | Thu Jan 08 00:00:00 1970 PST
|
|
8 | 8 | 00008 | Fri Jan 09 00:00:00 1970 PST
|
|
9 | 9 | 00009 | Sat Jan 10 00:00:00 1970 PST
|
|
10 | 0 | 00010 | Sun Jan 11 00:00:00 1970 PST
|
|
(10 rows)
|
|
|
|
-- fixed values
|
|
SELECT 'fixed', NULL FROM ft1 t1 WHERE c1 = 1;
|
|
?column? | ?column?
|
|
----------+----------
|
|
fixed |
|
|
(1 row)
|
|
|
|
-- Test forcing the remote server to produce sorted data for a merge join.
|
|
SET enable_hashjoin TO false;
|
|
SET enable_nestloop TO false;
|
|
-- inner join; expressions in the clauses appear in the equivalence class list
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2."C 1" FROM ft2 t1 JOIN "S 1"."T 1" t2 ON (t1.c1 = t2."C 1") OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2."C 1"
|
|
-> Merge Join
|
|
Output: t1.c1, t2."C 1"
|
|
Merge Cond: (t1.c1 = t2."C 1")
|
|
-> Foreign Scan on public.ft2 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Row Adapter
|
|
Output: t2."C 1"
|
|
-> Vector Sort
|
|
Output: t2."C 1"
|
|
Sort Key: t2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" t2
|
|
Output: t2."C 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(27 rows)
|
|
|
|
SELECT t1.c1, t2."C 1" FROM ft2 t1 JOIN "S 1"."T 1" t2 ON (t1.c1 = t2."C 1") OFFSET 100 LIMIT 10;
|
|
c1 | C 1
|
|
-----+-----
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- outer join; expressions in the clauses do not appear in equivalence class
|
|
-- list but no output change as compared to the previous query
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2."C 1" FROM ft2 t1 LEFT JOIN "S 1"."T 1" t2 ON (t1.c1 = t2."C 1") OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2."C 1"
|
|
-> Merge Left Join
|
|
Output: t1.c1, t2."C 1"
|
|
Merge Cond: (t1.c1 = t2."C 1")
|
|
-> Foreign Scan on public.ft2 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Row Adapter
|
|
Output: t2."C 1"
|
|
-> Vector Sort
|
|
Output: t2."C 1"
|
|
Sort Key: t2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" t2
|
|
Output: t2."C 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(27 rows)
|
|
|
|
SELECT t1.c1, t2."C 1" FROM ft2 t1 LEFT JOIN "S 1"."T 1" t2 ON (t1.c1 = t2."C 1") OFFSET 100 LIMIT 10;
|
|
c1 | C 1
|
|
-----+-----
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- A join between local table and foreign join. ORDER BY clause is added to the
|
|
-- foreign join so that the local table can be joined using merge join strategy.
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1."C 1" FROM "S 1"."T 1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1."C 1"
|
|
-> Merge Right Join
|
|
Output: t1."C 1"
|
|
Merge Cond: (t3.c1 = t1."C 1")
|
|
-> Merge Join
|
|
Output: t3.c1
|
|
Merge Cond: (t3.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft2 t3
|
|
Output: t3.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Sort
|
|
Output: t2.c1
|
|
Sort Key: t2.c1
|
|
-> Foreign Scan on public.ft1 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Row Adapter
|
|
Output: t1."C 1"
|
|
-> Vector Sort
|
|
Output: t1."C 1"
|
|
Sort Key: t1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" t1
|
|
Output: t1."C 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(42 rows)
|
|
|
|
SELECT t1."C 1" FROM "S 1"."T 1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
C 1
|
|
-----
|
|
101
|
|
102
|
|
103
|
|
104
|
|
105
|
|
106
|
|
107
|
|
108
|
|
109
|
|
110
|
|
(10 rows)
|
|
|
|
-- Test similar to above, except that the full join prevents any equivalence
|
|
-- classes from being merged. This produces single relation equivalence classes
|
|
-- included in join restrictions.
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1."C 1", t2.c1, t3.c1 FROM "S 1"."T 1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1."C 1", t2.c1, t3.c1
|
|
-> Merge Right Join
|
|
Output: t1."C 1", t2.c1, t3.c1
|
|
Merge Cond: (t3.c1 = t1."C 1")
|
|
-> Merge Left Join
|
|
Output: t3.c1, t2.c1
|
|
Merge Cond: (t3.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft2 t3
|
|
Output: t3.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Sort
|
|
Output: t2.c1
|
|
Sort Key: t2.c1
|
|
-> Foreign Scan on public.ft1 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Row Adapter
|
|
Output: t1."C 1"
|
|
-> Vector Sort
|
|
Output: t1."C 1"
|
|
Sort Key: t1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" t1
|
|
Output: t1."C 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(42 rows)
|
|
|
|
SELECT t1."C 1", t2.c1, t3.c1 FROM "S 1"."T 1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
C 1 | c1 | c1
|
|
-----+-----+-----
|
|
101 | 101 | 101
|
|
102 | 102 | 102
|
|
103 | 103 | 103
|
|
104 | 104 | 104
|
|
105 | 105 | 105
|
|
106 | 106 | 106
|
|
107 | 107 | 107
|
|
108 | 108 | 108
|
|
109 | 109 | 109
|
|
110 | 110 | 110
|
|
(10 rows)
|
|
|
|
-- Test similar to above with all full outer joins
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1."C 1", t2.c1, t3.c1 FROM "S 1"."T 1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1."C 1", t2.c1, t3.c1
|
|
-> Merge Full Join
|
|
Output: t1."C 1", t2.c1, t3.c1
|
|
Merge Cond: (t1."C 1" = t3.c1)
|
|
-> Row Adapter
|
|
Output: t1."C 1"
|
|
-> Vector Sort
|
|
Output: t1."C 1"
|
|
Sort Key: t1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" t1
|
|
Output: t1."C 1"
|
|
-> Sort
|
|
Output: t2.c1, t3.c1
|
|
Sort Key: t3.c1
|
|
-> Merge Full Join
|
|
Output: t2.c1, t3.c1
|
|
Merge Cond: (t3.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft2 t3
|
|
Output: t3.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Sort
|
|
Output: t2.c1
|
|
Sort Key: t2.c1
|
|
-> Foreign Scan on public.ft1 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(45 rows)
|
|
|
|
SELECT t1."C 1", t2.c1, t3.c1 FROM "S 1"."T 1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C 1") OFFSET 100 LIMIT 10;
|
|
C 1 | c1 | c1
|
|
-----+-----+-----
|
|
101 | 101 | 101
|
|
102 | 102 | 102
|
|
103 | 103 | 103
|
|
104 | 104 | 104
|
|
105 | 105 | 105
|
|
106 | 106 | 106
|
|
107 | 107 | 107
|
|
108 | 108 | 108
|
|
109 | 109 | 109
|
|
110 | 110 | 110
|
|
(10 rows)
|
|
|
|
RESET enable_hashjoin;
|
|
RESET enable_nestloop;
|
|
-- Test executing assertion in estimate_path_cost_size() that makes sure that
|
|
-- retrieved_rows for foreign rel re-used to cost pre-sorted foreign paths is
|
|
-- a sensible value even when the rel has tuples=0
|
|
CREATE TABLE loct_empty (c1 int NOT NULL, c2 text) with (orientation=column);
|
|
CREATE FOREIGN TABLE ft_empty (c1 int NOT NULL, c2 text)
|
|
SERVER loopback OPTIONS (table_name 'loct_empty');
|
|
INSERT INTO loct_empty
|
|
SELECT id, 'AAA' || to_char(id, 'FM000') FROM generate_series(1, 100) id;
|
|
DELETE FROM loct_empty;
|
|
ANALYZE ft_empty;
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c1, c2
|
|
Sort Key: ft_empty.c1
|
|
-> Foreign Scan on public.ft_empty
|
|
Output: c1, c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1, c2 FROM public.loct_empty
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1, c2 FROM public.loct_empty
|
|
Row Adapter
|
|
Output: c1, c2
|
|
-> CStore Scan on public.loct_empty
|
|
Output: c1, c2
|
|
|
|
(15 rows)
|
|
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: WHERE with remotely-executable conditions
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; -- Var, OpExpr(b), Const
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Index Cond: ("T 1"."C 1" = 1)
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 100)) AND ((c2 = 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 100)) AND ((c2 = 0))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (("T 1"."C 1" = 100) AND ("T 1".c2 = 0))
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" IS NULL))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" IS NULL))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Result
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
One-Time Filter: false
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Index Cond: ("T 1"."C 1" IS NULL)
|
|
|
|
(16 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(12 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((round(abs("C 1"), 0) = 1::numeric))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((round(abs("C 1"), 0) = 1::numeric))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (round((abs("T 1"."C 1"))::numeric, 0) = 1::numeric)
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l)
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = (- "C 1")))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = (- "C 1")))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 1"."C 1" = (- "T 1"."C 1"))
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((("C 1" IS NOT NULL) IS DISTINCT FROM ("C 1" IS NOT NULL)))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((("C 1" IS NOT NULL) IS DISTINCT FROM ("C 1" IS NOT NULL)))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (("T 1"."C 1" IS NOT NULL) IS DISTINCT FROM ("T 1"."C 1" IS NOT NULL))
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = ANY (ARRAY[c2, 1, ("C 1" + 0)])))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = ANY (ARRAY[c2, 1, ("C 1" + 0)])))
|
|
Result
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 1"."C 1" = ANY (ARRAY["T 1".c2, 1, ("T 1"."C 1" + 0)]))
|
|
-> Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(15 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = ((ARRAY["C 1", c2, 3])[1])))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = ((ARRAY["C 1", c2, 3])[1])))
|
|
Result
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 1"."C 1" = (ARRAY["T 1"."C 1", "T 1".c2, 3])[1])
|
|
-> Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(15 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar'; -- check special chars
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c6 = E'foo''s\\bar'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c6 = E'foo''s\\bar'::text))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (("T 1".c6)::text = 'foo''s\bar'::text)
|
|
|
|
(13 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo'; -- can't be sent to remote
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = 'foo'::user_enum)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(13 rows)
|
|
|
|
-- parameterized remote path for foreign table
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM "S 1"."T 1" a, ft2 b WHERE a."C 1" = 47 AND b.c1 = a.c2;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: a."C 1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8
|
|
Join Filter: (a.c2 = b.c1)
|
|
-> Row Adapter
|
|
Output: a."C 1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1" a
|
|
Output: a."C 1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8
|
|
Index Cond: (a."C 1" = 47)
|
|
-> Foreign Scan on public.ft2 b
|
|
Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(20 rows)
|
|
|
|
SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----+----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
47 | 7 | 00047 | Tue Feb 17 00:00:00 1970 PST | Tue Feb 17 00:00:00 1970 | 7 | 7 | foo | 7 | 7 | 00007 | Thu Jan 08 00:00:00 1970 PST | Thu Jan 08 00:00:00 1970 | 7 | 7 | foo
|
|
(1 row)
|
|
|
|
-- check both safe and unsafe join conditions
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM ft2 a, ft2 b
|
|
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Hash Join
|
|
Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8
|
|
Hash Cond: ((b.c1 = a.c1) AND ((b.c7)::text = upper((a.c7)::text)))
|
|
-> Foreign Scan on public.ft2 b
|
|
Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8
|
|
-> Foreign Scan on public.ft2 a
|
|
Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8
|
|
Filter: (a.c8 = 'foo'::user_enum)
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c2 = 6)) ORDER BY "C 1" ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((c2 = 6)) ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Sort
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 1".c2 = 6)
|
|
|
|
(31 rows)
|
|
|
|
SELECT * FROM ft2 a, ft2 b
|
|
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
-----+----+-------+------------------------------+--------------------------+----+------------+-----+-----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
16 | 6 | 00016 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 16 | 6 | 00016 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
26 | 6 | 00026 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 26 | 6 | 00026 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
36 | 6 | 00036 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 36 | 6 | 00036 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
46 | 6 | 00046 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 46 | 6 | 00046 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
56 | 6 | 00056 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 56 | 6 | 00056 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
66 | 6 | 00066 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 66 | 6 | 00066 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
76 | 6 | 00076 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 76 | 6 | 00076 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
86 | 6 | 00086 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 86 | 6 | 00086 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
96 | 6 | 00096 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 96 | 6 | 00096 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
106 | 6 | 00106 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 106 | 6 | 00106 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
116 | 6 | 00116 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 116 | 6 | 00116 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
126 | 6 | 00126 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 126 | 6 | 00126 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
136 | 6 | 00136 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 136 | 6 | 00136 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
146 | 6 | 00146 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 146 | 6 | 00146 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
156 | 6 | 00156 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 156 | 6 | 00156 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
166 | 6 | 00166 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 166 | 6 | 00166 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
176 | 6 | 00176 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 176 | 6 | 00176 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
186 | 6 | 00186 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 186 | 6 | 00186 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
196 | 6 | 00196 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 196 | 6 | 00196 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
206 | 6 | 00206 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 206 | 6 | 00206 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
216 | 6 | 00216 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 216 | 6 | 00216 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
226 | 6 | 00226 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 226 | 6 | 00226 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
236 | 6 | 00236 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 236 | 6 | 00236 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
246 | 6 | 00246 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 246 | 6 | 00246 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
256 | 6 | 00256 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 256 | 6 | 00256 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
266 | 6 | 00266 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 266 | 6 | 00266 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
276 | 6 | 00276 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 276 | 6 | 00276 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
286 | 6 | 00286 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 286 | 6 | 00286 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
296 | 6 | 00296 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 296 | 6 | 00296 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
306 | 6 | 00306 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 306 | 6 | 00306 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
316 | 6 | 00316 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 316 | 6 | 00316 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
326 | 6 | 00326 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 326 | 6 | 00326 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
336 | 6 | 00336 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 336 | 6 | 00336 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
346 | 6 | 00346 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 346 | 6 | 00346 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
356 | 6 | 00356 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 356 | 6 | 00356 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
366 | 6 | 00366 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 366 | 6 | 00366 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
376 | 6 | 00376 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 376 | 6 | 00376 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
386 | 6 | 00386 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 386 | 6 | 00386 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
396 | 6 | 00396 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 396 | 6 | 00396 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
406 | 6 | 00406 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 406 | 6 | 00406 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
416 | 6 | 00416 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 416 | 6 | 00416 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
426 | 6 | 00426 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 426 | 6 | 00426 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
436 | 6 | 00436 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 436 | 6 | 00436 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
446 | 6 | 00446 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 446 | 6 | 00446 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
456 | 6 | 00456 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 456 | 6 | 00456 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
466 | 6 | 00466 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 466 | 6 | 00466 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
476 | 6 | 00476 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 476 | 6 | 00476 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
486 | 6 | 00486 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 486 | 6 | 00486 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
496 | 6 | 00496 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 496 | 6 | 00496 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
506 | 6 | 00506 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 506 | 6 | 00506 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
516 | 6 | 00516 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 516 | 6 | 00516 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
526 | 6 | 00526 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 526 | 6 | 00526 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
536 | 6 | 00536 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 536 | 6 | 00536 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
546 | 6 | 00546 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 546 | 6 | 00546 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
556 | 6 | 00556 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 556 | 6 | 00556 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
566 | 6 | 00566 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 566 | 6 | 00566 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
576 | 6 | 00576 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 576 | 6 | 00576 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
586 | 6 | 00586 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 586 | 6 | 00586 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
596 | 6 | 00596 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 596 | 6 | 00596 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
606 | 6 | 00606 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 606 | 6 | 00606 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
616 | 6 | 00616 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 616 | 6 | 00616 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
626 | 6 | 00626 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 626 | 6 | 00626 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
636 | 6 | 00636 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 636 | 6 | 00636 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
646 | 6 | 00646 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 646 | 6 | 00646 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
656 | 6 | 00656 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 656 | 6 | 00656 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
666 | 6 | 00666 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 666 | 6 | 00666 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
676 | 6 | 00676 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 676 | 6 | 00676 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
686 | 6 | 00686 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 686 | 6 | 00686 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
696 | 6 | 00696 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 696 | 6 | 00696 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
706 | 6 | 00706 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 706 | 6 | 00706 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
716 | 6 | 00716 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 716 | 6 | 00716 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
726 | 6 | 00726 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 726 | 6 | 00726 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
736 | 6 | 00736 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 736 | 6 | 00736 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
746 | 6 | 00746 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 746 | 6 | 00746 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
756 | 6 | 00756 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 756 | 6 | 00756 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
766 | 6 | 00766 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 766 | 6 | 00766 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
776 | 6 | 00776 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 776 | 6 | 00776 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
786 | 6 | 00786 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 786 | 6 | 00786 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
796 | 6 | 00796 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 796 | 6 | 00796 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
806 | 6 | 00806 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 806 | 6 | 00806 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
816 | 6 | 00816 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 816 | 6 | 00816 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
826 | 6 | 00826 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 826 | 6 | 00826 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
836 | 6 | 00836 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 836 | 6 | 00836 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
846 | 6 | 00846 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 846 | 6 | 00846 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
856 | 6 | 00856 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 856 | 6 | 00856 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
866 | 6 | 00866 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 866 | 6 | 00866 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
876 | 6 | 00876 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 876 | 6 | 00876 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
886 | 6 | 00886 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 886 | 6 | 00886 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
896 | 6 | 00896 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 896 | 6 | 00896 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
906 | 6 | 00906 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo | 906 | 6 | 00906 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
916 | 6 | 00916 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo | 916 | 6 | 00916 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
926 | 6 | 00926 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo | 926 | 6 | 00926 | Tue Jan 27 00:00:00 1970 PST | Tue Jan 27 00:00:00 1970 | 6 | 6 | foo
|
|
936 | 6 | 00936 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo | 936 | 6 | 00936 | Fri Feb 06 00:00:00 1970 PST | Fri Feb 06 00:00:00 1970 | 6 | 6 | foo
|
|
946 | 6 | 00946 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo | 946 | 6 | 00946 | Mon Feb 16 00:00:00 1970 PST | Mon Feb 16 00:00:00 1970 | 6 | 6 | foo
|
|
956 | 6 | 00956 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo | 956 | 6 | 00956 | Thu Feb 26 00:00:00 1970 PST | Thu Feb 26 00:00:00 1970 | 6 | 6 | foo
|
|
966 | 6 | 00966 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo | 966 | 6 | 00966 | Sun Mar 08 00:00:00 1970 PST | Sun Mar 08 00:00:00 1970 | 6 | 6 | foo
|
|
976 | 6 | 00976 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo | 976 | 6 | 00976 | Wed Mar 18 00:00:00 1970 PST | Wed Mar 18 00:00:00 1970 | 6 | 6 | foo
|
|
986 | 6 | 00986 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo | 986 | 6 | 00986 | Sat Mar 28 00:00:00 1970 PST | Sat Mar 28 00:00:00 1970 | 6 | 6 | foo
|
|
996 | 6 | 00996 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo | 996 | 6 | 00996 | Tue Apr 07 00:00:00 1970 PST | Tue Apr 07 00:00:00 1970 | 6 | 6 | foo
|
|
(100 rows)
|
|
|
|
-- bug before 9.3.5 due to sloppy handling of remote-estimate parameters
|
|
SELECT * FROM ft1 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft2 WHERE c1 < 5));
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST | Mon Jan 05 00:00:00 1970 | 4 | 4 | foo
|
|
(4 rows)
|
|
|
|
SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5));
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST | Mon Jan 05 00:00:00 1970 | 4 | 4 | foo
|
|
(4 rows)
|
|
|
|
-- we should not push order by clause with volatile expressions or unsafe
|
|
-- collations
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM ft2 ORDER BY ft2.c1, random();
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, (random())
|
|
Sort Key: ft2.c1, (random())
|
|
-> Foreign Scan on public.ft2
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, random()
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(15 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM ft2 ORDER BY ft2.c1, ft2.c3 collate "C";
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, ((c3)::text)
|
|
Sort Key: ft2.c1, ft2.c3 COLLATE "C"
|
|
-> Foreign Scan on public.ft2
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8, (c3)::text
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(15 rows)
|
|
|
|
-- user-defined operator/function
|
|
CREATE FUNCTION postgres_fdw_abs(int) RETURNS int AS $$
|
|
BEGIN
|
|
RETURN abs($1);
|
|
END
|
|
$$ LANGUAGE plpgsql IMMUTABLE;
|
|
CREATE OPERATOR === (
|
|
LEFTARG = int,
|
|
RIGHTARG = int,
|
|
PROCEDURE = int4eq,
|
|
COMMUTATOR = ===
|
|
);
|
|
-- built-in operators and functions can be shipped for remote execution
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2);
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(c3))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1 t1)
|
|
Remote SQL: SELECT count(c3) FROM "S 1"."T 1" WHERE (("C 1" = abs(c2)))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(c3) FROM "S 1"."T 1" WHERE (("C 1" = abs(c2)))
|
|
Row Adapter
|
|
Output: (count(c3))
|
|
-> Vector Aggregate
|
|
Output: count(c3)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c3, "C 1", c2
|
|
Filter: ("T 1"."C 1" = abs("T 1".c2))
|
|
|
|
(16 rows)
|
|
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2);
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(c3))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1 t1)
|
|
Remote SQL: SELECT count(c3) FROM "S 1"."T 1" WHERE (("C 1" = c2))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(c3) FROM "S 1"."T 1" WHERE (("C 1" = c2))
|
|
Row Adapter
|
|
Output: (count(c3))
|
|
-> Vector Aggregate
|
|
Output: count(c3)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c3, "C 1", c2
|
|
Filter: ("T 1"."C 1" = "T 1".c2)
|
|
|
|
(16 rows)
|
|
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2;
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
-- by default, user-defined ones cannot
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2);
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: c3, c1, c2
|
|
Filter: (t1.c1 = postgres_fdw_abs(t1.c2))
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3
|
|
|
|
(15 rows)
|
|
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2);
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: c3
|
|
Filter: (t1.c1 === t1.c2)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3
|
|
|
|
(15 rows)
|
|
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2;
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
-- ORDER BY can be shipped, though
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c1 === t1.c2)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> Vector Sort
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Sort Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
|
|
(18 rows)
|
|
|
|
SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
-- but let's put them in an extension ...
|
|
ALTER EXTENSION postgres_fdw ADD FUNCTION postgres_fdw_abs(int);
|
|
ALTER EXTENSION postgres_fdw ADD OPERATOR === (int, int);
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2);
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2;
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
-- and both ORDER BY and LIMIT can be shipped
|
|
SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
-- case when expr
|
|
explain (verbose, costs off) select * from ft1 where case c1 when 1 then 0 end = 0;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (((CASE "C 1" WHEN 1 THEN 0 ELSE NULL::integer END) = 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (((CASE "C 1" WHEN 1 THEN 0 ELSE NULL::integer END) = 0))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (CASE "T 1"."C 1" WHEN 1 THEN 0 ELSE NULL::integer END = 0)
|
|
|
|
(13 rows)
|
|
|
|
select * from ft1 where case c1 when 1 then 0 end = 0;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: JOIN queries
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
-- Analyze ft4 and ft5 so that we have better statistics. These tables do not
|
|
-- have use_remote_estimate set.
|
|
ANALYZE ft4;
|
|
ANALYZE ft5;
|
|
-- join two tables
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; -- Inaccurate
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
-> Sort
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Sort Key: t1.c3, t1.c1
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
-----+-----
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- join three tables
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10; -- Inaccurate
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c2, t3.c3, t1.c3
|
|
-> Sort
|
|
Output: t1.c1, t2.c2, t3.c3, t1.c3
|
|
Sort Key: t1.c3, t1.c1
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c2, t3.c3, t1.c3
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c2, t2.c1, t3.c3, t3.c1
|
|
-> Foreign Scan
|
|
Output: t2.c2, t2.c1, t3.c3, t3.c1
|
|
Node ID: 2
|
|
Relations: (public.ft2 t2) INNER JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r2.c2, r2."C 1", r4.c3, r4.c1 FROM ("S 1"."T 1" r2 INNER JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) ORDER BY r2."C 1" ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r2.c2, r2."C 1", r4.c3, r4.c1 FROM ("S 1"."T 1" r2 INNER JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) ORDER BY r2."C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: r2.c2, r2."C 1", r4.c3, r4.c1
|
|
-> Vector Sort
|
|
Output: r2.c2, r2."C 1", r4.c3, r4.c1
|
|
Sort Key: r2."C 1"
|
|
-> Vector Sonic Hash Join
|
|
Output: r2.c2, r2."C 1", r4.c3, r4.c1
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(40 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
22 | 2 | AAA022
|
|
24 | 4 | AAA024
|
|
26 | 6 | AAA026
|
|
28 | 8 | AAA028
|
|
30 | 0 | AAA030
|
|
32 | 2 | AAA032
|
|
34 | 4 | AAA034
|
|
36 | 6 | AAA036
|
|
38 | 8 | AAA038
|
|
40 | 0 | AAA040
|
|
(10 rows)
|
|
|
|
-- left outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4 t1) LEFT JOIN (public.ft5 t2)
|
|
Remote SQL: SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) ORDER BY r1.c1 ASC NULLS LAST, r2.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) ORDER BY r1.c1 ASC NULLS LAST, r2.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1.c1, r2.c1
|
|
-> Vector Limit
|
|
Output: r1.c1, r2.c1
|
|
-> Vector Sort
|
|
Output: r1.c1, r2.c1
|
|
Sort Key: r1.c1, r2.c1
|
|
-> Vector Hash Left Join
|
|
Output: r1.c1, r2.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(23 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c1
|
|
----+----
|
|
22 |
|
|
24 | 24
|
|
26 |
|
|
28 |
|
|
30 | 30
|
|
32 |
|
|
34 |
|
|
36 | 36
|
|
38 |
|
|
40 |
|
|
(10 rows)
|
|
|
|
-- left outer join three tables
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t1) LEFT JOIN (public.ft2 t2)) LEFT JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 LEFT JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 LEFT JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Nest Loop Left Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Join Filter: (r2."C 1" = r4.c1)
|
|
-> Vector Nest Loop Left Join
|
|
Output: r1."C 1", r2.c2, r2."C 1"
|
|
Join Filter: (r1."C 1" = r2."C 1")
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Vector Materialize
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Vector Materialize
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(29 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- left outer join + placement of clauses.
|
|
-- clauses within the nullable side are not pulled up, but top level clause on
|
|
-- non-nullable side is pushed into non-nullable side
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t1.c2, ft5.c1, ft5.c2
|
|
Node ID: 1
|
|
Relations: (public.ft4 t1) LEFT JOIN (public.ft5)
|
|
Remote SQL: SELECT r1.c1, r1.c2, r4.c1, r4.c2 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r4 ON (((r1.c1 = r4.c1)) AND ((r4.c1 < 10)))) WHERE ((r1.c1 < 10))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r1.c2, r4.c1, r4.c2 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r4 ON (((r1.c1 = r4.c1)) AND ((r4.c1 < 10)))) WHERE ((r1.c1 < 10))
|
|
Row Adapter
|
|
Output: r1.c1, r1.c2, r4.c1, r4.c2
|
|
-> Vector Nest Loop Left Join
|
|
Output: r1.c1, r1.c2, r4.c1, r4.c2
|
|
Join Filter: (r1.c1 = r4.c1)
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1, r1.c2
|
|
Filter: (r1.c1 < 10)
|
|
-> Vector Materialize
|
|
Output: r4.c1, r4.c2
|
|
-> CStore Scan on "S 1"."T 4" r4
|
|
Output: r4.c1, r4.c2
|
|
Filter: (r4.c1 < 10)
|
|
|
|
(22 rows)
|
|
|
|
SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10;
|
|
c1 | c2 | c1 | c2
|
|
----+----+----+----
|
|
2 | 3 | |
|
|
4 | 5 | |
|
|
6 | 7 | 6 | 7
|
|
8 | 9 | |
|
|
(4 rows)
|
|
|
|
-- clauses within the nullable side are not pulled up, but the top level clause
|
|
-- on nullable side is not pushed down into nullable side
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1)
|
|
WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t1.c2, ft5.c1, ft5.c2
|
|
Node ID: 1
|
|
Relations: (public.ft4 t1) LEFT JOIN (public.ft5)
|
|
Remote SQL: SELECT r1.c1, r1.c2, r4.c1, r4.c2 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r4 ON (((r1.c1 = r4.c1)) AND ((r4.c1 < 10)))) WHERE (((r4.c1 < 10) OR (r4.c1 IS NULL))) AND ((r1.c1 < 10))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r1.c2, r4.c1, r4.c2 FROM ("S 1"."T 3" r1 LEFT JOIN "S 1"."T 4" r4 ON (((r1.c1 = r4.c1)) AND ((r4.c1 < 10)))) WHERE (((r4.c1 < 10) OR (r4.c1 IS NULL))) AND ((r1.c1 < 10))
|
|
Row Adapter
|
|
Output: r1.c1, r1.c2, r4.c1, r4.c2
|
|
-> Vector Nest Loop Left Join
|
|
Output: r1.c1, r1.c2, r4.c1, r4.c2
|
|
Join Filter: (r1.c1 = r4.c1)
|
|
Filter: ((r4.c1 < 10) OR (r4.c1 IS NULL))
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1, r1.c2
|
|
Filter: (r1.c1 < 10)
|
|
-> Vector Materialize
|
|
Output: r4.c1, r4.c2
|
|
-> CStore Scan on "S 1"."T 4" r4
|
|
Output: r4.c1, r4.c2
|
|
Filter: (r4.c1 < 10)
|
|
|
|
(23 rows)
|
|
|
|
SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1)
|
|
WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10;
|
|
c1 | c2 | c1 | c2
|
|
----+----+----+----
|
|
2 | 3 | |
|
|
4 | 5 | |
|
|
6 | 7 | 6 | 7
|
|
8 | 9 | |
|
|
(4 rows)
|
|
|
|
-- right outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4 t2) LEFT JOIN (public.ft5 t1)
|
|
Remote SQL: SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r2 LEFT JOIN "S 1"."T 4" r1 ON (((r1.c1 = r2.c1)))) ORDER BY r2.c1 ASC NULLS LAST, r1.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r2 LEFT JOIN "S 1"."T 4" r1 ON (((r1.c1 = r2.c1)))) ORDER BY r2.c1 ASC NULLS LAST, r1.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1.c1, r2.c1
|
|
-> Vector Limit
|
|
Output: r1.c1, r2.c1
|
|
-> Vector Sort
|
|
Output: r1.c1, r2.c1
|
|
Sort Key: r2.c1, r1.c1
|
|
-> Vector Hash Left Join
|
|
Output: r1.c1, r2.c1
|
|
Hash Cond: (r2.c1 = r1.c1)
|
|
-> CStore Scan on "S 1"."T 3" r2
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r1
|
|
Output: r1.c1
|
|
|
|
(23 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c1
|
|
----+----
|
|
| 22
|
|
24 | 24
|
|
| 26
|
|
| 28
|
|
30 | 30
|
|
| 32
|
|
| 34
|
|
36 | 36
|
|
| 38
|
|
| 40
|
|
(10 rows)
|
|
|
|
-- right outer join three tables
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft4 t3) LEFT JOIN (public.ft2 t2)) LEFT JOIN (public.ft2 t1)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 3" r4 LEFT JOIN "S 1"."T 1" r2 ON (((r2."C 1" = r4.c1)))) LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 3" r4 LEFT JOIN "S 1"."T 1" r2 ON (((r2."C 1" = r4.c1)))) LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Hash Right Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Vector Hash Right Join
|
|
Output: r4.c3, r2.c2, r2."C 1"
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(25 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
22 | 2 | AAA022
|
|
24 | 4 | AAA024
|
|
26 | 6 | AAA026
|
|
28 | 8 | AAA028
|
|
30 | 0 | AAA030
|
|
32 | 2 | AAA032
|
|
34 | 4 | AAA034
|
|
36 | 6 | AAA036
|
|
38 | 8 | AAA038
|
|
40 | 0 | AAA040
|
|
(10 rows)
|
|
|
|
-- full outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10; -- Inaccurate
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1
|
|
-> Sort
|
|
Output: t1.c1, t2.c1
|
|
Sort Key: t1.c1, t2.c1
|
|
-> Foreign Scan
|
|
Output: t1.c1, t2.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4 t1) FULL JOIN (public.ft5 t2)
|
|
Remote SQL: SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1))))
|
|
Hash Full Join
|
|
Output: r1.c1, r2.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(27 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10;
|
|
c1 | c1
|
|
-----+----
|
|
92 |
|
|
94 |
|
|
96 | 96
|
|
98 |
|
|
100 |
|
|
| 3
|
|
| 9
|
|
| 15
|
|
| 21
|
|
| 27
|
|
(10 rows)
|
|
|
|
-- full outer join with restrictions on the joining relations
|
|
-- a. the joining relations are both base relations
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: ft4.c1, ft5.c1
|
|
Sort Key: ft4.c1, ft5.c1
|
|
-> Foreign Scan
|
|
Output: ft4.c1, ft5.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4) FULL JOIN (public.ft5)
|
|
Remote SQL: SELECT s4.c1, s5.c1 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5(c1) ON (((s4.c1 = s5.c1))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT s4.c1, s5.c1 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5(c1) ON (((s4.c1 = s5.c1))))
|
|
Hash Full Join
|
|
Output: "T 3".c1, "T 4".c1
|
|
Hash Cond: ("T 3".c1 = "T 4".c1)
|
|
-> Row Adapter
|
|
Output: "T 3".c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: "T 3".c1
|
|
Filter: (("T 3".c1 >= 50) AND ("T 3".c1 <= 60))
|
|
-> Hash
|
|
Output: "T 4".c1
|
|
-> Row Adapter
|
|
Output: "T 4".c1
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: "T 4".c1
|
|
Filter: (("T 4".c1 >= 50) AND ("T 4".c1 <= 60))
|
|
|
|
(27 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1;
|
|
c1 | c1
|
|
----+----
|
|
50 |
|
|
52 |
|
|
54 | 54
|
|
56 |
|
|
58 |
|
|
60 | 60
|
|
| 51
|
|
| 57
|
|
(8 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: 1
|
|
Node ID: 1
|
|
Relations: (public.ft4) FULL JOIN (public.ft5)
|
|
Remote SQL: SELECT NULL FROM ((SELECT NULL FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4 FULL JOIN (SELECT NULL FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5 ON (TRUE)) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT NULL FROM ((SELECT NULL FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4 FULL JOIN (SELECT NULL FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5 ON (TRUE)) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: (NULL::text)
|
|
-> Vector Limit
|
|
Output: (NULL::text)
|
|
-> Vector Subquery Scan on subquery
|
|
Output: NULL::text
|
|
-> Vector Result
|
|
Output: (NULL::text), (NULL::text)
|
|
-> Vector Append
|
|
-> Vector Nest Loop Left Join
|
|
Output: (NULL::text), (NULL::text)
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
-> Vector Materialize
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 4".c1 >= 50) AND ("S 1"."T 4".c1 <= 60))
|
|
-> Vector Nest Loop Left Anti Full Join
|
|
Output: (NULL::text), (NULL::text)
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 4".c1 >= 50) AND ("S 1"."T 4".c1 <= 60))
|
|
-> Vector Materialize
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
|
|
(38 rows)
|
|
|
|
SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10;
|
|
?column?
|
|
----------
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT count(*) FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 2;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: (count(*))
|
|
-> Aggregate
|
|
Output: count(*)
|
|
-> Foreign Scan
|
|
Node ID: 1
|
|
Relations: (public.ft4) FULL JOIN (public.ft5)
|
|
Remote SQL: SELECT NULL FROM ((SELECT NULL FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4 FULL JOIN (SELECT NULL FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5 ON (TRUE))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT NULL FROM ((SELECT NULL FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4 FULL JOIN (SELECT NULL FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5 ON (TRUE))
|
|
Row Adapter
|
|
Output: (NULL::text)
|
|
-> Vector Subquery Scan on subquery
|
|
Output: NULL::text
|
|
-> Vector Result
|
|
Output: (NULL::text), (NULL::text)
|
|
-> Vector Append
|
|
-> Vector Nest Loop Left Join
|
|
Output: (NULL::text), (NULL::text)
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
-> Vector Materialize
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 4".c1 >= 50) AND ("S 1"."T 4".c1 <= 60))
|
|
-> Vector Nest Loop Left Anti Full Join
|
|
Output: (NULL::text), (NULL::text)
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 4".c1 >= 50) AND ("S 1"."T 4".c1 <= 60))
|
|
-> Vector Materialize
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: NULL::text
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
|
|
(39 rows)
|
|
|
|
SELECT count(*) FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 2;
|
|
count
|
|
-------
|
|
(0 rows)
|
|
|
|
-- b. one of the joining relations is a base relation and the other is a join
|
|
-- relation
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: ft4.c1, t2.c1, t3.c1
|
|
Sort Key: ft4.c1, t2.c1, t3.c1
|
|
-> Foreign Scan
|
|
Output: ft4.c1, t2.c1, t3.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4) FULL JOIN ((public.ft4 t2) LEFT JOIN (public.ft5 t3))
|
|
Remote SQL: SELECT s4.c1, s8.c1, s8.c2 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT r5.c1, r6.c1 FROM ("S 1"."T 3" r5 LEFT JOIN "S 1"."T 4" r6 ON (((r5.c1 = r6.c1)))) WHERE ((r5.c1 >= 50)) AND ((r5.c1 <= 60))) s8(c1, c2) ON (((s4.c1 = s8.c1))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT s4.c1, s8.c1, s8.c2 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT r5.c1, r6.c1 FROM ("S 1"."T 3" r5 LEFT JOIN "S 1"."T 4" r6 ON (((r5.c1 = r6.c1)))) WHERE ((r5.c1 >= 50)) AND ((r5.c1 <= 60))) s8(c1, c2) ON (((s4.c1 = s8.c1))))
|
|
Hash Full Join
|
|
Output: "T 3".c1, r5.c1, r6.c1
|
|
Hash Cond: ("T 3".c1 = r5.c1)
|
|
-> Row Adapter
|
|
Output: "T 3".c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: "T 3".c1
|
|
Filter: (("T 3".c1 >= 50) AND ("T 3".c1 <= 60))
|
|
-> Hash
|
|
Output: r5.c1, r6.c1
|
|
-> Hash Left Join
|
|
Output: r5.c1, r6.c1
|
|
Hash Cond: (r5.c1 = r6.c1)
|
|
-> Row Adapter
|
|
Output: r5.c1
|
|
-> CStore Scan on "S 1"."T 3" r5
|
|
Output: r5.c1
|
|
Filter: ((r5.c1 >= 50) AND (r5.c1 <= 60))
|
|
-> Hash
|
|
Output: r6.c1
|
|
-> Row Adapter
|
|
Output: r6.c1
|
|
-> CStore Scan on "S 1"."T 4" r6
|
|
Output: r6.c1
|
|
|
|
(36 rows)
|
|
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b;
|
|
c1 | a | b
|
|
----+----+----
|
|
50 | 50 |
|
|
52 | 52 |
|
|
54 | 54 | 54
|
|
56 | 56 |
|
|
58 | 58 |
|
|
60 | 60 | 60
|
|
(6 rows)
|
|
|
|
-- c. test deparsing the remote query as nested subqueries
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: public.ft4.c1, public.ft4.c1, ft5.c1
|
|
Sort Key: public.ft4.c1, public.ft4.c1, ft5.c1
|
|
-> Foreign Scan
|
|
Output: public.ft4.c1, public.ft4.c1, ft5.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4) FULL JOIN ((public.ft4) FULL JOIN (public.ft5))
|
|
Remote SQL: SELECT s4.c1, s10.c1, s10.c2 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT s8.c1, s9.c1 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s8(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s9(c1) ON (((s8.c1 = s9.c1)))) WHERE (((s8.c1 IS NULL) OR (s8.c1 IS NOT NULL)))) s10(c1, c2) ON (((s4.c1 = s10.c1))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT s4.c1, s10.c1, s10.c2 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT s8.c1, s9.c1 FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s8(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s9(c1) ON (((s8.c1 = s9.c1)))) WHERE (((s8.c1 IS NULL) OR (s8.c1 IS NOT NULL)))) s10(c1, c2) ON (((s4.c1 = s10.c1))))
|
|
Hash Full Join
|
|
Output: "S 1"."T 3".c1, "S 1"."T 3".c1, "T 4".c1
|
|
Hash Cond: ("S 1"."T 3".c1 = "S 1"."T 3".c1)
|
|
-> Row Adapter
|
|
Output: "S 1"."T 3".c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: "S 1"."T 3".c1
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
-> Hash
|
|
Output: "S 1"."T 3".c1, "T 4".c1
|
|
-> Hash Full Join
|
|
Output: "S 1"."T 3".c1, "T 4".c1
|
|
Hash Cond: ("S 1"."T 3".c1 = "T 4".c1)
|
|
Filter: (("S 1"."T 3".c1 IS NULL) OR ("S 1"."T 3".c1 IS NOT NULL))
|
|
-> Row Adapter
|
|
Output: "S 1"."T 3".c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: "S 1"."T 3".c1
|
|
Filter: (("S 1"."T 3".c1 >= 50) AND ("S 1"."T 3".c1 <= 60))
|
|
-> Hash
|
|
Output: "T 4".c1
|
|
-> Row Adapter
|
|
Output: "T 4".c1
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: "T 4".c1
|
|
Filter: (("T 4".c1 >= 50) AND ("T 4".c1 <= 60))
|
|
|
|
(38 rows)
|
|
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b;
|
|
c1 | a | b
|
|
----+----+----
|
|
50 | 50 |
|
|
52 | 52 |
|
|
54 | 54 | 54
|
|
56 | 56 |
|
|
58 | 58 |
|
|
60 | 60 | 60
|
|
| | 51
|
|
| | 57
|
|
(8 rows)
|
|
|
|
-- d. test deparsing rowmarked relations as subqueries
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T 3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 3"
|
|
SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T 3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 3"
|
|
-- full outer join + inner join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c1, t3.c1
|
|
Node ID: 1
|
|
Relations: ((public.ft4 t1) INNER JOIN (public.ft5 t2)) FULL JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1.c1, r2.c1, r4.c1 FROM (("S 1"."T 3" r1 INNER JOIN "S 1"."T 4" r2 ON (((r1.c1 = (r2.c1 + 1))) AND (((r2.c1 + 1) >= 50)) AND (((r2.c1 + 1) <= 60)) AND ((r1.c1 >= 50)) AND ((r1.c1 <= 60)))) FULL JOIN "S 1"."T 3" r4 ON (((r2.c1 = r4.c1)))) ORDER BY r1.c1 ASC NULLS LAST, r2.c1 ASC NULLS LAST, r4.c1 ASC NULLS LAST LIMIT 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r2.c1, r4.c1 FROM (("S 1"."T 3" r1 INNER JOIN "S 1"."T 4" r2 ON (((r1.c1 = (r2.c1 + 1))) AND (((r2.c1 + 1) >= 50)) AND (((r2.c1 + 1) <= 60)) AND ((r1.c1 >= 50)) AND ((r1.c1 <= 60)))) FULL JOIN "S 1"."T 3" r4 ON (((r2.c1 = r4.c1)))) ORDER BY r1.c1 ASC NULLS LAST, r2.c1 ASC NULLS LAST, r4.c1 ASC NULLS LAST LIMIT 10::bigint
|
|
Limit
|
|
Output: r1.c1, r2.c1, r4.c1
|
|
-> Sort
|
|
Output: r1.c1, r2.c1, r4.c1
|
|
Sort Key: r1.c1, r2.c1, r4.c1
|
|
-> Hash Full Join
|
|
Output: r1.c1, r2.c1, r4.c1
|
|
Hash Cond: (r2.c1 = r4.c1)
|
|
-> Nested Loop
|
|
Output: r1.c1, r2.c1
|
|
Join Filter: (r1.c1 = (r2.c1 + 1))
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
Filter: (((r2.c1 + 1) >= 50) AND ((r2.c1 + 1) <= 60))
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
Filter: ((r1.c1 >= 50) AND (r1.c1 <= 60))
|
|
-> Hash
|
|
Output: r4.c1
|
|
-> Row Adapter
|
|
Output: r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c1
|
|
|
|
(36 rows)
|
|
|
|
SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10;
|
|
c1 | c1 | c1
|
|
----+----+----
|
|
52 | 51 |
|
|
58 | 57 |
|
|
| | 2
|
|
| | 4
|
|
| | 6
|
|
| | 8
|
|
| | 10
|
|
| | 12
|
|
| | 14
|
|
| | 16
|
|
(10 rows)
|
|
|
|
-- full outer join three tables
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t1) FULL JOIN (public.ft2 t2)) FULL JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Hash Full Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> Hash Full Join
|
|
Output: r1."C 1", r2.c2, r2."C 1"
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Hash
|
|
Output: r2.c2, r2."C 1"
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Hash
|
|
Output: r4.c3, r4.c1
|
|
-> Row Adapter
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(33 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- full outer join + right outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft4 t3) LEFT JOIN (public.ft2 t2)) LEFT JOIN (public.ft2 t1)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 3" r4 LEFT JOIN "S 1"."T 1" r2 ON (((r2."C 1" = r4.c1)))) LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 3" r4 LEFT JOIN "S 1"."T 1" r2 ON (((r2."C 1" = r4.c1)))) LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Hash Right Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Vector Hash Right Join
|
|
Output: r4.c3, r2.c2, r2."C 1"
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(25 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
22 | 2 | AAA022
|
|
24 | 4 | AAA024
|
|
26 | 6 | AAA026
|
|
28 | 8 | AAA028
|
|
30 | 0 | AAA030
|
|
32 | 2 | AAA032
|
|
34 | 4 | AAA034
|
|
36 | 6 | AAA036
|
|
38 | 8 | AAA038
|
|
40 | 0 | AAA040
|
|
(10 rows)
|
|
|
|
-- right outer join + full outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t2) LEFT JOIN (public.ft2 t1)) FULL JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r2 LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r2 LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Hash Full Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> Nested Loop Left Join
|
|
Output: r2.c2, r2."C 1", r1."C 1"
|
|
Join Filter: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Materialize
|
|
Output: r1."C 1"
|
|
-> Row Adapter
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Hash
|
|
Output: r4.c3, r4.c1
|
|
-> Row Adapter
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(33 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- full outer join + left outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t1) FULL JOIN (public.ft2 t2)) LEFT JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Nested Loop Left Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Join Filter: (r2."C 1" = r4.c1)
|
|
-> Hash Full Join
|
|
Output: r1."C 1", r2.c2, r2."C 1"
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Hash
|
|
Output: r2.c2, r2."C 1"
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Materialize
|
|
Output: r4.c3, r4.c1
|
|
-> Row Adapter
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(33 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- left outer join + full outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t1) LEFT JOIN (public.ft2 t2)) FULL JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 LEFT JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r1 LEFT JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) FULL JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Hash Full Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> Nested Loop Left Join
|
|
Output: r1."C 1", r2.c2, r2."C 1"
|
|
Join Filter: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Materialize
|
|
Output: r2.c2, r2."C 1"
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Hash
|
|
Output: r4.c3, r4.c1
|
|
-> Row Adapter
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(33 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- right outer join + left outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: ((public.ft2 t2) LEFT JOIN (public.ft2 t1)) LEFT JOIN (public.ft4 t3)
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r2 LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM (("S 1"."T 1" r2 LEFT JOIN "S 1"."T 1" r1 ON (((r1."C 1" = r2."C 1")))) LEFT JOIN "S 1"."T 3" r4 ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Nest Loop Left Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Join Filter: (r2."C 1" = r4.c1)
|
|
-> Vector Nest Loop Left Join
|
|
Output: r2.c2, r2."C 1", r1."C 1"
|
|
Join Filter: (r1."C 1" = r2."C 1")
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> Vector Materialize
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> Vector Materialize
|
|
Output: r4.c3, r4.c1
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(29 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
11 | 1 |
|
|
12 | 2 | AAA012
|
|
13 | 3 |
|
|
14 | 4 | AAA014
|
|
15 | 5 |
|
|
16 | 6 | AAA016
|
|
17 | 7 |
|
|
18 | 8 | AAA018
|
|
19 | 9 |
|
|
20 | 0 | AAA020
|
|
(10 rows)
|
|
|
|
-- left outer join + right outer join
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: t1.c1, t2.c2, t3.c3
|
|
Node ID: 1
|
|
Relations: (public.ft4 t3) LEFT JOIN ((public.ft2 t1) INNER JOIN (public.ft2 t2))
|
|
Remote SQL: SELECT r1."C 1", r2.c2, r4.c3 FROM ("S 1"."T 3" r4 LEFT JOIN ("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r2.c2, r4.c3 FROM ("S 1"."T 3" r4 LEFT JOIN ("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) ON (((r2."C 1" = r4.c1)))) LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Limit
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
-> Vector Hash Right Join
|
|
Output: r1."C 1", r2.c2, r4.c3
|
|
Hash Cond: (r2."C 1" = r4.c1)
|
|
-> Vector Sonic Hash Join
|
|
Output: r1."C 1", r2.c2, r2."C 1"
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 3" r4
|
|
Output: r4.c3, r4.c1
|
|
|
|
(25 rows)
|
|
|
|
SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10;
|
|
c1 | c2 | c3
|
|
----+----+--------
|
|
56 | 6 | AAA056
|
|
58 | 8 | AAA058
|
|
60 | 0 | AAA060
|
|
64 | 4 | AAA064
|
|
68 | 8 | AAA068
|
|
70 | 0 | AAA070
|
|
84 | 4 | AAA084
|
|
12 | 2 | AAA012
|
|
22 | 2 | AAA022
|
|
30 | 0 | AAA030
|
|
(10 rows)
|
|
|
|
-- full outer join + WHERE clause, only matched rows
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1
|
|
-> Sort
|
|
Output: t1.c1, t2.c1
|
|
Sort Key: t1.c1, t2.c1
|
|
-> Foreign Scan
|
|
Output: t1.c1, t2.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4 t1) FULL JOIN (public.ft5 t2)
|
|
Remote SQL: SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 = r2.c1) OR (r1.c1 IS NULL)))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1.c1, r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 = r2.c1) OR (r1.c1 IS NULL)))
|
|
Hash Full Join
|
|
Output: r1.c1, r2.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
Filter: ((r1.c1 = r2.c1) OR (r1.c1 IS NULL))
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(28 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c1
|
|
----+----
|
|
66 | 66
|
|
72 | 72
|
|
78 | 78
|
|
84 | 84
|
|
90 | 90
|
|
96 | 96
|
|
| 3
|
|
| 9
|
|
| 15
|
|
| 21
|
|
(10 rows)
|
|
|
|
-- full outer join + WHERE clause with shippable extensions set
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c2, t1.c3
|
|
-> Foreign Scan
|
|
Output: t1.c1, t2.c2, t1.c3
|
|
Filter: (postgres_fdw_abs(t1.c1) > 0)
|
|
Node ID: 1
|
|
Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
|
|
Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
|
|
Hash Full Join
|
|
Output: r1."C 1", r1.c3, r2.c2
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r1."C 1", r1.c3
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1", r1.c3
|
|
-> Hash
|
|
Output: r2.c2, r2."C 1"
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
|
|
(25 rows)
|
|
|
|
-- full outer join + WHERE clause with shippable extensions not set
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c2, t1.c3
|
|
-> Foreign Scan
|
|
Output: t1.c1, t2.c2, t1.c3
|
|
Filter: (postgres_fdw_abs(t1.c1) > 0)
|
|
Node ID: 1
|
|
Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
|
|
Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
|
|
Hash Full Join
|
|
Output: r1."C 1", r1.c3, r2.c2
|
|
Hash Cond: (r1."C 1" = r2."C 1")
|
|
-> Row Adapter
|
|
Output: r1."C 1", r1.c3
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1", r1.c3
|
|
-> Hash
|
|
Output: r2.c2, r2."C 1"
|
|
-> Row Adapter
|
|
Output: r2.c2, r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2.c2, r2."C 1"
|
|
|
|
(25 rows)
|
|
|
|
-- join two tables with FOR UPDATE clause
|
|
-- tests whole-row reference for row marks
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
-> Sort
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
Sort Key: t1.c3, t1.c1
|
|
-> LockRows
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3, t1.*
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR UPDATE
|
|
-> Hash
|
|
Output: t2.c1, t2.*
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1, t2.*
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR UPDATE
|
|
failed to get remote plan, error massage is:
|
|
SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
failed to get remote plan, error massage is:
|
|
current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
|
|
|
(29 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR UPDATE
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR UPDATE
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR UPDATE
|
|
-- join two tables with FOR SHARE clause
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
-> Sort
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
Sort Key: t1.c3, t1.c1
|
|
-> LockRows
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1, t1.c3, t1.*, t2.*
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3, t1.*
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR SHARE
|
|
-> Hash
|
|
Output: t2.c1, t2.*
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1, t2.*
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR SHARE
|
|
failed to get remote plan, error massage is:
|
|
SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
failed to get remote plan, error massage is:
|
|
current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
|
|
|
(29 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR SHARE
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR SHARE
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" FOR SHARE
|
|
-- join in CTE
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------
|
|
Limit
|
|
Output: t.c1_1, t.c2_1, t.c1_3
|
|
CTE t
|
|
-> Hash Join
|
|
Output: t1.c1, t1.c3, t2.c1
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Sort
|
|
Output: t.c1_1, t.c2_1, t.c1_3
|
|
Sort Key: t.c1_3, t.c1_1
|
|
-> CTE Scan on t
|
|
Output: t.c1_1, t.c2_1, t.c1_3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(34 rows)
|
|
|
|
WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10;
|
|
c1_1 | c2_1
|
|
------+------
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- ctid with whole-row reference, currently, does not support system column
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
ERROR: column t1.ctid does not exist
|
|
LINE 2: SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1...
|
|
^
|
|
CONTEXT: referenced column: ctid
|
|
-- SEMI JOIN, not pushed down
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1
|
|
-> Sort
|
|
Output: t1.c1
|
|
Sort Key: t1.c1
|
|
-> Hash Semi Join
|
|
Output: t1.c1
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10;
|
|
c1
|
|
-----
|
|
101
|
|
102
|
|
103
|
|
104
|
|
105
|
|
106
|
|
107
|
|
108
|
|
109
|
|
110
|
|
(10 rows)
|
|
|
|
-- ANTI JOIN, not pushed down
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1
|
|
-> Merge Anti Join
|
|
Output: t1.c1
|
|
Merge Cond: (t1.c1 = t2.c2)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
-> Materialize
|
|
Output: t2.c2
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c2
|
|
Node ID: 2
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: c2
|
|
-> Vector Sort
|
|
Output: c2
|
|
Sort Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
|
|
(34 rows)
|
|
|
|
SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10;
|
|
c1
|
|
-----
|
|
110
|
|
111
|
|
112
|
|
113
|
|
114
|
|
115
|
|
116
|
|
117
|
|
118
|
|
119
|
|
(10 rows)
|
|
|
|
-- CROSS JOIN can be pushed down
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1
|
|
-> Sort
|
|
Output: t1.c1, t2.c1
|
|
Sort Key: t1.c1, t2.c1
|
|
-> Nested Loop
|
|
Output: t1.c1, t2.c1
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Materialize
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(30 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
----+-----
|
|
1 | 101
|
|
1 | 102
|
|
1 | 103
|
|
1 | 104
|
|
1 | 105
|
|
1 | 106
|
|
1 | 107
|
|
1 | 108
|
|
1 | 109
|
|
1 | 110
|
|
(10 rows)
|
|
|
|
-- different server, not pushed down. No result expected.
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1
|
|
-> Nested Loop
|
|
Output: t1.c1, t2.c1
|
|
Join Filter: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft6 t2
|
|
Output: t2.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 4" ORDER BY c1 ASC NULLS LAST
|
|
-> Foreign Scan on public.ft5 t1
|
|
Output: t1.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 4"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 4" ORDER BY c1 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: c1
|
|
-> Vector Sort
|
|
Output: c1
|
|
Sort Key: "T 4".c1
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: c1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 4"
|
|
Row Adapter
|
|
Output: c1
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: c1
|
|
|
|
(29 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
----+----
|
|
(0 rows)
|
|
|
|
-- unsafe join conditions (c8 has a UDT), not pushed down. Practically a CROSS
|
|
-- JOIN since c8 in both tables has same value.
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1
|
|
-> Sort
|
|
Output: t1.c1, t2.c1
|
|
Sort Key: t1.c1, t2.c1
|
|
-> Hash Left Join
|
|
Output: t1.c1, t2.c1
|
|
Hash Cond: (t1.c8 = t2.c8)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1, t2.c8
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1, t2.c8
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c8
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c8
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
----+-----
|
|
1 | 101
|
|
1 | 102
|
|
1 | 103
|
|
1 | 104
|
|
1 | 105
|
|
1 | 106
|
|
1 | 107
|
|
1 | 108
|
|
1 | 109
|
|
1 | 110
|
|
(10 rows)
|
|
|
|
-- unsafe conditions on one side (c8 has a UDT), not pushed down.
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
-> Sort
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Sort Key: t1.c3, t1.c1
|
|
-> Hash Left Join
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3
|
|
Filter: (t1.c8 = 'foo'::user_enum)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3, c8 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3, c8
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(32 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
-----+-----
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- join where unsafe to pushdown condition in WHERE clause has a column not
|
|
-- in the SELECT clause. In this test unsafe clause needs to have column
|
|
-- references from both joining sides so that the clause is not pushed down
|
|
-- into one of the joining sides.
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
-> Sort
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Sort Key: t1.c3, t1.c1
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1, t1.c3
|
|
Hash Cond: ((t1.c1 = t2.c1) AND (t1.c8 = t2.c8))
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c3, t1.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3, c8 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1, t2.c8
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1, t2.c8
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3, c8
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c8
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10;
|
|
c1 | c1
|
|
-----+-----
|
|
101 | 101
|
|
102 | 102
|
|
103 | 103
|
|
104 | 104
|
|
105 | 105
|
|
106 | 106
|
|
107 | 107
|
|
108 | 108
|
|
109 | 109
|
|
110 | 110
|
|
(10 rows)
|
|
|
|
-- Aggregate after UNION, for testing setrefs
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------
|
|
Limit
|
|
Output: t1.c1, (avg((t1.c1 + t2.c1)))
|
|
-> Sort
|
|
Output: t1.c1, (avg((t1.c1 + t2.c1)))
|
|
Sort Key: t1.c1
|
|
-> HashAggregate
|
|
Output: t1.c1, avg((t1.c1 + t2.c1))
|
|
Group By Key: t1.c1
|
|
-> HashAggregate
|
|
Output: t1.c1, t2.c1
|
|
Group By Key: t1.c1, t2.c1
|
|
-> Append
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 3
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 4
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 3: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 4: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(61 rows)
|
|
|
|
SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10;
|
|
t1c1 | avg
|
|
------+----------------------
|
|
101 | 202.0000000000000000
|
|
102 | 204.0000000000000000
|
|
103 | 206.0000000000000000
|
|
104 | 208.0000000000000000
|
|
105 | 210.0000000000000000
|
|
106 | 212.0000000000000000
|
|
107 | 214.0000000000000000
|
|
108 | 216.0000000000000000
|
|
109 | 218.0000000000000000
|
|
110 | 220.0000000000000000
|
|
(10 rows)
|
|
|
|
-- non-Var items in targetlist of the nullable rel of a join preventing
|
|
-- push-down in some cases
|
|
-- unable to push {ft1, ft2}
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Nested Loop Left Join
|
|
Output: (13), ft2.c1
|
|
Join Filter: (13 = ft2.c1)
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" >= 10)) AND (("C 1" <= 15)) ORDER BY "C 1" ASC NULLS LAST
|
|
-> Materialize
|
|
Output: (13)
|
|
-> Foreign Scan on public.ft1
|
|
Output: 13
|
|
Node ID: 2
|
|
Remote SQL: SELECT NULL FROM "S 1"."T 1" WHERE (("C 1" = 13))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" >= 10)) AND (("C 1" <= 15)) ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> Vector Sort
|
|
Output: "C 1"
|
|
Sort Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Filter: (("T 1"."C 1" >= 10) AND ("T 1"."C 1" <= 15))
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT NULL FROM "S 1"."T 1" WHERE (("C 1" = 13))
|
|
Row Adapter
|
|
Output: (NULL::text)
|
|
-> CStore Index Only Scan using t1_pkey on "S 1"."T 1"
|
|
Output: NULL::text
|
|
Index Cond: ("T 1"."C 1" = 13)
|
|
|
|
(31 rows)
|
|
|
|
SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15;
|
|
a | c1
|
|
----+----
|
|
| 10
|
|
| 11
|
|
| 12
|
|
13 | 13
|
|
| 14
|
|
| 15
|
|
(6 rows)
|
|
|
|
-- ok to push {ft1, ft2} but not {ft1, ft2, ft4}
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------
|
|
Nested Loop Left Join
|
|
Output: ft4.c1, (13), ft1.c1, ft2.c1
|
|
Join Filter: (ft4.c1 = ft1.c1)
|
|
-> Foreign Scan on public.ft4
|
|
Output: ft4.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 10)) AND ((c1 <= 15))
|
|
-> Materialize
|
|
Output: ft1.c1, ft2.c1, (13)
|
|
-> Nested Loop
|
|
Output: ft1.c1, ft2.c1, 13
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" = 12)) ORDER BY "C 1" ASC NULLS LAST
|
|
-> Foreign Scan on public.ft1
|
|
Output: ft1.c1
|
|
Node ID: 3
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" = 12))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 10)) AND ((c1 <= 15))
|
|
Row Adapter
|
|
Output: c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: c1
|
|
Filter: (("T 3".c1 >= 10) AND ("T 3".c1 <= 15))
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" = 12)) ORDER BY "C 1" ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Index Only Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Index Cond: ("T 1"."C 1" = 12)
|
|
Node 3: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1" WHERE (("C 1" = 12))
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Index Only Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Index Cond: ("T 1"."C 1" = 12)
|
|
|
|
(40 rows)
|
|
|
|
SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15;
|
|
c1 | a | b | c
|
|
----+----+----+----
|
|
10 | | |
|
|
12 | 13 | 12 | 12
|
|
14 | | |
|
|
(3 rows)
|
|
|
|
-- join with nullable side with some columns with null values
|
|
UPDATE ft5 SET c3 = null where c1 % 9 = 0;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 4"
|
|
CONTEXT: Remote SQL command: SELECT c1, c2, ctid, tableoid FROM "S 1"."T 4" WHERE (((c1 % 9) = 0)) FOR UPDATE
|
|
UPDATE "S 1"."T 4" SET c3 = null where c1 % 9 = 0;
|
|
EXPLAIN (VERBOSE, COSTS OFF) -- Inaccurate
|
|
SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2
|
|
Sort Key: ft5.c1
|
|
-> Foreign Scan
|
|
Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2
|
|
Node ID: 1
|
|
Relations: (public.ft5) INNER JOIN (public.ft4)
|
|
Remote SQL: SELECT CASE WHEN (r1.*)::text IS NOT NULL THEN ROW(r1.c1, r1.c2, r1.c3) END, r1.c1, r1.c2, r1.c3, r2.c1, r2.c2 FROM ("S 1"."T 4" r1 INNER JOIN "S 1"."T 3" r2 ON (((r1.c1 = r2.c1)) AND ((r2.c1 >= 10)) AND ((r2.c1 <= 30)) AND ((r1.c1 >= 10)) AND ((r1.c1 <= 30))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT CASE WHEN (r1.*)::text IS NOT NULL THEN ROW(r1.c1, r1.c2, r1.c3) END, r1.c1, r1.c2, r1.c3, r2.c1, r2.c2 FROM ("S 1"."T 4" r1 INNER JOIN "S 1"."T 3" r2 ON (((r1.c1 = r2.c1)) AND ((r2.c1 >= 10)) AND ((r2.c1 <= 30)) AND ((r1.c1 >= 10)) AND ((r1.c1 <= 30))))
|
|
Hash Join
|
|
Output: CASE WHEN ((ROW(r1.c1, r1.c2, r1.c3))::text IS NOT NULL) THEN ROW(r1.c1, r1.c2, r1.c3) ELSE NULL::record END, r1.c1, r1.c2, r1.c3, r2.c1, r2.c2
|
|
Hash Cond: (r2.c1 = r1.c1)
|
|
-> Row Adapter
|
|
Output: r2.c1, r2.c2
|
|
-> CStore Scan on "S 1"."T 3" r2
|
|
Output: r2.c1, r2.c2
|
|
Filter: ((r2.c1 >= 10) AND (r2.c1 <= 30))
|
|
-> Hash
|
|
Output: r1.c1, r1.c2, r1.c3
|
|
-> Row Adapter
|
|
Output: r1.c1, r1.c2, r1.c3
|
|
-> CStore Scan on "S 1"."T 4" r1
|
|
Output: r1.c1, r1.c2, r1.c3
|
|
Filter: ((r1.c1 >= 10) AND (r1.c1 <= 30))
|
|
|
|
(27 rows)
|
|
|
|
SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1;
|
|
ft5 | c1 | c2 | c3 | c1 | c2
|
|
----------------+----+----+--------+----+----
|
|
(12,13,AAA012) | 12 | 13 | AAA012 | 12 | 13
|
|
(18,19,) | 18 | 19 | | 18 | 19
|
|
(24,25,AAA024) | 24 | 25 | AAA024 | 24 | 25
|
|
(30,31,AAA030) | 30 | 31 | AAA030 | 30 | 31
|
|
(4 rows)
|
|
|
|
-- multi-way join involving multiple merge joins
|
|
-- (this case used to have EPQ-related planning problems)
|
|
CREATE TABLE local_tbl (c1 int NOT NULL, c2 int NOT NULL, c3 text, CONSTRAINT local_tbl_pkey PRIMARY KEY (c1)) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "local_tbl_pkey" for table "local_tbl"
|
|
INSERT INTO local_tbl SELECT id, id % 10, to_char(id, 'FM0000') FROM generate_series(1, 1000) id;
|
|
ANALYZE local_tbl;
|
|
SET enable_nestloop TO false;
|
|
SET enable_hashjoin TO false;
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1
|
|
AND ft1.c2 = ft5.c1 AND ft1.c2 = local_tbl.c1 AND ft1.c1 < 100 AND ft2.c1 < 100 FOR UPDATE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "local_tbl"
|
|
SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1
|
|
AND ft1.c2 = ft5.c1 AND ft1.c2 = local_tbl.c1 AND ft1.c1 < 100 AND ft2.c1 < 100 FOR UPDATE;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "local_tbl"
|
|
RESET enable_nestloop;
|
|
RESET enable_hashjoin;
|
|
DROP TABLE local_tbl;
|
|
-- check join pushdown in situations where multiple userids are involved
|
|
CREATE ROLE regress_view_owner sysadmin password 'QWERT@12345';
|
|
CREATE USER MAPPING FOR regress_view_owner SERVER loopback;
|
|
GRANT SELECT ON ft4 TO regress_view_owner;
|
|
GRANT SELECT ON ft5 TO regress_view_owner;
|
|
CREATE VIEW v4 AS SELECT * FROM ft4;
|
|
CREATE VIEW v5 AS SELECT * FROM ft5;
|
|
ALTER VIEW v5 OWNER TO regress_view_owner;
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------
|
|
Limit
|
|
Output: ft4.c1, ft5.c2, ft5.c1
|
|
-> Sort
|
|
Output: ft4.c1, ft5.c2, ft5.c1
|
|
Sort Key: ft4.c1, ft5.c1
|
|
-> Hash Left Join
|
|
Output: ft4.c1, ft5.c2, ft5.c1
|
|
Hash Cond: (ft4.c1 = ft5.c1)
|
|
-> Foreign Scan on public.ft4
|
|
Output: ft4.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 3"
|
|
-> Hash
|
|
Output: ft5.c2, ft5.c1
|
|
-> Foreign Scan on public.ft5
|
|
Output: ft5.c2, ft5.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT c1, c2 FROM "S 1"."T 4"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 3"
|
|
Row Adapter
|
|
Output: c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: c1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1, c2 FROM "S 1"."T 4"
|
|
Row Adapter
|
|
Output: c1, c2
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: c1, c2
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c2
|
|
----+----
|
|
22 |
|
|
24 | 25
|
|
26 |
|
|
28 |
|
|
30 | 31
|
|
32 |
|
|
34 |
|
|
36 | 37
|
|
38 |
|
|
40 |
|
|
(10 rows)
|
|
|
|
ALTER VIEW v4 OWNER TO regress_view_owner;
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: ft4.c1, ft5.c2, ft5.c1
|
|
Node ID: 1
|
|
Relations: (public.ft4) LEFT JOIN (public.ft5)
|
|
Remote SQL: SELECT r6.c1, r9.c2, r9.c1 FROM ("S 1"."T 3" r6 LEFT JOIN "S 1"."T 4" r9 ON (((r6.c1 = r9.c1)))) ORDER BY r6.c1 ASC NULLS LAST, r9.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT r6.c1, r9.c2, r9.c1 FROM ("S 1"."T 3" r6 LEFT JOIN "S 1"."T 4" r9 ON (((r6.c1 = r9.c1)))) ORDER BY r6.c1 ASC NULLS LAST, r9.c1 ASC NULLS LAST LIMIT 10::bigint OFFSET 10::bigint
|
|
Row Adapter
|
|
Output: r6.c1, r9.c2, r9.c1
|
|
-> Vector Limit
|
|
Output: r6.c1, r9.c2, r9.c1
|
|
-> Vector Sort
|
|
Output: r6.c1, r9.c2, r9.c1
|
|
Sort Key: r6.c1, r9.c1
|
|
-> Vector Hash Left Join
|
|
Output: r6.c1, r9.c2, r9.c1
|
|
Hash Cond: (r6.c1 = r9.c1)
|
|
-> CStore Scan on "S 1"."T 3" r6
|
|
Output: r6.c1
|
|
-> CStore Scan on "S 1"."T 4" r9
|
|
Output: r9.c2, r9.c1
|
|
|
|
(23 rows)
|
|
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c2
|
|
----+----
|
|
22 |
|
|
24 | 25
|
|
26 |
|
|
28 |
|
|
30 | 31
|
|
32 |
|
|
34 |
|
|
36 | 37
|
|
38 |
|
|
40 |
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF)
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------
|
|
Limit
|
|
Output: ft4.c1, t2.c2, t2.c1
|
|
-> Sort
|
|
Output: ft4.c1, t2.c2, t2.c1
|
|
Sort Key: ft4.c1, t2.c1
|
|
-> Hash Left Join
|
|
Output: ft4.c1, t2.c2, t2.c1
|
|
Hash Cond: (ft4.c1 = t2.c1)
|
|
-> Foreign Scan on public.ft4
|
|
Output: ft4.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 3"
|
|
-> Hash
|
|
Output: t2.c2, t2.c1
|
|
-> Foreign Scan on public.ft5 t2
|
|
Output: t2.c2, t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT c1, c2 FROM "S 1"."T 4"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 3"
|
|
Row Adapter
|
|
Output: c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: c1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1, c2 FROM "S 1"."T 4"
|
|
Row Adapter
|
|
Output: c1, c2
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: c1, c2
|
|
|
|
(31 rows)
|
|
|
|
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
|
|
c1 | c2
|
|
----+----
|
|
22 |
|
|
24 | 25
|
|
26 |
|
|
28 |
|
|
30 | 31
|
|
32 |
|
|
34 |
|
|
36 | 37
|
|
38 |
|
|
40 |
|
|
(10 rows)
|
|
|
|
ALTER VIEW v4 OWNER TO regress_view_owner;
|
|
-- PlaceHolder
|
|
explain(verbose, costs off) select * from ft1 t1 left join (select c1, case when c2 is not null then 1 else 0 end as cc from ft2) t2 on t1.c1 = t2.c1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------
|
|
Hash Left Join
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8, ft2.c1, (CASE WHEN (ft2.c2 IS NOT NULL) THEN 1 ELSE 0 END)
|
|
Hash Cond: (t1.c1 = ft2.c1)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: ft2.c1, (CASE WHEN (ft2.c2 IS NOT NULL) THEN 1 ELSE 0 END)
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c1, CASE WHEN (ft2.c2 IS NOT NULL) THEN 1 ELSE 0 END
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
|
|
(26 rows)
|
|
|
|
-- cleanup
|
|
DROP OWNED BY regress_view_owner;
|
|
DROP ROLE regress_view_owner;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: Aggregate and grouping queries
|
|
-- --------------------------------------
|
|
-- openGauss not support filter
|
|
-- ======================================================================================================================================
|
|
-- Simple aggregates
|
|
explain (verbose, costs off)
|
|
select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(c6)), (sum(c1)), (avg(c1)), (min(c2)), (max(c1)), (stddev(c2)), ((sum(c1)) * ((random() <= 1::double precision))::integer), c2
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2 FROM "S 1"."T 1" WHERE ((c2 < 5)) GROUP BY 7 ORDER BY count(c6) ASC NULLS LAST, sum("C 1") ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2 FROM "S 1"."T 1" WHERE ((c2 < 5)) GROUP BY 7 ORDER BY count(c6) ASC NULLS LAST, sum("C 1") ASC NULLS LAST
|
|
Row Adapter
|
|
Output: (count(c6)), (sum("C 1")), (avg("C 1")), (min(c2)), (max("C 1")), (stddev(c2)), c2
|
|
-> Vector Sort
|
|
Output: (count(c6)), (sum("C 1")), (avg("C 1")), (min(c2)), (max("C 1")), (stddev(c2)), c2
|
|
Sort Key: (count("T 1".c6)), (sum("T 1"."C 1"))
|
|
-> Vector Hash Aggregate
|
|
Output: count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2
|
|
Group By Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, c6, "C 1"
|
|
Filter: ("T 1".c2 < 5)
|
|
|
|
(20 rows)
|
|
|
|
select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2;
|
|
count | sum | avg | min | max | stddev | sum2
|
|
-------+-------+----------------------+-----+------+--------+-------
|
|
100 | 49600 | 496.0000000000000000 | 1 | 991 | 0 | 49600
|
|
100 | 49700 | 497.0000000000000000 | 2 | 992 | 0 | 49700
|
|
100 | 49800 | 498.0000000000000000 | 3 | 993 | 0 | 49800
|
|
100 | 49900 | 499.0000000000000000 | 4 | 994 | 0 | 49900
|
|
100 | 50500 | 505.0000000000000000 | 0 | 1000 | 0 | 50500
|
|
(5 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(c6)), (sum(c1)), (avg(c1)), (min(c2)), (max(c1)), (stddev(c2)), ((sum(c1)) * ((random() <= 1::double precision))::integer), c2
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2 FROM "S 1"."T 1" WHERE ((c2 < 5)) GROUP BY 7 ORDER BY count(c6) ASC NULLS LAST, sum("C 1") ASC NULLS LAST LIMIT 1::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2 FROM "S 1"."T 1" WHERE ((c2 < 5)) GROUP BY 7 ORDER BY count(c6) ASC NULLS LAST, sum("C 1") ASC NULLS LAST LIMIT 1::bigint
|
|
Row Adapter
|
|
Output: (count(c6)), (sum("C 1")), (avg("C 1")), (min(c2)), (max("C 1")), (stddev(c2)), c2
|
|
-> Vector Limit
|
|
Output: (count(c6)), (sum("C 1")), (avg("C 1")), (min(c2)), (max("C 1")), (stddev(c2)), c2
|
|
-> Vector Sort
|
|
Output: (count(c6)), (sum("C 1")), (avg("C 1")), (min(c2)), (max("C 1")), (stddev(c2)), c2
|
|
Sort Key: (count("T 1".c6)), (sum("T 1"."C 1"))
|
|
-> Vector Hash Aggregate
|
|
Output: count(c6), sum("C 1"), avg("C 1"), min(c2), max("C 1"), stddev(c2), c2
|
|
Group By Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, c6, "C 1"
|
|
Filter: ("T 1".c2 < 5)
|
|
|
|
(22 rows)
|
|
|
|
select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1;
|
|
count | sum | avg | min | max | stddev | sum2
|
|
-------+-------+----------------------+-----+-----+--------+-------
|
|
100 | 49600 | 496.0000000000000000 | 1 | 991 | 0 | 49600
|
|
(1 row)
|
|
|
|
-- Aggregate is not pushed down as aggregation contains random()
|
|
explain (verbose, costs off)
|
|
select sum(c1 * (random() <= 1)::int) as sum, avg(c1) from ft1;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: sum((c1 * ((random() <= 1::double precision))::integer)), avg(c1)
|
|
-> Foreign Scan on public.ft1
|
|
Output: c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(14 rows)
|
|
|
|
-- Aggregate over join query
|
|
explain (verbose, costs off)
|
|
select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(*)), (sum(t1.c1)), (avg(t2.c1))
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft1 t1) INNER JOIN (public.ft1 t2))
|
|
Remote SQL: SELECT count(*), sum(r1."C 1"), avg(r2."C 1") FROM ("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r2.c2 = 6)) AND ((r1.c2 = 6))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(*), sum(r1."C 1"), avg(r2."C 1") FROM ("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r2.c2 = 6)) AND ((r1.c2 = 6))))
|
|
Row Adapter
|
|
Output: (count(*)), (sum(r1."C 1")), (avg(r2."C 1"))
|
|
-> Vector Aggregate
|
|
Output: count(*), sum(r1."C 1"), avg(r2."C 1")
|
|
-> Vector Nest Loop
|
|
Output: r1."C 1", r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r1
|
|
Output: r1."C 1"
|
|
Filter: (r1.c2 = 6)
|
|
-> Vector Materialize
|
|
Output: r2."C 1"
|
|
-> CStore Scan on "S 1"."T 1" r2
|
|
Output: r2."C 1"
|
|
Filter: (r2.c2 = 6)
|
|
|
|
(23 rows)
|
|
|
|
select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6;
|
|
count | sum | avg
|
|
-------+---------+----------------------
|
|
10000 | 5010000 | 501.0000000000000000
|
|
(1 row)
|
|
|
|
-- Not pushed down due to local conditions present in underneath input rel
|
|
explain (verbose, costs off) -- Inaccurate
|
|
select sum(t1.c1), count(t2.c1) from ft1 t1 inner join ft2 t2 on (t1.c1 = t2.c1) where ((t1.c1 * t2.c1)/(t1.c1 * t2.c1)) * random() <= 1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: sum(t1.c1), count(t2.c1)
|
|
-> Hash Join
|
|
Output: t1.c1, t2.c1
|
|
Hash Cond: (t1.c1 = t2.c1)
|
|
Join Filter: ((((t1.c1 * t2.c1) / (t1.c1 * t2.c1)) * random()) <= 1::double precision)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: t2.c1
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(29 rows)
|
|
|
|
-- GROUP BY clause having expressions
|
|
explain (verbose, costs off)
|
|
select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: ((c2 / 2)), (((sum(c2))::double precision * (c2 / 2)))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT (c2 / 2), (sum(c2) * (c2 / 2)) FROM "S 1"."T 1" GROUP BY 1 ORDER BY (c2 / 2) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT (c2 / 2), (sum(c2) * (c2 / 2)) FROM "S 1"."T 1" GROUP BY 1 ORDER BY (c2 / 2) ASC NULLS LAST
|
|
Row Adapter
|
|
Output: ((c2 / 2)), (((sum(c2))::double precision * ((c2 / 2))))
|
|
-> Vector Sort
|
|
Output: ((c2 / 2)), (((sum(c2))::double precision * ((c2 / 2))))
|
|
Sort Key: (("T 1".c2 / 2))
|
|
-> Vector Hash Aggregate
|
|
Output: ((c2 / 2)), ((sum(c2))::double precision * ((c2 / 2)))
|
|
Group By Key: ("T 1".c2 / 2)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: (c2 / 2), c2
|
|
|
|
(19 rows)
|
|
|
|
select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2;
|
|
?column? | ?column?
|
|
----------+----------
|
|
0 | 0
|
|
.5 | 50
|
|
1 | 200
|
|
1.5 | 450
|
|
2 | 800
|
|
2.5 | 1250
|
|
3 | 1800
|
|
3.5 | 2450
|
|
4 | 3200
|
|
4.5 | 4050
|
|
(10 rows)
|
|
|
|
-- Aggregates in subquery are pushed down.
|
|
explain (verbose, costs off)
|
|
select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(ft1.c2), sum(ft1.c2)
|
|
-> Foreign Scan
|
|
Output: ft1.c2, (sum(ft1.c1)), (sqrt((ft1.c1)::double precision))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT c2, sum("C 1"), sqrt("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 ORDER BY c2 ASC NULLS LAST, sum("C 1") ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2, sum("C 1"), sqrt("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 ORDER BY c2 ASC NULLS LAST, sum("C 1") ASC NULLS LAST
|
|
Row Adapter
|
|
Output: c2, (sum("C 1")), (sqrt(("C 1")::double precision))
|
|
-> Vector Sort
|
|
Output: c2, (sum("C 1")), (sqrt(("C 1")::double precision))
|
|
Sort Key: "T 1".c2, (sum("T 1"."C 1"))
|
|
-> Vector Hash Aggregate
|
|
Output: c2, sum("C 1"), (sqrt(("C 1")::double precision))
|
|
Group By Key: "T 1".c2, sqrt(("T 1"."C 1")::double precision)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, sqrt(("C 1")::double precision), "C 1"
|
|
|
|
(21 rows)
|
|
|
|
select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x;
|
|
count | sum
|
|
-------+------
|
|
1000 | 4500
|
|
(1 row)
|
|
|
|
-- Aggregate is still pushed down by taking unshippable expression out
|
|
explain (verbose, costs off)
|
|
select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by c2 order by 1, 2;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: ((c2 * ((random() <= 1::double precision))::integer)), ((sum(c1) * c2)), c2
|
|
Sort Key: ((ft1.c2 * ((random() <= 1::double precision))::integer)), ((sum(ft1.c1) * ft1.c2))
|
|
-> HashAggregate
|
|
Output: (c2 * ((random() <= 1::double precision))::integer), (sum(c1) * c2), c2
|
|
Group By Key: ft1.c2
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
|
|
(18 rows)
|
|
|
|
select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by c2 order by 1, 2;
|
|
sum1 | sum2
|
|
------+--------
|
|
0 | 0
|
|
1 | 49600
|
|
2 | 99400
|
|
3 | 149400
|
|
4 | 199600
|
|
5 | 250000
|
|
6 | 300600
|
|
7 | 351400
|
|
8 | 402400
|
|
9 | 453600
|
|
(10 rows)
|
|
|
|
-- Aggregate with unshippable GROUP BY clause are not pushed
|
|
explain (verbose, costs off)
|
|
select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::int order by 1;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------
|
|
Group
|
|
Output: ((c2 * ((random() <= 1::double precision))::integer))
|
|
Group By Key: ((ft2.c2 * ((random() <= 1::double precision))::integer))
|
|
-> Sort
|
|
Output: ((c2 * ((random() <= 1::double precision))::integer))
|
|
Sort Key: ((ft2.c2 * ((random() <= 1::double precision))::integer))
|
|
-> Foreign Scan on public.ft2
|
|
Output: (c2 * ((random() <= 1::double precision))::integer)
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
|
|
(18 rows)
|
|
|
|
-- GROUP BY clause in various forms, cardinal, alias and constant expression
|
|
explain (verbose, costs off)
|
|
select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(c2)), c2, (5), (7.0), (9)
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT count(c2), c2, 5, 7.0, 9 FROM "S 1"."T 1" GROUP BY 2, 3, 5 ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(c2), c2, 5, 7.0, 9 FROM "S 1"."T 1" GROUP BY 2, 3, 5 ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: (count(c2)), c2, (5), (7.0), (9)
|
|
-> Vector Sort
|
|
Output: (count(c2)), c2, (5), (7.0), (9)
|
|
Sort Key: "T 1".c2
|
|
-> Vector Sonic Hash Aggregate
|
|
Output: count(c2), c2, (5), 7.0, (9)
|
|
Group By Key: "T 1".c2, 5, 9
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, 5, 9
|
|
|
|
(19 rows)
|
|
|
|
select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2;
|
|
w | x | y | z
|
|
-----+---+---+-----
|
|
100 | 0 | 5 | 7.0
|
|
100 | 1 | 5 | 7.0
|
|
100 | 2 | 5 | 7.0
|
|
100 | 3 | 5 | 7.0
|
|
100 | 4 | 5 | 7.0
|
|
100 | 5 | 5 | 7.0
|
|
100 | 6 | 5 | 7.0
|
|
100 | 7 | 5 | 7.0
|
|
100 | 8 | 5 | 7.0
|
|
100 | 9 | 5 | 7.0
|
|
(10 rows)
|
|
|
|
-- GROUP BY clause referring to same column multiple times
|
|
-- Also, ORDER BY contains an aggregate function
|
|
explain (verbose, costs off)
|
|
select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1);
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: c2, c2, (sum(c1))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT c2, c2, sum("C 1") FROM "S 1"."T 1" WHERE ((c2 > 6)) GROUP BY 1, 2 ORDER BY sum("C 1") ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2, c2, sum("C 1") FROM "S 1"."T 1" WHERE ((c2 > 6)) GROUP BY 1, 2 ORDER BY sum("C 1") ASC NULLS LAST
|
|
Row Adapter
|
|
Output: c2, c2, (sum("C 1"))
|
|
-> Vector Sort
|
|
Output: c2, c2, (sum("C 1"))
|
|
Sort Key: (sum("T 1"."C 1"))
|
|
-> Vector Sonic Hash Aggregate
|
|
Output: c2, c2, sum("C 1")
|
|
Group By Key: "T 1".c2, "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, "C 1"
|
|
Filter: ("T 1".c2 > 6)
|
|
|
|
(20 rows)
|
|
|
|
select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1);
|
|
c2 | c2
|
|
----+----
|
|
7 | 7
|
|
8 | 8
|
|
9 | 9
|
|
(3 rows)
|
|
|
|
-- Testing HAVING clause shippability
|
|
explain (verbose, costs off)
|
|
select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: c2, (sum(c1))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft2)
|
|
Remote SQL: SELECT c2, sum("C 1") FROM "S 1"."T 1" GROUP BY 1 HAVING ((avg("C 1") < 500::numeric)) AND ((sum("C 1") < 49800)) ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2, sum("C 1") FROM "S 1"."T 1" GROUP BY 1 HAVING ((avg("C 1") < 500::numeric)) AND ((sum("C 1") < 49800)) ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: c2, (sum("C 1"))
|
|
-> Vector Sort
|
|
Output: c2, (sum("C 1"))
|
|
Sort Key: "T 1".c2
|
|
-> Vector Sonic Hash Aggregate
|
|
Output: c2, sum("C 1")
|
|
Group By Key: "T 1".c2
|
|
Filter: ((avg("T 1"."C 1") < 500::numeric) AND (sum("T 1"."C 1") < 49800))
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, "C 1"
|
|
|
|
(20 rows)
|
|
|
|
select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2;
|
|
c2 | sum
|
|
----+-------
|
|
1 | 49600
|
|
2 | 49700
|
|
(2 rows)
|
|
|
|
-- Unshippable HAVING clause will be evaluated locally, and other qual in HAVING clause is pushed down
|
|
explain (verbose, costs off)
|
|
select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having (avg(c1) / avg(c1)) * random() <= 1 and avg(c1) < 500) x;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(*)
|
|
-> Foreign Scan
|
|
Output: ft1.c5, (count(ft1.c1)), (sqrt((ft1.c2)::double precision))
|
|
Filter: (((((avg(ft1.c1)) / (avg(ft1.c1))))::double precision * random()) <= 1::double precision)
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT c5, count("C 1"), sqrt(c2), avg("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 HAVING ((avg("C 1") < 500::numeric))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c5, count("C 1"), sqrt(c2), avg("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 HAVING ((avg("C 1") < 500::numeric))
|
|
Row Adapter
|
|
Output: c5, (count("C 1")), (sqrt((c2)::double precision)), (avg("C 1"))
|
|
-> Vector Hash Aggregate
|
|
Output: c5, count("C 1"), (sqrt((c2)::double precision)), avg("C 1")
|
|
Group By Key: "T 1".c5, sqrt(("T 1".c2)::double precision)
|
|
Filter: (avg("T 1"."C 1") < 500::numeric)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c5, sqrt((c2)::double precision), "C 1"
|
|
|
|
(20 rows)
|
|
|
|
select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having (avg(c1) / avg(c1)) * random() <= 1 and avg(c1) < 500) x;
|
|
count
|
|
-------
|
|
49
|
|
(1 row)
|
|
|
|
-- Aggregate in HAVING clause is not pushable, and thus aggregation is not pushed down
|
|
explain (verbose, costs off)
|
|
select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 order by 1;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: (sum(c1)), c2
|
|
Sort Key: (sum(ft1.c1))
|
|
-> HashAggregate
|
|
Output: sum(c1), c2
|
|
Group By Key: ft1.c2
|
|
Filter: (avg((ft1.c1 * ((random() <= 1::double precision))::integer)) > 100::numeric)
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
|
|
(19 rows)
|
|
|
|
-- Remote aggregate in combination with a local Param (for the output
|
|
-- of an initplan) can be trouble, per bug #15781
|
|
explain (verbose, costs off)
|
|
select exists(select 1 from pg_enum), sum(c1) from ft1;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: $0, (sum(ft1.c1))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT sum("C 1") FROM "S 1"."T 1"
|
|
InitPlan 1 (returns $0)
|
|
-> Seq Scan on pg_catalog.pg_enum
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT sum("C 1") FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: (sum("C 1"))
|
|
-> Vector Aggregate
|
|
Output: sum("C 1")
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(17 rows)
|
|
|
|
select exists(select 1 from pg_enum), sum(c1) from ft1;
|
|
exists | sum
|
|
--------+--------
|
|
t | 500500
|
|
(1 row)
|
|
|
|
explain (verbose, costs off)
|
|
select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------
|
|
GroupAggregate
|
|
Output: ($0), sum(ft1.c1)
|
|
Group By Key: $0
|
|
InitPlan 1 (returns $0)
|
|
-> Seq Scan on pg_catalog.pg_enum
|
|
-> Foreign Scan on public.ft1
|
|
Output: $0, ft1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(17 rows)
|
|
|
|
select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1;
|
|
exists | sum
|
|
--------+--------
|
|
t | 500500
|
|
(1 row)
|
|
|
|
-- Testing ORDER BY, DISTINCT, FILTER, Ordered-sets and VARIADIC within aggregates
|
|
-- ORDER BY within aggregate, same column used to order
|
|
explain (verbose, costs off)
|
|
select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (array_agg(c1 ORDER BY c1)), c2
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT array_agg("C 1" ORDER BY "C 1" ASC NULLS LAST), c2 FROM "S 1"."T 1" WHERE (("C 1" < 100)) GROUP BY 2 ORDER BY array_agg("C 1" ORDER BY "C 1" ASC NULLS LAST) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT array_agg("C 1" ORDER BY "C 1" ASC NULLS LAST), c2 FROM "S 1"."T 1" WHERE (("C 1" < 100)) GROUP BY 2 ORDER BY array_agg("C 1" ORDER BY "C 1" ASC NULLS LAST) ASC NULLS LAST
|
|
Sort
|
|
Output: (array_agg("C 1" ORDER BY "C 1")), c2
|
|
Sort Key: (array_agg("T 1"."C 1" ORDER BY "T 1"."C 1"))
|
|
-> GroupAggregate
|
|
Output: array_agg("C 1" ORDER BY "C 1"), c2
|
|
Group By Key: "T 1".c2
|
|
-> Sort
|
|
Output: c2, "C 1"
|
|
Sort Key: "T 1".c2
|
|
-> Row Adapter
|
|
Output: c2, "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, "C 1"
|
|
Filter: ("T 1"."C 1" < 100)
|
|
|
|
(23 rows)
|
|
|
|
select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1;
|
|
array_agg
|
|
--------------------------------
|
|
{1,11,21,31,41,51,61,71,81,91}
|
|
{2,12,22,32,42,52,62,72,82,92}
|
|
{3,13,23,33,43,53,63,73,83,93}
|
|
{4,14,24,34,44,54,64,74,84,94}
|
|
{5,15,25,35,45,55,65,75,85,95}
|
|
{6,16,26,36,46,56,66,76,86,96}
|
|
{7,17,27,37,47,57,67,77,87,97}
|
|
{8,18,28,38,48,58,68,78,88,98}
|
|
{9,19,29,39,49,59,69,79,89,99}
|
|
{10,20,30,40,50,60,70,80,90}
|
|
(10 rows)
|
|
|
|
-- ORDER BY within aggregate, different column used to order also using DESC
|
|
explain (verbose, costs off)
|
|
select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (array_agg(c5 ORDER BY c1 DESC))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft2)
|
|
Remote SQL: SELECT array_agg(c5 ORDER BY "C 1" DESC NULLS FIRST) FROM "S 1"."T 1" WHERE (("C 1" < 50)) AND ((c2 = 6))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT array_agg(c5 ORDER BY "C 1" DESC NULLS FIRST) FROM "S 1"."T 1" WHERE (("C 1" < 50)) AND ((c2 = 6))
|
|
Aggregate
|
|
Output: array_agg(c5 ORDER BY "C 1" DESC)
|
|
-> Row Adapter
|
|
Output: c5, "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c5, "C 1"
|
|
Filter: (("T 1"."C 1" < 50) AND ("T 1".c2 = 6))
|
|
|
|
(16 rows)
|
|
|
|
select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50;
|
|
array_agg
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
{"Mon Feb 16 00:00:00 1970","Fri Feb 06 00:00:00 1970","Tue Jan 27 00:00:00 1970","Sat Jan 17 00:00:00 1970","Wed Jan 07 00:00:00 1970"}
|
|
(1 row)
|
|
|
|
-- DISTINCT within aggregate
|
|
explain (verbose, costs off)
|
|
select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (array_agg(DISTINCT (t1.c1 % 5))), ((t2.c1 % 3))
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft4 t1) FULL JOIN (public.ft5 t2))
|
|
Remote SQL: SELECT array_agg(DISTINCT (r1.c1 % 5)), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5)) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT array_agg(DISTINCT (r1.c1 % 5)), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5)) ASC NULLS LAST
|
|
Sort
|
|
Output: (array_agg(DISTINCT (r1.c1 % 5))), ((r2.c1 % 3))
|
|
Sort Key: (array_agg(DISTINCT (r1.c1 % 5)))
|
|
-> GroupAggregate
|
|
Output: array_agg(DISTINCT (r1.c1 % 5)), ((r2.c1 % 3))
|
|
Group By Key: ((r2.c1 % 3))
|
|
-> Sort
|
|
Output: ((r2.c1 % 3)), r1.c1
|
|
Sort Key: ((r2.c1 % 3))
|
|
-> Hash Full Join
|
|
Output: (r2.c1 % 3), r1.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
Filter: ((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(32 rows)
|
|
|
|
select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
array_agg
|
|
--------------
|
|
{0,1,2,3,4}
|
|
{1,2,3,NULL}
|
|
(2 rows)
|
|
|
|
-- DISTINCT combined with ORDER BY within aggregate
|
|
explain (verbose, costs off)
|
|
select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))), ((t2.c1 % 3))
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft4 t1) FULL JOIN (public.ft5 t2))
|
|
Remote SQL: SELECT array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) ASC NULLS LAST), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) ASC NULLS LAST) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) ASC NULLS LAST), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) ASC NULLS LAST) ASC NULLS LAST
|
|
Sort
|
|
Output: (array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5))), ((r2.c1 % 3))
|
|
Sort Key: (array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5)))
|
|
-> GroupAggregate
|
|
Output: array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5)), ((r2.c1 % 3))
|
|
Group By Key: ((r2.c1 % 3))
|
|
-> Sort
|
|
Output: ((r2.c1 % 3)), r1.c1
|
|
Sort Key: ((r2.c1 % 3))
|
|
-> Hash Full Join
|
|
Output: (r2.c1 % 3), r1.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
Filter: ((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(32 rows)
|
|
|
|
select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
array_agg
|
|
--------------
|
|
{0,1,2,3,4}
|
|
{1,2,3,NULL}
|
|
(2 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5) DESC NULLS LAST)), ((t2.c1 % 3))
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft4 t1) FULL JOIN (public.ft5 t2))
|
|
Remote SQL: SELECT array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) DESC NULLS LAST), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) DESC NULLS LAST) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) DESC NULLS LAST), (r2.c1 % 3) FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) WHERE (((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))) GROUP BY 2 ORDER BY array_agg(DISTINCT (r1.c1 % 5) ORDER BY ((r1.c1 % 5)) DESC NULLS LAST) ASC NULLS LAST
|
|
Sort
|
|
Output: (array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5) DESC NULLS LAST)), ((r2.c1 % 3))
|
|
Sort Key: (array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5) DESC NULLS LAST))
|
|
-> GroupAggregate
|
|
Output: array_agg(DISTINCT (r1.c1 % 5) ORDER BY (r1.c1 % 5) DESC NULLS LAST), ((r2.c1 % 3))
|
|
Group By Key: ((r2.c1 % 3))
|
|
-> Sort
|
|
Output: ((r2.c1 % 3)), r1.c1
|
|
Sort Key: ((r2.c1 % 3))
|
|
-> Hash Full Join
|
|
Output: (r2.c1 % 3), r1.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
Filter: ((r1.c1 < 20) OR ((r1.c1 IS NULL) AND (r2.c1 < 5)))
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(32 rows)
|
|
|
|
select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1;
|
|
array_agg
|
|
--------------
|
|
{3,2,1,NULL}
|
|
{4,3,2,1,0}
|
|
(2 rows)
|
|
|
|
-- Input relation to aggregate push down hook is not safe to pushdown and thus
|
|
-- the aggregate cannot be pushed down to foreign server.
|
|
explain (verbose, costs off)
|
|
select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2);
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(t1.c3)
|
|
-> Nested Loop Left Join
|
|
Output: t1.c3
|
|
Join Filter: ((t1.c1)::double precision = (random() * (t2.c2)::double precision))
|
|
-> Foreign Scan on public.ft2 t1
|
|
Output: t1.c3, t1.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
-> Materialize
|
|
Output: t2.c2
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c2
|
|
Node ID: 2
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c3
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
|
|
(28 rows)
|
|
|
|
-- Subquery in FROM clause having aggregate
|
|
explain (verbose, costs off)
|
|
select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x where ft1.c2 = x.a group by x.b order by 1, 2;
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: (count(*)), x.b
|
|
Sort Key: (count(*)), x.b
|
|
-> HashAggregate
|
|
Output: count(*), x.b
|
|
Group By Key: x.b
|
|
-> Hash Join
|
|
Output: x.b
|
|
Hash Cond: (public.ft1.c2 = x.a)
|
|
-> Foreign Scan on public.ft1
|
|
Output: public.ft1.c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: x.b, x.a
|
|
-> Subquery Scan on x
|
|
Output: x.b, x.a
|
|
-> Foreign Scan
|
|
Output: public.ft1.c2, (sum(public.ft1.c1))
|
|
Node ID: 2
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT c2, sum("C 1") FROM "S 1"."T 1" GROUP BY 1
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2, sum("C 1") FROM "S 1"."T 1" GROUP BY 1
|
|
Row Adapter
|
|
Output: c2, (sum("C 1"))
|
|
-> Vector Sonic Hash Aggregate
|
|
Output: c2, sum("C 1")
|
|
Group By Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2, "C 1"
|
|
|
|
(38 rows)
|
|
|
|
select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x where ft1.c2 = x.a group by x.b order by 1, 2;
|
|
count | b
|
|
-------+-------
|
|
100 | 49600
|
|
100 | 49700
|
|
100 | 49800
|
|
100 | 49900
|
|
100 | 50000
|
|
100 | 50100
|
|
100 | 50200
|
|
100 | 50300
|
|
100 | 50400
|
|
100 | 50500
|
|
(10 rows)
|
|
|
|
-- FULL join with IS NULL check in HAVING
|
|
explain (verbose, costs off)
|
|
select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) group by t2.c1 having (avg(t1.c1) is null and sum(t2.c1) < 10) or sum(t2.c1) is null order by 1 nulls last, 2;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (avg(t1.c1)), (sum(t2.c1)), t2.c1
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft4 t1) FULL JOIN (public.ft5 t2))
|
|
Remote SQL: SELECT avg(r1.c1), sum(r2.c1), r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) GROUP BY 3 HAVING ((((avg(r1.c1) IS NULL) AND (sum(r2.c1) < 10)) OR (sum(r2.c1) IS NULL))) ORDER BY avg(r1.c1) ASC NULLS LAST, sum(r2.c1) ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT avg(r1.c1), sum(r2.c1), r2.c1 FROM ("S 1"."T 3" r1 FULL JOIN "S 1"."T 4" r2 ON (((r1.c1 = r2.c1)))) GROUP BY 3 HAVING ((((avg(r1.c1) IS NULL) AND (sum(r2.c1) < 10)) OR (sum(r2.c1) IS NULL))) ORDER BY avg(r1.c1) ASC NULLS LAST, sum(r2.c1) ASC NULLS LAST
|
|
Sort
|
|
Output: (avg(r1.c1)), (sum(r2.c1)), r2.c1
|
|
Sort Key: (avg(r1.c1)), (sum(r2.c1))
|
|
-> HashAggregate
|
|
Output: avg(r1.c1), sum(r2.c1), r2.c1
|
|
Group By Key: r2.c1
|
|
Filter: (((avg(r1.c1) IS NULL) AND (sum(r2.c1) < 10)) OR (sum(r2.c1) IS NULL))
|
|
-> Hash Full Join
|
|
Output: r1.c1, r2.c1
|
|
Hash Cond: (r1.c1 = r2.c1)
|
|
-> Row Adapter
|
|
Output: r1.c1
|
|
-> CStore Scan on "S 1"."T 3" r1
|
|
Output: r1.c1
|
|
-> Hash
|
|
Output: r2.c1
|
|
-> Row Adapter
|
|
Output: r2.c1
|
|
-> CStore Scan on "S 1"."T 4" r2
|
|
Output: r2.c1
|
|
|
|
(29 rows)
|
|
|
|
select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) group by t2.c1 having (avg(t1.c1) is null and sum(t2.c1) < 10) or sum(t2.c1) is null order by 1 nulls last, 2;
|
|
avg | sum
|
|
---------------------+-----
|
|
51.0000000000000000 |
|
|
| 3
|
|
| 9
|
|
(3 rows)
|
|
|
|
-- Aggregate over FULL join needing to deparse the joining relations as
|
|
-- subqueries.
|
|
explain (verbose, costs off)
|
|
select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1);
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(*)), (sum(ft4.c1)), (avg(ft5.c1))
|
|
Node ID: 1
|
|
Relations: Aggregate on ((public.ft4) FULL JOIN (public.ft5))
|
|
Remote SQL: SELECT count(*), sum(s4.c1), avg(s5.c1) FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5(c1) ON (((s4.c1 = s5.c1))))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(*), sum(s4.c1), avg(s5.c1) FROM ((SELECT c1 FROM "S 1"."T 3" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s4(c1) FULL JOIN (SELECT c1 FROM "S 1"."T 4" WHERE ((c1 >= 50)) AND ((c1 <= 60))) s5(c1) ON (((s4.c1 = s5.c1))))
|
|
Aggregate
|
|
Output: count(*), sum("T 3".c1), avg("T 4".c1)
|
|
-> Hash Full Join
|
|
Output: "T 3".c1, "T 4".c1
|
|
Hash Cond: ("T 3".c1 = "T 4".c1)
|
|
-> Row Adapter
|
|
Output: "T 3".c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: "T 3".c1
|
|
Filter: (("T 3".c1 >= 50) AND ("T 3".c1 <= 60))
|
|
-> Hash
|
|
Output: "T 4".c1
|
|
-> Row Adapter
|
|
Output: "T 4".c1
|
|
-> CStore Scan on "S 1"."T 4"
|
|
Output: "T 4".c1
|
|
Filter: (("T 4".c1 >= 50) AND ("T 4".c1 <= 60))
|
|
|
|
(26 rows)
|
|
|
|
select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1);
|
|
count | sum | avg
|
|
-------+-----+---------------------
|
|
8 | 330 | 55.5000000000000000
|
|
(1 row)
|
|
|
|
-- ORDER BY expression is part of the target list but not pushed down to
|
|
-- foreign server.
|
|
explain (verbose, costs off)
|
|
select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------
|
|
Sort
|
|
Output: ((sum(c2) * ((random() <= 1::double precision))::integer))
|
|
Sort Key: ((sum(ft1.c2) * ((random() <= 1::double precision))::integer))
|
|
-> Aggregate
|
|
Output: (sum(c2) * ((random() <= 1::double precision))::integer)
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
|
|
(17 rows)
|
|
|
|
select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1;
|
|
sum
|
|
------
|
|
4500
|
|
(1 row)
|
|
|
|
-- Check with placeHolderVars
|
|
explain (verbose, costs off)
|
|
select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: sum(q.a), count(q.b)
|
|
-> Nested Loop Left Join
|
|
Output: q.a, q.b
|
|
Join Filter: ((ft4.c1)::numeric <= q.b)
|
|
-> Foreign Scan on public.ft4
|
|
Output: ft4.c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT c1 FROM "S 1"."T 3"
|
|
-> Materialize
|
|
Output: q.a, q.b
|
|
-> Subquery Scan on q
|
|
Output: q.a, q.b
|
|
-> Aggregate
|
|
Output: 13, avg(ft1.c1), sum(ft2.c1)
|
|
-> Hash Right Join
|
|
Output: ft2.c1, ft1.c1
|
|
Hash Cond: (ft1.c1 = ft2.c1)
|
|
-> Foreign Scan on public.ft1
|
|
Output: ft1.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
-> Hash
|
|
Output: ft2.c1
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c1
|
|
Node ID: 3
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c1 FROM "S 1"."T 3"
|
|
Row Adapter
|
|
Output: c1
|
|
-> CStore Scan on "S 1"."T 3"
|
|
Output: c1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
Node 3: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1"
|
|
|
|
(46 rows)
|
|
|
|
select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b);
|
|
sum | count
|
|
-----+-------
|
|
650 | 50
|
|
(1 row)
|
|
|
|
-- Not supported cases
|
|
-- Grouping sets
|
|
explain (verbose, costs off)
|
|
select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (sum(c1))
|
|
Sort Key: ft1.c2
|
|
-> GroupAggregate
|
|
Output: c2, sum(c1)
|
|
Group By Key: ft1.c2
|
|
Group By Key: ()
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> Vector Sort
|
|
Output: "C 1", c2
|
|
Sort Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Filter: ("T 1".c2 < 3)
|
|
|
|
(23 rows)
|
|
|
|
select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last;
|
|
c2 | sum
|
|
----+--------
|
|
0 | 50500
|
|
1 | 49600
|
|
2 | 49700
|
|
| 149800
|
|
(4 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (sum(c1))
|
|
Sort Key: ft1.c2
|
|
-> GroupAggregate
|
|
Output: c2, sum(c1)
|
|
Group By Key: ft1.c2
|
|
Group By Key: ()
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> Vector Sort
|
|
Output: "C 1", c2
|
|
Sort Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Filter: ("T 1".c2 < 3)
|
|
|
|
(23 rows)
|
|
|
|
select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last;
|
|
c2 | sum
|
|
----+--------
|
|
0 | 50500
|
|
1 | 49600
|
|
2 | 49700
|
|
| 149800
|
|
(4 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, c6, (sum(c1))
|
|
Sort Key: ft1.c2, ft1.c6
|
|
-> GroupAggregate
|
|
Output: c2, c6, sum(c1)
|
|
Group By Key: ft1.c2
|
|
Sort Key: ft1.c6
|
|
Group By Key: ft1.c6
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c6, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c6 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c6 FROM "S 1"."T 1" WHERE ((c2 < 3)) ORDER BY c2 ASC NULLS LAST
|
|
Row Adapter
|
|
Output: "C 1", c2, c6
|
|
-> Vector Sort
|
|
Output: "C 1", c2, c6
|
|
Sort Key: "T 1".c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c6
|
|
Filter: ("T 1".c2 < 3)
|
|
|
|
(24 rows)
|
|
|
|
select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last;
|
|
c2 | c6 | sum
|
|
----+----+-------
|
|
0 | | 50500
|
|
1 | | 49600
|
|
2 | | 49700
|
|
| 0 | 50500
|
|
| 1 | 49600
|
|
| 2 | 49700
|
|
(6 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (sum(c1)), (GROUPING(c2))
|
|
Sort Key: ft1.c2
|
|
-> HashAggregate
|
|
Output: c2, sum(c1), GROUPING(c2)
|
|
Group By Key: ft1.c2
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 3))
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Filter: ("T 1".c2 < 3)
|
|
|
|
(19 rows)
|
|
|
|
select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last;
|
|
c2 | sum | grouping
|
|
----+-------+----------
|
|
0 | 50500 | 0
|
|
1 | 49600 | 0
|
|
2 | 49700 | 0
|
|
(3 rows)
|
|
|
|
-- DISTINCT itself is not pushed down, whereas underneath aggregate is pushed
|
|
explain (verbose, costs off)
|
|
select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------
|
|
Unique
|
|
Output: ((sum(c1) / 1000)), c2
|
|
-> Sort
|
|
Output: ((sum(c1) / 1000)), c2
|
|
Sort Key: ((sum(ft2.c1) / 1000))
|
|
-> HashAggregate
|
|
Output: (sum(c1) / 1000), c2
|
|
Group By Key: ft2.c2
|
|
-> Foreign Scan on public.ft2
|
|
Output: c2, c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 6))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE ((c2 < 6))
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Filter: ("T 1".c2 < 6)
|
|
|
|
(21 rows)
|
|
|
|
select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1;
|
|
s
|
|
------
|
|
49.6
|
|
49.7
|
|
49.8
|
|
49.9
|
|
50
|
|
50.5
|
|
(6 rows)
|
|
|
|
-- WindowAgg
|
|
explain (verbose, costs off)
|
|
select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (sum(c2)), (count(c2) OVER (PARTITION BY ((c2 % 2)))), ((c2 % 2))
|
|
Sort Key: ft2.c2
|
|
-> WindowAgg
|
|
Output: c2, (sum(c2)), count(c2) OVER (PARTITION BY ((c2 % 2))), ((c2 % 2))
|
|
-> Sort
|
|
Output: c2, ((c2 % 2)), (sum(c2))
|
|
Sort Key: ((ft2.c2 % 2))
|
|
-> GroupAggregate
|
|
Output: c2, (c2 % 2), sum(c2)
|
|
Group By Key: ft2.c2
|
|
-> Sort
|
|
Output: c2
|
|
Sort Key: ft2.c2
|
|
-> Foreign Scan on public.ft2
|
|
Output: c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
Filter: ("T 1".c2 < 10)
|
|
|
|
(27 rows)
|
|
|
|
select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1;
|
|
c2 | sum | count
|
|
----+-----+-------
|
|
0 | 0 | 5
|
|
1 | 100 | 5
|
|
2 | 200 | 5
|
|
3 | 300 | 5
|
|
4 | 400 | 5
|
|
5 | 500 | 5
|
|
6 | 600 | 5
|
|
7 | 700 | 5
|
|
8 | 800 | 5
|
|
9 | 900 | 5
|
|
(10 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (array_agg(c2) OVER (PARTITION BY ((c2 % 2)) ORDER BY c2 USING = NULLS LAST)), ((c2 % 2))
|
|
Sort Key: ft1.c2
|
|
-> WindowAgg
|
|
Output: c2, array_agg(c2) OVER (PARTITION BY ((c2 % 2)) ORDER BY c2 USING = NULLS LAST), ((c2 % 2))
|
|
-> Sort
|
|
Output: c2, ((c2 % 2))
|
|
Sort Key: ((ft1.c2 % 2)), ft1.c2 DESC
|
|
-> HashAggregate
|
|
Output: c2, (c2 % 2)
|
|
Group By Key: ft1.c2
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
Filter: ("T 1".c2 < 10)
|
|
|
|
(24 rows)
|
|
|
|
select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1;
|
|
c2 | array_agg
|
|
----+-------------
|
|
0 | {8,6,4,2,0}
|
|
1 | {9,7,5,3,1}
|
|
2 | {8,6,4,2}
|
|
3 | {9,7,5,3}
|
|
4 | {8,6,4}
|
|
5 | {9,7,5}
|
|
6 | {8,6}
|
|
7 | {9,7}
|
|
8 | {8}
|
|
9 | {9}
|
|
(10 rows)
|
|
|
|
explain (verbose, costs off)
|
|
select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: c2, (array_agg(c2) OVER (PARTITION BY ((c2 % 2)) ORDER BY c2 USING = NULLS LAST RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)), ((c2 % 2))
|
|
Sort Key: ft1.c2
|
|
-> WindowAgg
|
|
Output: c2, array_agg(c2) OVER (PARTITION BY ((c2 % 2)) ORDER BY c2 USING = NULLS LAST RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), ((c2 % 2))
|
|
-> Sort
|
|
Output: c2, ((c2 % 2))
|
|
Sort Key: ((ft1.c2 % 2)), ft1.c2
|
|
-> HashAggregate
|
|
Output: c2, (c2 % 2)
|
|
Group By Key: ft1.c2
|
|
-> Foreign Scan on public.ft1
|
|
Output: c2
|
|
Node ID: 1
|
|
Remote SQL: SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c2 FROM "S 1"."T 1" WHERE ((c2 < 10))
|
|
Row Adapter
|
|
Output: c2
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: c2
|
|
Filter: ("T 1".c2 < 10)
|
|
|
|
(24 rows)
|
|
|
|
select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1;
|
|
c2 | array_agg
|
|
----+-------------
|
|
0 | {0,2,4,6,8}
|
|
1 | {1,3,5,7,9}
|
|
2 | {2,4,6,8}
|
|
3 | {3,5,7,9}
|
|
4 | {4,6,8}
|
|
5 | {5,7,9}
|
|
6 | {6,8}
|
|
7 | {7,9}
|
|
8 | {8}
|
|
9 | {9}
|
|
(10 rows)
|
|
|
|
-- Same group by
|
|
explain verbose select c1,c1,c1,count(*) from ft1 group by 1,1,1;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------
|
|
HashAggregate (cost=147.00..157.00 rows=1000 width=12)
|
|
Output: c1, c1, c1, count(*)
|
|
Group By Key: ft1.c1
|
|
-> Foreign Scan on public.ft1 (cost=100.00..142.00 rows=1000 width=4)
|
|
Output: c1
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1" FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS ON) SELECT "C 1" FROM "S 1"."T 1"
|
|
Row Adapter (cost=345.00..345.00 rows=1000 width=4)
|
|
Output: "C 1"
|
|
-> CStore Scan on "S 1"."T 1" (cost=0.00..345.00 rows=1000 width=4)
|
|
Output: "C 1"
|
|
|
|
(15 rows)
|
|
|
|
set enable_hashagg = off;
|
|
explain verbose select c1,c1,c1,count(*) from ft1 group by 1,1,1;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------
|
|
Foreign Scan (cost=105.00..157.00 rows=1000 width=0)
|
|
Output: c1, c1, c1, (count(*))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT "C 1", count(*) FROM "S 1"."T 1" GROUP BY 1
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS ON) SELECT "C 1", count(*) FROM "S 1"."T 1" GROUP BY 1
|
|
Row Adapter (cost=360.00..360.00 rows=1000 width=12)
|
|
Output: "C 1", (count(*))
|
|
-> Vector Sonic Hash Aggregate (cost=350.00..360.00 rows=1000 width=12)
|
|
Output: "C 1", count(*)
|
|
Group By Key: "T 1"."C 1"
|
|
-> CStore Scan on "S 1"."T 1" (cost=0.00..345.00 rows=1000 width=4)
|
|
Output: "C 1"
|
|
|
|
(16 rows)
|
|
|
|
set enable_hashagg = on;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: parameterized queries
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
-- simple join
|
|
PREPARE st1(int, int) AS SELECT t1.c3, t2.c3 FROM ft1 t1, ft2 t2 WHERE t1.c1 = $1 AND t2.c1 = $2;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st1(1, 2);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: t1.c3, t2.c3
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c3
|
|
Node ID: 1
|
|
Remote SQL: SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c3
|
|
Node ID: 2
|
|
Remote SQL: SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
|
|
|
(19 rows)
|
|
|
|
EXECUTE st1(1, 1);
|
|
c3 | c3
|
|
-------+-------
|
|
00001 | 00001
|
|
(1 row)
|
|
|
|
EXECUTE st1(101, 101);
|
|
c3 | c3
|
|
-------+-------
|
|
00101 | 00101
|
|
(1 row)
|
|
|
|
-- subquery using stable function (can't be sent to remote)
|
|
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND "date"(c4) = '1970-01-17'::date) ORDER BY c1;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Sort Key: t1.c1
|
|
-> Hash Semi Join
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Hash Cond: (t1.c3 = t2.c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" < $1::integer))
|
|
-> Hash
|
|
Output: t2.c3
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c3
|
|
Filter: ("date"(t2.c4) = 'Sat Jan 17 00:00:00 1970'::timestamp(0) without time zone)
|
|
Node ID: 2
|
|
Remote SQL: SELECT c3, c4 FROM "S 1"."T 1" WHERE (("C 1" > $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" < $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c3, c4 FROM "S 1"."T 1" WHERE (("C 1" > $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
|
|
|
(26 rows)
|
|
|
|
EXECUTE st2(10, 20);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
16 | 6 | 00016 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
(1 row)
|
|
|
|
EXECUTE st2(101, 121);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
-----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
116 | 6 | 00116 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
(1 row)
|
|
|
|
-- subquery using immutable function (can be sent to remote)
|
|
PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND "date"(c5) = '1970-01-17'::date) ORDER BY c1;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Sort
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Sort Key: t1.c1
|
|
-> Hash Semi Join
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Hash Cond: (t1.c3 = t2.c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" < $1::integer))
|
|
-> Hash
|
|
Output: t2.c3
|
|
-> Foreign Scan on public.ft2 t2
|
|
Output: t2.c3
|
|
Node ID: 2
|
|
Remote SQL: SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" > $1::integer)) AND (("date"(c5) = '1970-01-17 00:00:00'::timestamp(0) without time zone)) ORDER BY c3 ASC NULLS LAST
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" < $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT c3 FROM "S 1"."T 1" WHERE (("C 1" > $1::integer)) AND (("date"(c5) = '1970-01-17 00:00:00'::timestamp(0) without time zone)) ORDER BY c3 ASC NULLS LAST
|
|
failed to get remote plan, error massage is:
|
|
current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
|
|
|
(25 rows)
|
|
|
|
EXECUTE st3(10, 20);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
16 | 6 | 00016 | Sat Jan 17 00:00:00 1970 PST | Sat Jan 17 00:00:00 1970 | 6 | 6 | foo
|
|
(1 row)
|
|
|
|
EXECUTE st3(20, 30);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+----+----+----+----+----+----
|
|
(0 rows)
|
|
|
|
-- custom plan should be chosen initially
|
|
PREPARE st4(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 = $1;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
-- once we try it enough times, should switch to generic plan
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(10 rows)
|
|
|
|
-- value of $1 should not be sent to remote
|
|
PREPARE st5(user_enum,int) AS SELECT * FROM ft1 t1 WHERE c8 = $1 and c1 = $2;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1);
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Filter: (t1.c8 = $1)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
|
failed to get remote plan, error massage is:
|
|
there is no parameter $1
|
|
|
|
(11 rows)
|
|
|
|
EXECUTE st5('foo', 1);
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
-- altering FDW options requires replanning
|
|
PREPARE st6 AS SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = c2))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = c2))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 1"."C 1" = "T 1".c2)
|
|
|
|
(13 rows)
|
|
|
|
PREPARE st7 AS INSERT INTO ft1 (c1,c2,c3) VALUES (1001,101,'foo');
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Insert on public.ft1
|
|
-> Result
|
|
Output: NULL::integer, 1001, 101, 'foo'::text, NULL::timestamp with time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::user_enum
|
|
(3 rows)
|
|
|
|
ALTER TABLE "S 1"."T 1" RENAME TO "T 0";
|
|
ALTER FOREIGN TABLE ft1 OPTIONS (SET table_name 'T 0');
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft1 t1
|
|
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 0" WHERE (("C 1" = c2))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 0" WHERE (("C 1" = c2))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Scan on "S 1"."T 0"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Filter: ("T 0"."C 1" = "T 0".c2)
|
|
|
|
(13 rows)
|
|
|
|
EXECUTE st6;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST | Mon Jan 05 00:00:00 1970 | 4 | 4 | foo
|
|
5 | 5 | 00005 | Tue Jan 06 00:00:00 1970 PST | Tue Jan 06 00:00:00 1970 | 5 | 5 | foo
|
|
6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST | Wed Jan 07 00:00:00 1970 | 6 | 6 | foo
|
|
7 | 7 | 00007 | Thu Jan 08 00:00:00 1970 PST | Thu Jan 08 00:00:00 1970 | 7 | 7 | foo
|
|
8 | 8 | 00008 | Fri Jan 09 00:00:00 1970 PST | Fri Jan 09 00:00:00 1970 | 8 | 8 | foo
|
|
9 | 9 | 00009 | Sat Jan 10 00:00:00 1970 PST | Sat Jan 10 00:00:00 1970 | 9 | 9 | foo
|
|
(9 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7;
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Insert on public.ft1
|
|
-> Result
|
|
Output: NULL::integer, 1001, 101, 'foo'::text, NULL::timestamp with time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::user_enum
|
|
(3 rows)
|
|
|
|
ALTER TABLE "S 1"."T 0" RENAME TO "T 1";
|
|
ALTER FOREIGN TABLE ft1 OPTIONS (SET table_name 'T 1');
|
|
PREPARE st8 AS SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2;
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: c3
|
|
Filter: (t1.c1 === t1.c2)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3
|
|
|
|
(15 rows)
|
|
|
|
ALTER SERVER loopback OPTIONS (DROP extensions);
|
|
ERROR: option "extensions" not found
|
|
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(c3)
|
|
-> Foreign Scan on public.ft1 t1
|
|
Output: c3
|
|
Filter: (t1.c1 === t1.c2)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3 FROM "S 1"."T 1"
|
|
Row Adapter
|
|
Output: "C 1", c2, c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3
|
|
|
|
(15 rows)
|
|
|
|
EXECUTE st8;
|
|
count
|
|
-------
|
|
9
|
|
(1 row)
|
|
|
|
ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
|
|
ERROR: invalid option "extensions"
|
|
HINT: Valid options in this context are: service, connect_timeout, dbname, host, remote_nodename, hostaddr, port, localhost, localport, application_name, fencedUdfRPCMode, keepalives, keepalives_idle, keepalives_interval, keepalives_count, tcp_user_timeout, rw_timeout, sslmode, sslcompression, sslcert, sslkey, sslrootcert, sslcrl, requirepeer, krbsrvname, prototype, connection_info, connectionExtraInfo, target_session_attrs, use_remote_estimate, fdw_startup_cost, fdw_tuple_cost, updatable
|
|
-- cleanup
|
|
DEALLOCATE st1;
|
|
DEALLOCATE st2;
|
|
DEALLOCATE st3;
|
|
DEALLOCATE st4;
|
|
DEALLOCATE st5;
|
|
DEALLOCATE st6;
|
|
DEALLOCATE st7;
|
|
DEALLOCATE st8;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: used in PL/pgSQL function
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
CREATE OR REPLACE FUNCTION f_test(p_c1 int) RETURNS int AS $$
|
|
DECLARE
|
|
v_c1 int;
|
|
BEGIN
|
|
SELECT c1 INTO v_c1 FROM ft1 WHERE c1 = p_c1 LIMIT 1;
|
|
PERFORM c1 FROM ft1 WHERE c1 = p_c1 AND p_c1 = v_c1 LIMIT 1;
|
|
RETURN v_c1;
|
|
END;
|
|
$$ LANGUAGE plpgsql;
|
|
SELECT f_test(100);
|
|
f_test
|
|
--------
|
|
100
|
|
(1 row)
|
|
|
|
DROP FUNCTION f_test(int);
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: REINDEX
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
-- remote table is not created here
|
|
CREATE FOREIGN TABLE reindex_foreign (c1 int, c2 int)
|
|
SERVER loopback2 OPTIONS (table_name 'reindex_local');
|
|
REINDEX TABLE reindex_foreign; -- error
|
|
ERROR: "reindex_foreign" is not a table or materialized view
|
|
DROP FOREIGN TABLE reindex_foreign;
|
|
-- partitions and foreign tables
|
|
CREATE TABLE reind_fdw_parent (c1 int) with (orientation=column) PARTITION BY RANGE (c1) (
|
|
partition reind_fdw_0_10 values less than(11),
|
|
partition reind_fdw_10_20 values less than(21)
|
|
);
|
|
CREATE FOREIGN TABLE reind_fdw_10_20_fp(c1 int)
|
|
SERVER loopback OPTIONS (table_name 'reind_fdw_parent');
|
|
CREATE FOREIGN TABLE reind_fdw_10_20_f1(c1 int)
|
|
SERVER loopback OPTIONS (table_name 'reind_fdw_parent partition(reind_fdw_10_20)');
|
|
REINDEX TABLE reind_fdw_10_20_fp; -- error
|
|
ERROR: "reind_fdw_10_20_fp" is not a table or materialized view
|
|
REINDEX TABLE reind_fdw_10_20_f1; -- error
|
|
ERROR: "reind_fdw_10_20_f1" is not a table or materialized view
|
|
REINDEX TABLE reind_fdw_parent; -- ok
|
|
NOTICE: table "reind_fdw_parent" has no indexes
|
|
DROP TABLE reind_fdw_parent;
|
|
DROP FOREIGN TABLE reind_fdw_10_20_fp;
|
|
DROP FOREIGN TABLE reind_fdw_10_20_f1;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: conversion error
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE int;
|
|
SELECT * FROM ft1 ftx(x1,x2,x3,x4,x5,x6,x7,x8) WHERE x1 = 1; -- ERROR
|
|
ERROR: invalid input syntax for integer: "foo"
|
|
CONTEXT: column "x8" of foreign table "ftx"
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT ftx.x1, ft2.c2, ftx.x8 FROM ft1 ftx(x1,x2,x3,x4,x5,x6,x7,x8), ft2
|
|
WHERE ftx.x1 = ft2.c1 AND ftx.x1 = 1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: ftx.x1, ft2.c2, ftx.x8
|
|
-> Foreign Scan on public.ft1 ftx
|
|
Output: ftx.x1, ftx.x8
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c2, ft2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
Row Adapter
|
|
Output: "C 1", c8
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c8
|
|
Index Cond: ("T 1"."C 1" = 1)
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Index Cond: ("T 1"."C 1" = 1)
|
|
|
|
(25 rows)
|
|
|
|
SELECT ftx.x1, ft2.c2, ftx.x8 FROM ft1 ftx(x1,x2,x3,x4,x5,x6,x7,x8), ft2
|
|
WHERE ftx.x1 = ft2.c1 AND ftx.x1 = 1; -- ERROR
|
|
ERROR: invalid input syntax for integer: "foo"
|
|
CONTEXT: column "x8" of foreign table "ftx"
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT ftx.x1, ft2.c2, ftx FROM ft1 ftx(x1,x2,x3,x4,x5,x6,x7,x8), ft2
|
|
WHERE ftx.x1 = ft2.c1 AND ftx.x1 = 1;
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: ftx.x1, ft2.c2, ftx.*
|
|
-> Foreign Scan on public.ft1 ftx
|
|
Output: ftx.x1, ftx.*
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
-> Foreign Scan on public.ft2
|
|
Output: ft2.c2, ft2.c1
|
|
Node ID: 2
|
|
Remote SQL: SELECT "C 1", c2 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
Row Adapter
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
Index Cond: ("T 1"."C 1" = 1)
|
|
Node 2: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2 FROM "S 1"."T 1" WHERE (("C 1" = 1))
|
|
Row Adapter
|
|
Output: "C 1", c2
|
|
-> CStore Index Scan using t1_pkey on "S 1"."T 1"
|
|
Output: "C 1", c2
|
|
Index Cond: ("T 1"."C 1" = 1)
|
|
|
|
(25 rows)
|
|
|
|
SELECT ftx.x1, ft2.c2, ftx FROM ft1 ftx(x1,x2,x3,x4,x5,x6,x7,x8), ft2
|
|
WHERE ftx.x1 = ft2.c1 AND ftx.x1 = 1; -- ERROR
|
|
ERROR: invalid input syntax for integer: "foo"
|
|
CONTEXT: column "x8" of foreign table "ftx"
|
|
SELECT sum(c2), array_agg(c8) FROM ft1 GROUP BY c8; -- ERROR
|
|
ERROR: invalid input syntax for integer: "foo"
|
|
CONTEXT: processing expression at position 2 in select list
|
|
ANALYZE ft1; -- ERROR
|
|
ERROR: invalid input syntax for integer: "foo"
|
|
CONTEXT: column "c8" of foreign table "ft1"
|
|
ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE user_enum;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: subtransaction
|
|
-- + local/remote error doesn't break cursor
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
BEGIN;
|
|
DECLARE c CURSOR FOR SELECT * FROM ft1 ORDER BY c1;
|
|
FETCH c;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
SAVEPOINT s;
|
|
ERROR OUT; -- ERROR
|
|
ERROR: syntax error at or near "ERROR"
|
|
LINE 1: ERROR OUT;
|
|
^
|
|
ROLLBACK TO s;
|
|
FETCH c;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST | Sat Jan 03 00:00:00 1970 | 2 | 2 | foo
|
|
(1 row)
|
|
|
|
SAVEPOINT s;
|
|
SELECT * FROM ft1 WHERE 1 / (c1 - 1) > 0; -- ERROR
|
|
ERROR: division by zero
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (((1 / ("C 1" - 1)) > 0::double precision))
|
|
ROLLBACK TO s;
|
|
FETCH c;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST | Sun Jan 04 00:00:00 1970 | 3 | 3 | foo
|
|
(1 row)
|
|
|
|
SELECT * FROM ft1 ORDER BY c1 LIMIT 1;
|
|
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
|
|
----+----+-------+------------------------------+--------------------------+----+------------+-----
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST | Fri Jan 02 00:00:00 1970 | 1 | 1 | foo
|
|
(1 row)
|
|
|
|
COMMIT;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test handling of collations
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
create table loct3 (f1 text collate "C" unique, f2 text, f3 varchar(10) unique) with (orientation=column);
|
|
NOTICE: CREATE TABLE / UNIQUE will create implicit index "loct3_f1_key" for table "loct3"
|
|
NOTICE: CREATE TABLE / UNIQUE will create implicit index "loct3_f3_key" for table "loct3"
|
|
create foreign table ft3 (f1 text collate "C", f2 text, f3 varchar(10))
|
|
server loopback options (table_name 'loct3', use_remote_estimate 'true');
|
|
-- can be sent to remote
|
|
explain (verbose, costs off) select * from ft3 where f1 = 'foo';
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo'::text))
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
Filter: (loct3.f1 = 'foo'::text)
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f1 COLLATE "C" = 'foo';
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo'::text))
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
Filter: (loct3.f1 = 'foo'::text)
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f2 = 'foo';
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f2 = 'foo'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3 WHERE ((f2 = 'foo'::text))
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
Filter: (loct3.f2 = 'foo'::text)
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f3 = 'foo';
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f3 = 'foo'::text))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3 WHERE ((f3 = 'foo'::text))
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
Filter: ((loct3.f3)::text = 'foo'::text)
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 f, loct3 l
|
|
where f.f3 = l.f3 and l.f1 = 'foo';
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3
|
|
Join Filter: ((f.f3)::text = (l.f3)::text)
|
|
-> Row Adapter
|
|
Output: l.f1, l.f2, l.f3
|
|
-> CStore Scan on public.loct3 l
|
|
Output: l.f1, l.f2, l.f3
|
|
Filter: (l.f1 = 'foo'::text)
|
|
-> Foreign Scan on public.ft3 f
|
|
Output: f.f1, f.f2, f.f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(20 rows)
|
|
|
|
-- can't be sent to remote
|
|
explain (verbose, costs off) select * from ft3 where f1 COLLATE "POSIX" = 'foo';
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Filter: ((ft3.f1)::text = 'foo'::text)
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f1 = 'foo' COLLATE "C";
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Filter: (ft3.f1 = 'foo'::text COLLATE "C")
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f2 COLLATE "C" = 'foo';
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Filter: ((ft3.f2)::text = 'foo'::text)
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C";
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Foreign Scan on public.ft3
|
|
Output: f1, f2, f3
|
|
Filter: (ft3.f2 = 'foo'::text COLLATE "C")
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(13 rows)
|
|
|
|
explain (verbose, costs off) select * from ft3 f, loct3 l
|
|
where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo';
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------
|
|
Nested Loop
|
|
Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3
|
|
Join Filter: ((f.f3)::text = (l.f3)::text)
|
|
-> Row Adapter
|
|
Output: l.f1, l.f2, l.f3
|
|
-> CStore Scan on public.loct3 l
|
|
Output: l.f1, l.f2, l.f3
|
|
Filter: (l.f1 = 'foo'::text)
|
|
-> Foreign Scan on public.ft3 f
|
|
Output: f.f1, f.f2, f.f3
|
|
Node ID: 1
|
|
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT f1, f2, f3 FROM public.loct3
|
|
Row Adapter
|
|
Output: f1, f2, f3
|
|
-> CStore Scan on public.loct3
|
|
Output: f1, f2, f3
|
|
|
|
(20 rows)
|
|
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test writable foreign table stuff
|
|
-- --------------------------------------
|
|
-- currently openGauss not support to update and delete from a foreign table built on a column table.
|
|
-- so it is unusefull.
|
|
-- ======================================================================================================================================
|
|
EXPLAIN (verbose, costs off)
|
|
INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Insert on public.ft2
|
|
-> Subquery Scan on "*SELECT*"
|
|
Output: "*SELECT*"."?column?", "*SELECT*"."?column?", NULL::integer, "*SELECT*"."?column?", NULL::timestamp with time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::user_enum
|
|
-> Foreign Scan on public.ft2
|
|
Output: (public.ft2.c1 + 1000), (public.ft2.c2 + 100), (public.ft2.c3 || public.ft2.c3)
|
|
Node ID: 1
|
|
Remote SQL: SELECT "C 1", c2, c3 FROM "S 1"."T 1" LIMIT 20::bigint
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT "C 1", c2, c3 FROM "S 1"."T 1" LIMIT 20::bigint
|
|
Row Adapter
|
|
Output: "C 1", c2, c3
|
|
-> Vector Limit
|
|
Output: "C 1", c2, c3
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: "C 1", c2, c3
|
|
|
|
(17 rows)
|
|
|
|
INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20;
|
|
INSERT INTO ft2 (c1,c2,c3)
|
|
VALUES (1101,201,'aaa'), (1102,202,'bbb'), (1103,203,'ccc') RETURNING *;
|
|
ERROR: Un-support feature
|
|
DETAIL: column stored relation doesn't support INSERT returning
|
|
CONTEXT: Remote SQL command: INSERT INTO "S 1"."T 1"("C 1", c2, c3, c4, c5, c6, c7, c8) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "C 1", c2, c3, c4, c5, c6, c7, c8
|
|
INSERT INTO ft2 (c1,c2,c3) VALUES (1104,204,'ddd'), (1105,205,'eee');
|
|
EXPLAIN (verbose, costs off)
|
|
UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 3)) FOR UPDATE
|
|
UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 3)) FOR UPDATE
|
|
EXPLAIN (verbose, costs off)
|
|
UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7 RETURNING *;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 7)) FOR UPDATE
|
|
UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7 RETURNING *;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 7)) FOR UPDATE
|
|
EXPLAIN (verbose, costs off)
|
|
UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT
|
|
FROM ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 9;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c8, ctid, tableoid FROM "S 1"."T 1" WHERE (((c2 % 10) = 9)) FOR UPDATE
|
|
UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT
|
|
FROM ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 9;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT "C 1", c2, c3, c4, c5, c6, c8, ctid, tableoid FROM "S 1"."T 1" WHERE (((c2 % 10) = 9)) FOR UPDATE
|
|
EXPLAIN (verbose, costs off)
|
|
DELETE FROM ft2 WHERE c1 % 10 = 5 RETURNING c1, c4;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 5)) FOR UPDATE
|
|
DELETE FROM ft2 WHERE c1 % 10 = 5 RETURNING c1, c4;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT ctid, tableoid FROM "S 1"."T 1" WHERE ((("C 1" % 10) = 5)) FOR UPDATE
|
|
EXPLAIN (verbose, costs off)
|
|
DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT c2, ctid, tableoid FROM "S 1"."T 1" WHERE (((c2 % 10) = 2)) FOR UPDATE
|
|
DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: EXPLAIN SELECT c2, ctid, tableoid FROM "S 1"."T 1" WHERE (((c2 % 10) = 2)) FOR UPDATE
|
|
SELECT c1,c2,c3,c4 FROM ft2 ORDER BY c1;
|
|
c1 | c2 | c3 | c4
|
|
------+-----+------------+------------------------------
|
|
1 | 1 | 00001 | Fri Jan 02 00:00:00 1970 PST
|
|
2 | 2 | 00002 | Sat Jan 03 00:00:00 1970 PST
|
|
3 | 3 | 00003 | Sun Jan 04 00:00:00 1970 PST
|
|
4 | 4 | 00004 | Mon Jan 05 00:00:00 1970 PST
|
|
5 | 5 | 00005 | Tue Jan 06 00:00:00 1970 PST
|
|
6 | 6 | 00006 | Wed Jan 07 00:00:00 1970 PST
|
|
7 | 7 | 00007 | Thu Jan 08 00:00:00 1970 PST
|
|
8 | 8 | 00008 | Fri Jan 09 00:00:00 1970 PST
|
|
9 | 9 | 00009 | Sat Jan 10 00:00:00 1970 PST
|
|
10 | 0 | 00010 | Sun Jan 11 00:00:00 1970 PST
|
|
11 | 1 | 00011 | Mon Jan 12 00:00:00 1970 PST
|
|
12 | 2 | 00012 | Tue Jan 13 00:00:00 1970 PST
|
|
13 | 3 | 00013 | Wed Jan 14 00:00:00 1970 PST
|
|
14 | 4 | 00014 | Thu Jan 15 00:00:00 1970 PST
|
|
15 | 5 | 00015 | Fri Jan 16 00:00:00 1970 PST
|
|
16 | 6 | 00016 | Sat Jan 17 00:00:00 1970 PST
|
|
17 | 7 | 00017 | Sun Jan 18 00:00:00 1970 PST
|
|
18 | 8 | 00018 | Mon Jan 19 00:00:00 1970 PST
|
|
19 | 9 | 00019 | Tue Jan 20 00:00:00 1970 PST
|
|
20 | 0 | 00020 | Wed Jan 21 00:00:00 1970 PST
|
|
21 | 1 | 00021 | Thu Jan 22 00:00:00 1970 PST
|
|
22 | 2 | 00022 | Fri Jan 23 00:00:00 1970 PST
|
|
23 | 3 | 00023 | Sat Jan 24 00:00:00 1970 PST
|
|
24 | 4 | 00024 | Sun Jan 25 00:00:00 1970 PST
|
|
25 | 5 | 00025 | Mon Jan 26 00:00:00 1970 PST
|
|
26 | 6 | 00026 | Tue Jan 27 00:00:00 1970 PST
|
|
27 | 7 | 00027 | Wed Jan 28 00:00:00 1970 PST
|
|
28 | 8 | 00028 | Thu Jan 29 00:00:00 1970 PST
|
|
29 | 9 | 00029 | Fri Jan 30 00:00:00 1970 PST
|
|
30 | 0 | 00030 | Sat Jan 31 00:00:00 1970 PST
|
|
31 | 1 | 00031 | Sun Feb 01 00:00:00 1970 PST
|
|
32 | 2 | 00032 | Mon Feb 02 00:00:00 1970 PST
|
|
33 | 3 | 00033 | Tue Feb 03 00:00:00 1970 PST
|
|
34 | 4 | 00034 | Wed Feb 04 00:00:00 1970 PST
|
|
35 | 5 | 00035 | Thu Feb 05 00:00:00 1970 PST
|
|
36 | 6 | 00036 | Fri Feb 06 00:00:00 1970 PST
|
|
37 | 7 | 00037 | Sat Feb 07 00:00:00 1970 PST
|
|
38 | 8 | 00038 | Sun Feb 08 00:00:00 1970 PST
|
|
39 | 9 | 00039 | Mon Feb 09 00:00:00 1970 PST
|
|
40 | 0 | 00040 | Tue Feb 10 00:00:00 1970 PST
|
|
41 | 1 | 00041 | Wed Feb 11 00:00:00 1970 PST
|
|
42 | 2 | 00042 | Thu Feb 12 00:00:00 1970 PST
|
|
43 | 3 | 00043 | Fri Feb 13 00:00:00 1970 PST
|
|
44 | 4 | 00044 | Sat Feb 14 00:00:00 1970 PST
|
|
45 | 5 | 00045 | Sun Feb 15 00:00:00 1970 PST
|
|
46 | 6 | 00046 | Mon Feb 16 00:00:00 1970 PST
|
|
47 | 7 | 00047 | Tue Feb 17 00:00:00 1970 PST
|
|
48 | 8 | 00048 | Wed Feb 18 00:00:00 1970 PST
|
|
49 | 9 | 00049 | Thu Feb 19 00:00:00 1970 PST
|
|
50 | 0 | 00050 | Fri Feb 20 00:00:00 1970 PST
|
|
51 | 1 | 00051 | Sat Feb 21 00:00:00 1970 PST
|
|
52 | 2 | 00052 | Sun Feb 22 00:00:00 1970 PST
|
|
53 | 3 | 00053 | Mon Feb 23 00:00:00 1970 PST
|
|
54 | 4 | 00054 | Tue Feb 24 00:00:00 1970 PST
|
|
55 | 5 | 00055 | Wed Feb 25 00:00:00 1970 PST
|
|
56 | 6 | 00056 | Thu Feb 26 00:00:00 1970 PST
|
|
57 | 7 | 00057 | Fri Feb 27 00:00:00 1970 PST
|
|
58 | 8 | 00058 | Sat Feb 28 00:00:00 1970 PST
|
|
59 | 9 | 00059 | Sun Mar 01 00:00:00 1970 PST
|
|
60 | 0 | 00060 | Mon Mar 02 00:00:00 1970 PST
|
|
61 | 1 | 00061 | Tue Mar 03 00:00:00 1970 PST
|
|
62 | 2 | 00062 | Wed Mar 04 00:00:00 1970 PST
|
|
63 | 3 | 00063 | Thu Mar 05 00:00:00 1970 PST
|
|
64 | 4 | 00064 | Fri Mar 06 00:00:00 1970 PST
|
|
65 | 5 | 00065 | Sat Mar 07 00:00:00 1970 PST
|
|
66 | 6 | 00066 | Sun Mar 08 00:00:00 1970 PST
|
|
67 | 7 | 00067 | Mon Mar 09 00:00:00 1970 PST
|
|
68 | 8 | 00068 | Tue Mar 10 00:00:00 1970 PST
|
|
69 | 9 | 00069 | Wed Mar 11 00:00:00 1970 PST
|
|
70 | 0 | 00070 | Thu Mar 12 00:00:00 1970 PST
|
|
71 | 1 | 00071 | Fri Mar 13 00:00:00 1970 PST
|
|
72 | 2 | 00072 | Sat Mar 14 00:00:00 1970 PST
|
|
73 | 3 | 00073 | Sun Mar 15 00:00:00 1970 PST
|
|
74 | 4 | 00074 | Mon Mar 16 00:00:00 1970 PST
|
|
75 | 5 | 00075 | Tue Mar 17 00:00:00 1970 PST
|
|
76 | 6 | 00076 | Wed Mar 18 00:00:00 1970 PST
|
|
77 | 7 | 00077 | Thu Mar 19 00:00:00 1970 PST
|
|
78 | 8 | 00078 | Fri Mar 20 00:00:00 1970 PST
|
|
79 | 9 | 00079 | Sat Mar 21 00:00:00 1970 PST
|
|
80 | 0 | 00080 | Sun Mar 22 00:00:00 1970 PST
|
|
81 | 1 | 00081 | Mon Mar 23 00:00:00 1970 PST
|
|
82 | 2 | 00082 | Tue Mar 24 00:00:00 1970 PST
|
|
83 | 3 | 00083 | Wed Mar 25 00:00:00 1970 PST
|
|
84 | 4 | 00084 | Thu Mar 26 00:00:00 1970 PST
|
|
85 | 5 | 00085 | Fri Mar 27 00:00:00 1970 PST
|
|
86 | 6 | 00086 | Sat Mar 28 00:00:00 1970 PST
|
|
87 | 7 | 00087 | Sun Mar 29 00:00:00 1970 PST
|
|
88 | 8 | 00088 | Mon Mar 30 00:00:00 1970 PST
|
|
89 | 9 | 00089 | Tue Mar 31 00:00:00 1970 PST
|
|
90 | 0 | 00090 | Wed Apr 01 00:00:00 1970 PST
|
|
91 | 1 | 00091 | Thu Apr 02 00:00:00 1970 PST
|
|
92 | 2 | 00092 | Fri Apr 03 00:00:00 1970 PST
|
|
93 | 3 | 00093 | Sat Apr 04 00:00:00 1970 PST
|
|
94 | 4 | 00094 | Sun Apr 05 00:00:00 1970 PST
|
|
95 | 5 | 00095 | Mon Apr 06 00:00:00 1970 PST
|
|
96 | 6 | 00096 | Tue Apr 07 00:00:00 1970 PST
|
|
97 | 7 | 00097 | Wed Apr 08 00:00:00 1970 PST
|
|
98 | 8 | 00098 | Thu Apr 09 00:00:00 1970 PST
|
|
99 | 9 | 00099 | Fri Apr 10 00:00:00 1970 PST
|
|
100 | 0 | 00100 | Thu Jan 01 00:00:00 1970 PST
|
|
101 | 1 | 00101 | Fri Jan 02 00:00:00 1970 PST
|
|
102 | 2 | 00102 | Sat Jan 03 00:00:00 1970 PST
|
|
103 | 3 | 00103 | Sun Jan 04 00:00:00 1970 PST
|
|
104 | 4 | 00104 | Mon Jan 05 00:00:00 1970 PST
|
|
105 | 5 | 00105 | Tue Jan 06 00:00:00 1970 PST
|
|
106 | 6 | 00106 | Wed Jan 07 00:00:00 1970 PST
|
|
107 | 7 | 00107 | Thu Jan 08 00:00:00 1970 PST
|
|
108 | 8 | 00108 | Fri Jan 09 00:00:00 1970 PST
|
|
109 | 9 | 00109 | Sat Jan 10 00:00:00 1970 PST
|
|
110 | 0 | 00110 | Sun Jan 11 00:00:00 1970 PST
|
|
111 | 1 | 00111 | Mon Jan 12 00:00:00 1970 PST
|
|
112 | 2 | 00112 | Tue Jan 13 00:00:00 1970 PST
|
|
113 | 3 | 00113 | Wed Jan 14 00:00:00 1970 PST
|
|
114 | 4 | 00114 | Thu Jan 15 00:00:00 1970 PST
|
|
115 | 5 | 00115 | Fri Jan 16 00:00:00 1970 PST
|
|
116 | 6 | 00116 | Sat Jan 17 00:00:00 1970 PST
|
|
117 | 7 | 00117 | Sun Jan 18 00:00:00 1970 PST
|
|
118 | 8 | 00118 | Mon Jan 19 00:00:00 1970 PST
|
|
119 | 9 | 00119 | Tue Jan 20 00:00:00 1970 PST
|
|
120 | 0 | 00120 | Wed Jan 21 00:00:00 1970 PST
|
|
121 | 1 | 00121 | Thu Jan 22 00:00:00 1970 PST
|
|
122 | 2 | 00122 | Fri Jan 23 00:00:00 1970 PST
|
|
123 | 3 | 00123 | Sat Jan 24 00:00:00 1970 PST
|
|
124 | 4 | 00124 | Sun Jan 25 00:00:00 1970 PST
|
|
125 | 5 | 00125 | Mon Jan 26 00:00:00 1970 PST
|
|
126 | 6 | 00126 | Tue Jan 27 00:00:00 1970 PST
|
|
127 | 7 | 00127 | Wed Jan 28 00:00:00 1970 PST
|
|
128 | 8 | 00128 | Thu Jan 29 00:00:00 1970 PST
|
|
129 | 9 | 00129 | Fri Jan 30 00:00:00 1970 PST
|
|
130 | 0 | 00130 | Sat Jan 31 00:00:00 1970 PST
|
|
131 | 1 | 00131 | Sun Feb 01 00:00:00 1970 PST
|
|
132 | 2 | 00132 | Mon Feb 02 00:00:00 1970 PST
|
|
133 | 3 | 00133 | Tue Feb 03 00:00:00 1970 PST
|
|
134 | 4 | 00134 | Wed Feb 04 00:00:00 1970 PST
|
|
135 | 5 | 00135 | Thu Feb 05 00:00:00 1970 PST
|
|
136 | 6 | 00136 | Fri Feb 06 00:00:00 1970 PST
|
|
137 | 7 | 00137 | Sat Feb 07 00:00:00 1970 PST
|
|
138 | 8 | 00138 | Sun Feb 08 00:00:00 1970 PST
|
|
139 | 9 | 00139 | Mon Feb 09 00:00:00 1970 PST
|
|
140 | 0 | 00140 | Tue Feb 10 00:00:00 1970 PST
|
|
141 | 1 | 00141 | Wed Feb 11 00:00:00 1970 PST
|
|
142 | 2 | 00142 | Thu Feb 12 00:00:00 1970 PST
|
|
143 | 3 | 00143 | Fri Feb 13 00:00:00 1970 PST
|
|
144 | 4 | 00144 | Sat Feb 14 00:00:00 1970 PST
|
|
145 | 5 | 00145 | Sun Feb 15 00:00:00 1970 PST
|
|
146 | 6 | 00146 | Mon Feb 16 00:00:00 1970 PST
|
|
147 | 7 | 00147 | Tue Feb 17 00:00:00 1970 PST
|
|
148 | 8 | 00148 | Wed Feb 18 00:00:00 1970 PST
|
|
149 | 9 | 00149 | Thu Feb 19 00:00:00 1970 PST
|
|
150 | 0 | 00150 | Fri Feb 20 00:00:00 1970 PST
|
|
151 | 1 | 00151 | Sat Feb 21 00:00:00 1970 PST
|
|
152 | 2 | 00152 | Sun Feb 22 00:00:00 1970 PST
|
|
153 | 3 | 00153 | Mon Feb 23 00:00:00 1970 PST
|
|
154 | 4 | 00154 | Tue Feb 24 00:00:00 1970 PST
|
|
155 | 5 | 00155 | Wed Feb 25 00:00:00 1970 PST
|
|
156 | 6 | 00156 | Thu Feb 26 00:00:00 1970 PST
|
|
157 | 7 | 00157 | Fri Feb 27 00:00:00 1970 PST
|
|
158 | 8 | 00158 | Sat Feb 28 00:00:00 1970 PST
|
|
159 | 9 | 00159 | Sun Mar 01 00:00:00 1970 PST
|
|
160 | 0 | 00160 | Mon Mar 02 00:00:00 1970 PST
|
|
161 | 1 | 00161 | Tue Mar 03 00:00:00 1970 PST
|
|
162 | 2 | 00162 | Wed Mar 04 00:00:00 1970 PST
|
|
163 | 3 | 00163 | Thu Mar 05 00:00:00 1970 PST
|
|
164 | 4 | 00164 | Fri Mar 06 00:00:00 1970 PST
|
|
165 | 5 | 00165 | Sat Mar 07 00:00:00 1970 PST
|
|
166 | 6 | 00166 | Sun Mar 08 00:00:00 1970 PST
|
|
167 | 7 | 00167 | Mon Mar 09 00:00:00 1970 PST
|
|
168 | 8 | 00168 | Tue Mar 10 00:00:00 1970 PST
|
|
169 | 9 | 00169 | Wed Mar 11 00:00:00 1970 PST
|
|
170 | 0 | 00170 | Thu Mar 12 00:00:00 1970 PST
|
|
171 | 1 | 00171 | Fri Mar 13 00:00:00 1970 PST
|
|
172 | 2 | 00172 | Sat Mar 14 00:00:00 1970 PST
|
|
173 | 3 | 00173 | Sun Mar 15 00:00:00 1970 PST
|
|
174 | 4 | 00174 | Mon Mar 16 00:00:00 1970 PST
|
|
175 | 5 | 00175 | Tue Mar 17 00:00:00 1970 PST
|
|
176 | 6 | 00176 | Wed Mar 18 00:00:00 1970 PST
|
|
177 | 7 | 00177 | Thu Mar 19 00:00:00 1970 PST
|
|
178 | 8 | 00178 | Fri Mar 20 00:00:00 1970 PST
|
|
179 | 9 | 00179 | Sat Mar 21 00:00:00 1970 PST
|
|
180 | 0 | 00180 | Sun Mar 22 00:00:00 1970 PST
|
|
181 | 1 | 00181 | Mon Mar 23 00:00:00 1970 PST
|
|
182 | 2 | 00182 | Tue Mar 24 00:00:00 1970 PST
|
|
183 | 3 | 00183 | Wed Mar 25 00:00:00 1970 PST
|
|
184 | 4 | 00184 | Thu Mar 26 00:00:00 1970 PST
|
|
185 | 5 | 00185 | Fri Mar 27 00:00:00 1970 PST
|
|
186 | 6 | 00186 | Sat Mar 28 00:00:00 1970 PST
|
|
187 | 7 | 00187 | Sun Mar 29 00:00:00 1970 PST
|
|
188 | 8 | 00188 | Mon Mar 30 00:00:00 1970 PST
|
|
189 | 9 | 00189 | Tue Mar 31 00:00:00 1970 PST
|
|
190 | 0 | 00190 | Wed Apr 01 00:00:00 1970 PST
|
|
191 | 1 | 00191 | Thu Apr 02 00:00:00 1970 PST
|
|
192 | 2 | 00192 | Fri Apr 03 00:00:00 1970 PST
|
|
193 | 3 | 00193 | Sat Apr 04 00:00:00 1970 PST
|
|
194 | 4 | 00194 | Sun Apr 05 00:00:00 1970 PST
|
|
195 | 5 | 00195 | Mon Apr 06 00:00:00 1970 PST
|
|
196 | 6 | 00196 | Tue Apr 07 00:00:00 1970 PST
|
|
197 | 7 | 00197 | Wed Apr 08 00:00:00 1970 PST
|
|
198 | 8 | 00198 | Thu Apr 09 00:00:00 1970 PST
|
|
199 | 9 | 00199 | Fri Apr 10 00:00:00 1970 PST
|
|
200 | 0 | 00200 | Thu Jan 01 00:00:00 1970 PST
|
|
201 | 1 | 00201 | Fri Jan 02 00:00:00 1970 PST
|
|
202 | 2 | 00202 | Sat Jan 03 00:00:00 1970 PST
|
|
203 | 3 | 00203 | Sun Jan 04 00:00:00 1970 PST
|
|
204 | 4 | 00204 | Mon Jan 05 00:00:00 1970 PST
|
|
205 | 5 | 00205 | Tue Jan 06 00:00:00 1970 PST
|
|
206 | 6 | 00206 | Wed Jan 07 00:00:00 1970 PST
|
|
207 | 7 | 00207 | Thu Jan 08 00:00:00 1970 PST
|
|
208 | 8 | 00208 | Fri Jan 09 00:00:00 1970 PST
|
|
209 | 9 | 00209 | Sat Jan 10 00:00:00 1970 PST
|
|
210 | 0 | 00210 | Sun Jan 11 00:00:00 1970 PST
|
|
211 | 1 | 00211 | Mon Jan 12 00:00:00 1970 PST
|
|
212 | 2 | 00212 | Tue Jan 13 00:00:00 1970 PST
|
|
213 | 3 | 00213 | Wed Jan 14 00:00:00 1970 PST
|
|
214 | 4 | 00214 | Thu Jan 15 00:00:00 1970 PST
|
|
215 | 5 | 00215 | Fri Jan 16 00:00:00 1970 PST
|
|
216 | 6 | 00216 | Sat Jan 17 00:00:00 1970 PST
|
|
217 | 7 | 00217 | Sun Jan 18 00:00:00 1970 PST
|
|
218 | 8 | 00218 | Mon Jan 19 00:00:00 1970 PST
|
|
219 | 9 | 00219 | Tue Jan 20 00:00:00 1970 PST
|
|
220 | 0 | 00220 | Wed Jan 21 00:00:00 1970 PST
|
|
221 | 1 | 00221 | Thu Jan 22 00:00:00 1970 PST
|
|
222 | 2 | 00222 | Fri Jan 23 00:00:00 1970 PST
|
|
223 | 3 | 00223 | Sat Jan 24 00:00:00 1970 PST
|
|
224 | 4 | 00224 | Sun Jan 25 00:00:00 1970 PST
|
|
225 | 5 | 00225 | Mon Jan 26 00:00:00 1970 PST
|
|
226 | 6 | 00226 | Tue Jan 27 00:00:00 1970 PST
|
|
227 | 7 | 00227 | Wed Jan 28 00:00:00 1970 PST
|
|
228 | 8 | 00228 | Thu Jan 29 00:00:00 1970 PST
|
|
229 | 9 | 00229 | Fri Jan 30 00:00:00 1970 PST
|
|
230 | 0 | 00230 | Sat Jan 31 00:00:00 1970 PST
|
|
231 | 1 | 00231 | Sun Feb 01 00:00:00 1970 PST
|
|
232 | 2 | 00232 | Mon Feb 02 00:00:00 1970 PST
|
|
233 | 3 | 00233 | Tue Feb 03 00:00:00 1970 PST
|
|
234 | 4 | 00234 | Wed Feb 04 00:00:00 1970 PST
|
|
235 | 5 | 00235 | Thu Feb 05 00:00:00 1970 PST
|
|
236 | 6 | 00236 | Fri Feb 06 00:00:00 1970 PST
|
|
237 | 7 | 00237 | Sat Feb 07 00:00:00 1970 PST
|
|
238 | 8 | 00238 | Sun Feb 08 00:00:00 1970 PST
|
|
239 | 9 | 00239 | Mon Feb 09 00:00:00 1970 PST
|
|
240 | 0 | 00240 | Tue Feb 10 00:00:00 1970 PST
|
|
241 | 1 | 00241 | Wed Feb 11 00:00:00 1970 PST
|
|
242 | 2 | 00242 | Thu Feb 12 00:00:00 1970 PST
|
|
243 | 3 | 00243 | Fri Feb 13 00:00:00 1970 PST
|
|
244 | 4 | 00244 | Sat Feb 14 00:00:00 1970 PST
|
|
245 | 5 | 00245 | Sun Feb 15 00:00:00 1970 PST
|
|
246 | 6 | 00246 | Mon Feb 16 00:00:00 1970 PST
|
|
247 | 7 | 00247 | Tue Feb 17 00:00:00 1970 PST
|
|
248 | 8 | 00248 | Wed Feb 18 00:00:00 1970 PST
|
|
249 | 9 | 00249 | Thu Feb 19 00:00:00 1970 PST
|
|
250 | 0 | 00250 | Fri Feb 20 00:00:00 1970 PST
|
|
251 | 1 | 00251 | Sat Feb 21 00:00:00 1970 PST
|
|
252 | 2 | 00252 | Sun Feb 22 00:00:00 1970 PST
|
|
253 | 3 | 00253 | Mon Feb 23 00:00:00 1970 PST
|
|
254 | 4 | 00254 | Tue Feb 24 00:00:00 1970 PST
|
|
255 | 5 | 00255 | Wed Feb 25 00:00:00 1970 PST
|
|
256 | 6 | 00256 | Thu Feb 26 00:00:00 1970 PST
|
|
257 | 7 | 00257 | Fri Feb 27 00:00:00 1970 PST
|
|
258 | 8 | 00258 | Sat Feb 28 00:00:00 1970 PST
|
|
259 | 9 | 00259 | Sun Mar 01 00:00:00 1970 PST
|
|
260 | 0 | 00260 | Mon Mar 02 00:00:00 1970 PST
|
|
261 | 1 | 00261 | Tue Mar 03 00:00:00 1970 PST
|
|
262 | 2 | 00262 | Wed Mar 04 00:00:00 1970 PST
|
|
263 | 3 | 00263 | Thu Mar 05 00:00:00 1970 PST
|
|
264 | 4 | 00264 | Fri Mar 06 00:00:00 1970 PST
|
|
265 | 5 | 00265 | Sat Mar 07 00:00:00 1970 PST
|
|
266 | 6 | 00266 | Sun Mar 08 00:00:00 1970 PST
|
|
267 | 7 | 00267 | Mon Mar 09 00:00:00 1970 PST
|
|
268 | 8 | 00268 | Tue Mar 10 00:00:00 1970 PST
|
|
269 | 9 | 00269 | Wed Mar 11 00:00:00 1970 PST
|
|
270 | 0 | 00270 | Thu Mar 12 00:00:00 1970 PST
|
|
271 | 1 | 00271 | Fri Mar 13 00:00:00 1970 PST
|
|
272 | 2 | 00272 | Sat Mar 14 00:00:00 1970 PST
|
|
273 | 3 | 00273 | Sun Mar 15 00:00:00 1970 PST
|
|
274 | 4 | 00274 | Mon Mar 16 00:00:00 1970 PST
|
|
275 | 5 | 00275 | Tue Mar 17 00:00:00 1970 PST
|
|
276 | 6 | 00276 | Wed Mar 18 00:00:00 1970 PST
|
|
277 | 7 | 00277 | Thu Mar 19 00:00:00 1970 PST
|
|
278 | 8 | 00278 | Fri Mar 20 00:00:00 1970 PST
|
|
279 | 9 | 00279 | Sat Mar 21 00:00:00 1970 PST
|
|
280 | 0 | 00280 | Sun Mar 22 00:00:00 1970 PST
|
|
281 | 1 | 00281 | Mon Mar 23 00:00:00 1970 PST
|
|
282 | 2 | 00282 | Tue Mar 24 00:00:00 1970 PST
|
|
283 | 3 | 00283 | Wed Mar 25 00:00:00 1970 PST
|
|
284 | 4 | 00284 | Thu Mar 26 00:00:00 1970 PST
|
|
285 | 5 | 00285 | Fri Mar 27 00:00:00 1970 PST
|
|
286 | 6 | 00286 | Sat Mar 28 00:00:00 1970 PST
|
|
287 | 7 | 00287 | Sun Mar 29 00:00:00 1970 PST
|
|
288 | 8 | 00288 | Mon Mar 30 00:00:00 1970 PST
|
|
289 | 9 | 00289 | Tue Mar 31 00:00:00 1970 PST
|
|
290 | 0 | 00290 | Wed Apr 01 00:00:00 1970 PST
|
|
291 | 1 | 00291 | Thu Apr 02 00:00:00 1970 PST
|
|
292 | 2 | 00292 | Fri Apr 03 00:00:00 1970 PST
|
|
293 | 3 | 00293 | Sat Apr 04 00:00:00 1970 PST
|
|
294 | 4 | 00294 | Sun Apr 05 00:00:00 1970 PST
|
|
295 | 5 | 00295 | Mon Apr 06 00:00:00 1970 PST
|
|
296 | 6 | 00296 | Tue Apr 07 00:00:00 1970 PST
|
|
297 | 7 | 00297 | Wed Apr 08 00:00:00 1970 PST
|
|
298 | 8 | 00298 | Thu Apr 09 00:00:00 1970 PST
|
|
299 | 9 | 00299 | Fri Apr 10 00:00:00 1970 PST
|
|
300 | 0 | 00300 | Thu Jan 01 00:00:00 1970 PST
|
|
301 | 1 | 00301 | Fri Jan 02 00:00:00 1970 PST
|
|
302 | 2 | 00302 | Sat Jan 03 00:00:00 1970 PST
|
|
303 | 3 | 00303 | Sun Jan 04 00:00:00 1970 PST
|
|
304 | 4 | 00304 | Mon Jan 05 00:00:00 1970 PST
|
|
305 | 5 | 00305 | Tue Jan 06 00:00:00 1970 PST
|
|
306 | 6 | 00306 | Wed Jan 07 00:00:00 1970 PST
|
|
307 | 7 | 00307 | Thu Jan 08 00:00:00 1970 PST
|
|
308 | 8 | 00308 | Fri Jan 09 00:00:00 1970 PST
|
|
309 | 9 | 00309 | Sat Jan 10 00:00:00 1970 PST
|
|
310 | 0 | 00310 | Sun Jan 11 00:00:00 1970 PST
|
|
311 | 1 | 00311 | Mon Jan 12 00:00:00 1970 PST
|
|
312 | 2 | 00312 | Tue Jan 13 00:00:00 1970 PST
|
|
313 | 3 | 00313 | Wed Jan 14 00:00:00 1970 PST
|
|
314 | 4 | 00314 | Thu Jan 15 00:00:00 1970 PST
|
|
315 | 5 | 00315 | Fri Jan 16 00:00:00 1970 PST
|
|
316 | 6 | 00316 | Sat Jan 17 00:00:00 1970 PST
|
|
317 | 7 | 00317 | Sun Jan 18 00:00:00 1970 PST
|
|
318 | 8 | 00318 | Mon Jan 19 00:00:00 1970 PST
|
|
319 | 9 | 00319 | Tue Jan 20 00:00:00 1970 PST
|
|
320 | 0 | 00320 | Wed Jan 21 00:00:00 1970 PST
|
|
321 | 1 | 00321 | Thu Jan 22 00:00:00 1970 PST
|
|
322 | 2 | 00322 | Fri Jan 23 00:00:00 1970 PST
|
|
323 | 3 | 00323 | Sat Jan 24 00:00:00 1970 PST
|
|
324 | 4 | 00324 | Sun Jan 25 00:00:00 1970 PST
|
|
325 | 5 | 00325 | Mon Jan 26 00:00:00 1970 PST
|
|
326 | 6 | 00326 | Tue Jan 27 00:00:00 1970 PST
|
|
327 | 7 | 00327 | Wed Jan 28 00:00:00 1970 PST
|
|
328 | 8 | 00328 | Thu Jan 29 00:00:00 1970 PST
|
|
329 | 9 | 00329 | Fri Jan 30 00:00:00 1970 PST
|
|
330 | 0 | 00330 | Sat Jan 31 00:00:00 1970 PST
|
|
331 | 1 | 00331 | Sun Feb 01 00:00:00 1970 PST
|
|
332 | 2 | 00332 | Mon Feb 02 00:00:00 1970 PST
|
|
333 | 3 | 00333 | Tue Feb 03 00:00:00 1970 PST
|
|
334 | 4 | 00334 | Wed Feb 04 00:00:00 1970 PST
|
|
335 | 5 | 00335 | Thu Feb 05 00:00:00 1970 PST
|
|
336 | 6 | 00336 | Fri Feb 06 00:00:00 1970 PST
|
|
337 | 7 | 00337 | Sat Feb 07 00:00:00 1970 PST
|
|
338 | 8 | 00338 | Sun Feb 08 00:00:00 1970 PST
|
|
339 | 9 | 00339 | Mon Feb 09 00:00:00 1970 PST
|
|
340 | 0 | 00340 | Tue Feb 10 00:00:00 1970 PST
|
|
341 | 1 | 00341 | Wed Feb 11 00:00:00 1970 PST
|
|
342 | 2 | 00342 | Thu Feb 12 00:00:00 1970 PST
|
|
343 | 3 | 00343 | Fri Feb 13 00:00:00 1970 PST
|
|
344 | 4 | 00344 | Sat Feb 14 00:00:00 1970 PST
|
|
345 | 5 | 00345 | Sun Feb 15 00:00:00 1970 PST
|
|
346 | 6 | 00346 | Mon Feb 16 00:00:00 1970 PST
|
|
347 | 7 | 00347 | Tue Feb 17 00:00:00 1970 PST
|
|
348 | 8 | 00348 | Wed Feb 18 00:00:00 1970 PST
|
|
349 | 9 | 00349 | Thu Feb 19 00:00:00 1970 PST
|
|
350 | 0 | 00350 | Fri Feb 20 00:00:00 1970 PST
|
|
351 | 1 | 00351 | Sat Feb 21 00:00:00 1970 PST
|
|
352 | 2 | 00352 | Sun Feb 22 00:00:00 1970 PST
|
|
353 | 3 | 00353 | Mon Feb 23 00:00:00 1970 PST
|
|
354 | 4 | 00354 | Tue Feb 24 00:00:00 1970 PST
|
|
355 | 5 | 00355 | Wed Feb 25 00:00:00 1970 PST
|
|
356 | 6 | 00356 | Thu Feb 26 00:00:00 1970 PST
|
|
357 | 7 | 00357 | Fri Feb 27 00:00:00 1970 PST
|
|
358 | 8 | 00358 | Sat Feb 28 00:00:00 1970 PST
|
|
359 | 9 | 00359 | Sun Mar 01 00:00:00 1970 PST
|
|
360 | 0 | 00360 | Mon Mar 02 00:00:00 1970 PST
|
|
361 | 1 | 00361 | Tue Mar 03 00:00:00 1970 PST
|
|
362 | 2 | 00362 | Wed Mar 04 00:00:00 1970 PST
|
|
363 | 3 | 00363 | Thu Mar 05 00:00:00 1970 PST
|
|
364 | 4 | 00364 | Fri Mar 06 00:00:00 1970 PST
|
|
365 | 5 | 00365 | Sat Mar 07 00:00:00 1970 PST
|
|
366 | 6 | 00366 | Sun Mar 08 00:00:00 1970 PST
|
|
367 | 7 | 00367 | Mon Mar 09 00:00:00 1970 PST
|
|
368 | 8 | 00368 | Tue Mar 10 00:00:00 1970 PST
|
|
369 | 9 | 00369 | Wed Mar 11 00:00:00 1970 PST
|
|
370 | 0 | 00370 | Thu Mar 12 00:00:00 1970 PST
|
|
371 | 1 | 00371 | Fri Mar 13 00:00:00 1970 PST
|
|
372 | 2 | 00372 | Sat Mar 14 00:00:00 1970 PST
|
|
373 | 3 | 00373 | Sun Mar 15 00:00:00 1970 PST
|
|
374 | 4 | 00374 | Mon Mar 16 00:00:00 1970 PST
|
|
375 | 5 | 00375 | Tue Mar 17 00:00:00 1970 PST
|
|
376 | 6 | 00376 | Wed Mar 18 00:00:00 1970 PST
|
|
377 | 7 | 00377 | Thu Mar 19 00:00:00 1970 PST
|
|
378 | 8 | 00378 | Fri Mar 20 00:00:00 1970 PST
|
|
379 | 9 | 00379 | Sat Mar 21 00:00:00 1970 PST
|
|
380 | 0 | 00380 | Sun Mar 22 00:00:00 1970 PST
|
|
381 | 1 | 00381 | Mon Mar 23 00:00:00 1970 PST
|
|
382 | 2 | 00382 | Tue Mar 24 00:00:00 1970 PST
|
|
383 | 3 | 00383 | Wed Mar 25 00:00:00 1970 PST
|
|
384 | 4 | 00384 | Thu Mar 26 00:00:00 1970 PST
|
|
385 | 5 | 00385 | Fri Mar 27 00:00:00 1970 PST
|
|
386 | 6 | 00386 | Sat Mar 28 00:00:00 1970 PST
|
|
387 | 7 | 00387 | Sun Mar 29 00:00:00 1970 PST
|
|
388 | 8 | 00388 | Mon Mar 30 00:00:00 1970 PST
|
|
389 | 9 | 00389 | Tue Mar 31 00:00:00 1970 PST
|
|
390 | 0 | 00390 | Wed Apr 01 00:00:00 1970 PST
|
|
391 | 1 | 00391 | Thu Apr 02 00:00:00 1970 PST
|
|
392 | 2 | 00392 | Fri Apr 03 00:00:00 1970 PST
|
|
393 | 3 | 00393 | Sat Apr 04 00:00:00 1970 PST
|
|
394 | 4 | 00394 | Sun Apr 05 00:00:00 1970 PST
|
|
395 | 5 | 00395 | Mon Apr 06 00:00:00 1970 PST
|
|
396 | 6 | 00396 | Tue Apr 07 00:00:00 1970 PST
|
|
397 | 7 | 00397 | Wed Apr 08 00:00:00 1970 PST
|
|
398 | 8 | 00398 | Thu Apr 09 00:00:00 1970 PST
|
|
399 | 9 | 00399 | Fri Apr 10 00:00:00 1970 PST
|
|
400 | 0 | 00400 | Thu Jan 01 00:00:00 1970 PST
|
|
401 | 1 | 00401 | Fri Jan 02 00:00:00 1970 PST
|
|
402 | 2 | 00402 | Sat Jan 03 00:00:00 1970 PST
|
|
403 | 3 | 00403 | Sun Jan 04 00:00:00 1970 PST
|
|
404 | 4 | 00404 | Mon Jan 05 00:00:00 1970 PST
|
|
405 | 5 | 00405 | Tue Jan 06 00:00:00 1970 PST
|
|
406 | 6 | 00406 | Wed Jan 07 00:00:00 1970 PST
|
|
407 | 7 | 00407 | Thu Jan 08 00:00:00 1970 PST
|
|
408 | 8 | 00408 | Fri Jan 09 00:00:00 1970 PST
|
|
409 | 9 | 00409 | Sat Jan 10 00:00:00 1970 PST
|
|
410 | 0 | 00410 | Sun Jan 11 00:00:00 1970 PST
|
|
411 | 1 | 00411 | Mon Jan 12 00:00:00 1970 PST
|
|
412 | 2 | 00412 | Tue Jan 13 00:00:00 1970 PST
|
|
413 | 3 | 00413 | Wed Jan 14 00:00:00 1970 PST
|
|
414 | 4 | 00414 | Thu Jan 15 00:00:00 1970 PST
|
|
415 | 5 | 00415 | Fri Jan 16 00:00:00 1970 PST
|
|
416 | 6 | 00416 | Sat Jan 17 00:00:00 1970 PST
|
|
417 | 7 | 00417 | Sun Jan 18 00:00:00 1970 PST
|
|
418 | 8 | 00418 | Mon Jan 19 00:00:00 1970 PST
|
|
419 | 9 | 00419 | Tue Jan 20 00:00:00 1970 PST
|
|
420 | 0 | 00420 | Wed Jan 21 00:00:00 1970 PST
|
|
421 | 1 | 00421 | Thu Jan 22 00:00:00 1970 PST
|
|
422 | 2 | 00422 | Fri Jan 23 00:00:00 1970 PST
|
|
423 | 3 | 00423 | Sat Jan 24 00:00:00 1970 PST
|
|
424 | 4 | 00424 | Sun Jan 25 00:00:00 1970 PST
|
|
425 | 5 | 00425 | Mon Jan 26 00:00:00 1970 PST
|
|
426 | 6 | 00426 | Tue Jan 27 00:00:00 1970 PST
|
|
427 | 7 | 00427 | Wed Jan 28 00:00:00 1970 PST
|
|
428 | 8 | 00428 | Thu Jan 29 00:00:00 1970 PST
|
|
429 | 9 | 00429 | Fri Jan 30 00:00:00 1970 PST
|
|
430 | 0 | 00430 | Sat Jan 31 00:00:00 1970 PST
|
|
431 | 1 | 00431 | Sun Feb 01 00:00:00 1970 PST
|
|
432 | 2 | 00432 | Mon Feb 02 00:00:00 1970 PST
|
|
433 | 3 | 00433 | Tue Feb 03 00:00:00 1970 PST
|
|
434 | 4 | 00434 | Wed Feb 04 00:00:00 1970 PST
|
|
435 | 5 | 00435 | Thu Feb 05 00:00:00 1970 PST
|
|
436 | 6 | 00436 | Fri Feb 06 00:00:00 1970 PST
|
|
437 | 7 | 00437 | Sat Feb 07 00:00:00 1970 PST
|
|
438 | 8 | 00438 | Sun Feb 08 00:00:00 1970 PST
|
|
439 | 9 | 00439 | Mon Feb 09 00:00:00 1970 PST
|
|
440 | 0 | 00440 | Tue Feb 10 00:00:00 1970 PST
|
|
441 | 1 | 00441 | Wed Feb 11 00:00:00 1970 PST
|
|
442 | 2 | 00442 | Thu Feb 12 00:00:00 1970 PST
|
|
443 | 3 | 00443 | Fri Feb 13 00:00:00 1970 PST
|
|
444 | 4 | 00444 | Sat Feb 14 00:00:00 1970 PST
|
|
445 | 5 | 00445 | Sun Feb 15 00:00:00 1970 PST
|
|
446 | 6 | 00446 | Mon Feb 16 00:00:00 1970 PST
|
|
447 | 7 | 00447 | Tue Feb 17 00:00:00 1970 PST
|
|
448 | 8 | 00448 | Wed Feb 18 00:00:00 1970 PST
|
|
449 | 9 | 00449 | Thu Feb 19 00:00:00 1970 PST
|
|
450 | 0 | 00450 | Fri Feb 20 00:00:00 1970 PST
|
|
451 | 1 | 00451 | Sat Feb 21 00:00:00 1970 PST
|
|
452 | 2 | 00452 | Sun Feb 22 00:00:00 1970 PST
|
|
453 | 3 | 00453 | Mon Feb 23 00:00:00 1970 PST
|
|
454 | 4 | 00454 | Tue Feb 24 00:00:00 1970 PST
|
|
455 | 5 | 00455 | Wed Feb 25 00:00:00 1970 PST
|
|
456 | 6 | 00456 | Thu Feb 26 00:00:00 1970 PST
|
|
457 | 7 | 00457 | Fri Feb 27 00:00:00 1970 PST
|
|
458 | 8 | 00458 | Sat Feb 28 00:00:00 1970 PST
|
|
459 | 9 | 00459 | Sun Mar 01 00:00:00 1970 PST
|
|
460 | 0 | 00460 | Mon Mar 02 00:00:00 1970 PST
|
|
461 | 1 | 00461 | Tue Mar 03 00:00:00 1970 PST
|
|
462 | 2 | 00462 | Wed Mar 04 00:00:00 1970 PST
|
|
463 | 3 | 00463 | Thu Mar 05 00:00:00 1970 PST
|
|
464 | 4 | 00464 | Fri Mar 06 00:00:00 1970 PST
|
|
465 | 5 | 00465 | Sat Mar 07 00:00:00 1970 PST
|
|
466 | 6 | 00466 | Sun Mar 08 00:00:00 1970 PST
|
|
467 | 7 | 00467 | Mon Mar 09 00:00:00 1970 PST
|
|
468 | 8 | 00468 | Tue Mar 10 00:00:00 1970 PST
|
|
469 | 9 | 00469 | Wed Mar 11 00:00:00 1970 PST
|
|
470 | 0 | 00470 | Thu Mar 12 00:00:00 1970 PST
|
|
471 | 1 | 00471 | Fri Mar 13 00:00:00 1970 PST
|
|
472 | 2 | 00472 | Sat Mar 14 00:00:00 1970 PST
|
|
473 | 3 | 00473 | Sun Mar 15 00:00:00 1970 PST
|
|
474 | 4 | 00474 | Mon Mar 16 00:00:00 1970 PST
|
|
475 | 5 | 00475 | Tue Mar 17 00:00:00 1970 PST
|
|
476 | 6 | 00476 | Wed Mar 18 00:00:00 1970 PST
|
|
477 | 7 | 00477 | Thu Mar 19 00:00:00 1970 PST
|
|
478 | 8 | 00478 | Fri Mar 20 00:00:00 1970 PST
|
|
479 | 9 | 00479 | Sat Mar 21 00:00:00 1970 PST
|
|
480 | 0 | 00480 | Sun Mar 22 00:00:00 1970 PST
|
|
481 | 1 | 00481 | Mon Mar 23 00:00:00 1970 PST
|
|
482 | 2 | 00482 | Tue Mar 24 00:00:00 1970 PST
|
|
483 | 3 | 00483 | Wed Mar 25 00:00:00 1970 PST
|
|
484 | 4 | 00484 | Thu Mar 26 00:00:00 1970 PST
|
|
485 | 5 | 00485 | Fri Mar 27 00:00:00 1970 PST
|
|
486 | 6 | 00486 | Sat Mar 28 00:00:00 1970 PST
|
|
487 | 7 | 00487 | Sun Mar 29 00:00:00 1970 PST
|
|
488 | 8 | 00488 | Mon Mar 30 00:00:00 1970 PST
|
|
489 | 9 | 00489 | Tue Mar 31 00:00:00 1970 PST
|
|
490 | 0 | 00490 | Wed Apr 01 00:00:00 1970 PST
|
|
491 | 1 | 00491 | Thu Apr 02 00:00:00 1970 PST
|
|
492 | 2 | 00492 | Fri Apr 03 00:00:00 1970 PST
|
|
493 | 3 | 00493 | Sat Apr 04 00:00:00 1970 PST
|
|
494 | 4 | 00494 | Sun Apr 05 00:00:00 1970 PST
|
|
495 | 5 | 00495 | Mon Apr 06 00:00:00 1970 PST
|
|
496 | 6 | 00496 | Tue Apr 07 00:00:00 1970 PST
|
|
497 | 7 | 00497 | Wed Apr 08 00:00:00 1970 PST
|
|
498 | 8 | 00498 | Thu Apr 09 00:00:00 1970 PST
|
|
499 | 9 | 00499 | Fri Apr 10 00:00:00 1970 PST
|
|
500 | 0 | 00500 | Thu Jan 01 00:00:00 1970 PST
|
|
501 | 1 | 00501 | Fri Jan 02 00:00:00 1970 PST
|
|
502 | 2 | 00502 | Sat Jan 03 00:00:00 1970 PST
|
|
503 | 3 | 00503 | Sun Jan 04 00:00:00 1970 PST
|
|
504 | 4 | 00504 | Mon Jan 05 00:00:00 1970 PST
|
|
505 | 5 | 00505 | Tue Jan 06 00:00:00 1970 PST
|
|
506 | 6 | 00506 | Wed Jan 07 00:00:00 1970 PST
|
|
507 | 7 | 00507 | Thu Jan 08 00:00:00 1970 PST
|
|
508 | 8 | 00508 | Fri Jan 09 00:00:00 1970 PST
|
|
509 | 9 | 00509 | Sat Jan 10 00:00:00 1970 PST
|
|
510 | 0 | 00510 | Sun Jan 11 00:00:00 1970 PST
|
|
511 | 1 | 00511 | Mon Jan 12 00:00:00 1970 PST
|
|
512 | 2 | 00512 | Tue Jan 13 00:00:00 1970 PST
|
|
513 | 3 | 00513 | Wed Jan 14 00:00:00 1970 PST
|
|
514 | 4 | 00514 | Thu Jan 15 00:00:00 1970 PST
|
|
515 | 5 | 00515 | Fri Jan 16 00:00:00 1970 PST
|
|
516 | 6 | 00516 | Sat Jan 17 00:00:00 1970 PST
|
|
517 | 7 | 00517 | Sun Jan 18 00:00:00 1970 PST
|
|
518 | 8 | 00518 | Mon Jan 19 00:00:00 1970 PST
|
|
519 | 9 | 00519 | Tue Jan 20 00:00:00 1970 PST
|
|
520 | 0 | 00520 | Wed Jan 21 00:00:00 1970 PST
|
|
521 | 1 | 00521 | Thu Jan 22 00:00:00 1970 PST
|
|
522 | 2 | 00522 | Fri Jan 23 00:00:00 1970 PST
|
|
523 | 3 | 00523 | Sat Jan 24 00:00:00 1970 PST
|
|
524 | 4 | 00524 | Sun Jan 25 00:00:00 1970 PST
|
|
525 | 5 | 00525 | Mon Jan 26 00:00:00 1970 PST
|
|
526 | 6 | 00526 | Tue Jan 27 00:00:00 1970 PST
|
|
527 | 7 | 00527 | Wed Jan 28 00:00:00 1970 PST
|
|
528 | 8 | 00528 | Thu Jan 29 00:00:00 1970 PST
|
|
529 | 9 | 00529 | Fri Jan 30 00:00:00 1970 PST
|
|
530 | 0 | 00530 | Sat Jan 31 00:00:00 1970 PST
|
|
531 | 1 | 00531 | Sun Feb 01 00:00:00 1970 PST
|
|
532 | 2 | 00532 | Mon Feb 02 00:00:00 1970 PST
|
|
533 | 3 | 00533 | Tue Feb 03 00:00:00 1970 PST
|
|
534 | 4 | 00534 | Wed Feb 04 00:00:00 1970 PST
|
|
535 | 5 | 00535 | Thu Feb 05 00:00:00 1970 PST
|
|
536 | 6 | 00536 | Fri Feb 06 00:00:00 1970 PST
|
|
537 | 7 | 00537 | Sat Feb 07 00:00:00 1970 PST
|
|
538 | 8 | 00538 | Sun Feb 08 00:00:00 1970 PST
|
|
539 | 9 | 00539 | Mon Feb 09 00:00:00 1970 PST
|
|
540 | 0 | 00540 | Tue Feb 10 00:00:00 1970 PST
|
|
541 | 1 | 00541 | Wed Feb 11 00:00:00 1970 PST
|
|
542 | 2 | 00542 | Thu Feb 12 00:00:00 1970 PST
|
|
543 | 3 | 00543 | Fri Feb 13 00:00:00 1970 PST
|
|
544 | 4 | 00544 | Sat Feb 14 00:00:00 1970 PST
|
|
545 | 5 | 00545 | Sun Feb 15 00:00:00 1970 PST
|
|
546 | 6 | 00546 | Mon Feb 16 00:00:00 1970 PST
|
|
547 | 7 | 00547 | Tue Feb 17 00:00:00 1970 PST
|
|
548 | 8 | 00548 | Wed Feb 18 00:00:00 1970 PST
|
|
549 | 9 | 00549 | Thu Feb 19 00:00:00 1970 PST
|
|
550 | 0 | 00550 | Fri Feb 20 00:00:00 1970 PST
|
|
551 | 1 | 00551 | Sat Feb 21 00:00:00 1970 PST
|
|
552 | 2 | 00552 | Sun Feb 22 00:00:00 1970 PST
|
|
553 | 3 | 00553 | Mon Feb 23 00:00:00 1970 PST
|
|
554 | 4 | 00554 | Tue Feb 24 00:00:00 1970 PST
|
|
555 | 5 | 00555 | Wed Feb 25 00:00:00 1970 PST
|
|
556 | 6 | 00556 | Thu Feb 26 00:00:00 1970 PST
|
|
557 | 7 | 00557 | Fri Feb 27 00:00:00 1970 PST
|
|
558 | 8 | 00558 | Sat Feb 28 00:00:00 1970 PST
|
|
559 | 9 | 00559 | Sun Mar 01 00:00:00 1970 PST
|
|
560 | 0 | 00560 | Mon Mar 02 00:00:00 1970 PST
|
|
561 | 1 | 00561 | Tue Mar 03 00:00:00 1970 PST
|
|
562 | 2 | 00562 | Wed Mar 04 00:00:00 1970 PST
|
|
563 | 3 | 00563 | Thu Mar 05 00:00:00 1970 PST
|
|
564 | 4 | 00564 | Fri Mar 06 00:00:00 1970 PST
|
|
565 | 5 | 00565 | Sat Mar 07 00:00:00 1970 PST
|
|
566 | 6 | 00566 | Sun Mar 08 00:00:00 1970 PST
|
|
567 | 7 | 00567 | Mon Mar 09 00:00:00 1970 PST
|
|
568 | 8 | 00568 | Tue Mar 10 00:00:00 1970 PST
|
|
569 | 9 | 00569 | Wed Mar 11 00:00:00 1970 PST
|
|
570 | 0 | 00570 | Thu Mar 12 00:00:00 1970 PST
|
|
571 | 1 | 00571 | Fri Mar 13 00:00:00 1970 PST
|
|
572 | 2 | 00572 | Sat Mar 14 00:00:00 1970 PST
|
|
573 | 3 | 00573 | Sun Mar 15 00:00:00 1970 PST
|
|
574 | 4 | 00574 | Mon Mar 16 00:00:00 1970 PST
|
|
575 | 5 | 00575 | Tue Mar 17 00:00:00 1970 PST
|
|
576 | 6 | 00576 | Wed Mar 18 00:00:00 1970 PST
|
|
577 | 7 | 00577 | Thu Mar 19 00:00:00 1970 PST
|
|
578 | 8 | 00578 | Fri Mar 20 00:00:00 1970 PST
|
|
579 | 9 | 00579 | Sat Mar 21 00:00:00 1970 PST
|
|
580 | 0 | 00580 | Sun Mar 22 00:00:00 1970 PST
|
|
581 | 1 | 00581 | Mon Mar 23 00:00:00 1970 PST
|
|
582 | 2 | 00582 | Tue Mar 24 00:00:00 1970 PST
|
|
583 | 3 | 00583 | Wed Mar 25 00:00:00 1970 PST
|
|
584 | 4 | 00584 | Thu Mar 26 00:00:00 1970 PST
|
|
585 | 5 | 00585 | Fri Mar 27 00:00:00 1970 PST
|
|
586 | 6 | 00586 | Sat Mar 28 00:00:00 1970 PST
|
|
587 | 7 | 00587 | Sun Mar 29 00:00:00 1970 PST
|
|
588 | 8 | 00588 | Mon Mar 30 00:00:00 1970 PST
|
|
589 | 9 | 00589 | Tue Mar 31 00:00:00 1970 PST
|
|
590 | 0 | 00590 | Wed Apr 01 00:00:00 1970 PST
|
|
591 | 1 | 00591 | Thu Apr 02 00:00:00 1970 PST
|
|
592 | 2 | 00592 | Fri Apr 03 00:00:00 1970 PST
|
|
593 | 3 | 00593 | Sat Apr 04 00:00:00 1970 PST
|
|
594 | 4 | 00594 | Sun Apr 05 00:00:00 1970 PST
|
|
595 | 5 | 00595 | Mon Apr 06 00:00:00 1970 PST
|
|
596 | 6 | 00596 | Tue Apr 07 00:00:00 1970 PST
|
|
597 | 7 | 00597 | Wed Apr 08 00:00:00 1970 PST
|
|
598 | 8 | 00598 | Thu Apr 09 00:00:00 1970 PST
|
|
599 | 9 | 00599 | Fri Apr 10 00:00:00 1970 PST
|
|
600 | 0 | 00600 | Thu Jan 01 00:00:00 1970 PST
|
|
601 | 1 | 00601 | Fri Jan 02 00:00:00 1970 PST
|
|
602 | 2 | 00602 | Sat Jan 03 00:00:00 1970 PST
|
|
603 | 3 | 00603 | Sun Jan 04 00:00:00 1970 PST
|
|
604 | 4 | 00604 | Mon Jan 05 00:00:00 1970 PST
|
|
605 | 5 | 00605 | Tue Jan 06 00:00:00 1970 PST
|
|
606 | 6 | 00606 | Wed Jan 07 00:00:00 1970 PST
|
|
607 | 7 | 00607 | Thu Jan 08 00:00:00 1970 PST
|
|
608 | 8 | 00608 | Fri Jan 09 00:00:00 1970 PST
|
|
609 | 9 | 00609 | Sat Jan 10 00:00:00 1970 PST
|
|
610 | 0 | 00610 | Sun Jan 11 00:00:00 1970 PST
|
|
611 | 1 | 00611 | Mon Jan 12 00:00:00 1970 PST
|
|
612 | 2 | 00612 | Tue Jan 13 00:00:00 1970 PST
|
|
613 | 3 | 00613 | Wed Jan 14 00:00:00 1970 PST
|
|
614 | 4 | 00614 | Thu Jan 15 00:00:00 1970 PST
|
|
615 | 5 | 00615 | Fri Jan 16 00:00:00 1970 PST
|
|
616 | 6 | 00616 | Sat Jan 17 00:00:00 1970 PST
|
|
617 | 7 | 00617 | Sun Jan 18 00:00:00 1970 PST
|
|
618 | 8 | 00618 | Mon Jan 19 00:00:00 1970 PST
|
|
619 | 9 | 00619 | Tue Jan 20 00:00:00 1970 PST
|
|
620 | 0 | 00620 | Wed Jan 21 00:00:00 1970 PST
|
|
621 | 1 | 00621 | Thu Jan 22 00:00:00 1970 PST
|
|
622 | 2 | 00622 | Fri Jan 23 00:00:00 1970 PST
|
|
623 | 3 | 00623 | Sat Jan 24 00:00:00 1970 PST
|
|
624 | 4 | 00624 | Sun Jan 25 00:00:00 1970 PST
|
|
625 | 5 | 00625 | Mon Jan 26 00:00:00 1970 PST
|
|
626 | 6 | 00626 | Tue Jan 27 00:00:00 1970 PST
|
|
627 | 7 | 00627 | Wed Jan 28 00:00:00 1970 PST
|
|
628 | 8 | 00628 | Thu Jan 29 00:00:00 1970 PST
|
|
629 | 9 | 00629 | Fri Jan 30 00:00:00 1970 PST
|
|
630 | 0 | 00630 | Sat Jan 31 00:00:00 1970 PST
|
|
631 | 1 | 00631 | Sun Feb 01 00:00:00 1970 PST
|
|
632 | 2 | 00632 | Mon Feb 02 00:00:00 1970 PST
|
|
633 | 3 | 00633 | Tue Feb 03 00:00:00 1970 PST
|
|
634 | 4 | 00634 | Wed Feb 04 00:00:00 1970 PST
|
|
635 | 5 | 00635 | Thu Feb 05 00:00:00 1970 PST
|
|
636 | 6 | 00636 | Fri Feb 06 00:00:00 1970 PST
|
|
637 | 7 | 00637 | Sat Feb 07 00:00:00 1970 PST
|
|
638 | 8 | 00638 | Sun Feb 08 00:00:00 1970 PST
|
|
639 | 9 | 00639 | Mon Feb 09 00:00:00 1970 PST
|
|
640 | 0 | 00640 | Tue Feb 10 00:00:00 1970 PST
|
|
641 | 1 | 00641 | Wed Feb 11 00:00:00 1970 PST
|
|
642 | 2 | 00642 | Thu Feb 12 00:00:00 1970 PST
|
|
643 | 3 | 00643 | Fri Feb 13 00:00:00 1970 PST
|
|
644 | 4 | 00644 | Sat Feb 14 00:00:00 1970 PST
|
|
645 | 5 | 00645 | Sun Feb 15 00:00:00 1970 PST
|
|
646 | 6 | 00646 | Mon Feb 16 00:00:00 1970 PST
|
|
647 | 7 | 00647 | Tue Feb 17 00:00:00 1970 PST
|
|
648 | 8 | 00648 | Wed Feb 18 00:00:00 1970 PST
|
|
649 | 9 | 00649 | Thu Feb 19 00:00:00 1970 PST
|
|
650 | 0 | 00650 | Fri Feb 20 00:00:00 1970 PST
|
|
651 | 1 | 00651 | Sat Feb 21 00:00:00 1970 PST
|
|
652 | 2 | 00652 | Sun Feb 22 00:00:00 1970 PST
|
|
653 | 3 | 00653 | Mon Feb 23 00:00:00 1970 PST
|
|
654 | 4 | 00654 | Tue Feb 24 00:00:00 1970 PST
|
|
655 | 5 | 00655 | Wed Feb 25 00:00:00 1970 PST
|
|
656 | 6 | 00656 | Thu Feb 26 00:00:00 1970 PST
|
|
657 | 7 | 00657 | Fri Feb 27 00:00:00 1970 PST
|
|
658 | 8 | 00658 | Sat Feb 28 00:00:00 1970 PST
|
|
659 | 9 | 00659 | Sun Mar 01 00:00:00 1970 PST
|
|
660 | 0 | 00660 | Mon Mar 02 00:00:00 1970 PST
|
|
661 | 1 | 00661 | Tue Mar 03 00:00:00 1970 PST
|
|
662 | 2 | 00662 | Wed Mar 04 00:00:00 1970 PST
|
|
663 | 3 | 00663 | Thu Mar 05 00:00:00 1970 PST
|
|
664 | 4 | 00664 | Fri Mar 06 00:00:00 1970 PST
|
|
665 | 5 | 00665 | Sat Mar 07 00:00:00 1970 PST
|
|
666 | 6 | 00666 | Sun Mar 08 00:00:00 1970 PST
|
|
667 | 7 | 00667 | Mon Mar 09 00:00:00 1970 PST
|
|
668 | 8 | 00668 | Tue Mar 10 00:00:00 1970 PST
|
|
669 | 9 | 00669 | Wed Mar 11 00:00:00 1970 PST
|
|
670 | 0 | 00670 | Thu Mar 12 00:00:00 1970 PST
|
|
671 | 1 | 00671 | Fri Mar 13 00:00:00 1970 PST
|
|
672 | 2 | 00672 | Sat Mar 14 00:00:00 1970 PST
|
|
673 | 3 | 00673 | Sun Mar 15 00:00:00 1970 PST
|
|
674 | 4 | 00674 | Mon Mar 16 00:00:00 1970 PST
|
|
675 | 5 | 00675 | Tue Mar 17 00:00:00 1970 PST
|
|
676 | 6 | 00676 | Wed Mar 18 00:00:00 1970 PST
|
|
677 | 7 | 00677 | Thu Mar 19 00:00:00 1970 PST
|
|
678 | 8 | 00678 | Fri Mar 20 00:00:00 1970 PST
|
|
679 | 9 | 00679 | Sat Mar 21 00:00:00 1970 PST
|
|
680 | 0 | 00680 | Sun Mar 22 00:00:00 1970 PST
|
|
681 | 1 | 00681 | Mon Mar 23 00:00:00 1970 PST
|
|
682 | 2 | 00682 | Tue Mar 24 00:00:00 1970 PST
|
|
683 | 3 | 00683 | Wed Mar 25 00:00:00 1970 PST
|
|
684 | 4 | 00684 | Thu Mar 26 00:00:00 1970 PST
|
|
685 | 5 | 00685 | Fri Mar 27 00:00:00 1970 PST
|
|
686 | 6 | 00686 | Sat Mar 28 00:00:00 1970 PST
|
|
687 | 7 | 00687 | Sun Mar 29 00:00:00 1970 PST
|
|
688 | 8 | 00688 | Mon Mar 30 00:00:00 1970 PST
|
|
689 | 9 | 00689 | Tue Mar 31 00:00:00 1970 PST
|
|
690 | 0 | 00690 | Wed Apr 01 00:00:00 1970 PST
|
|
691 | 1 | 00691 | Thu Apr 02 00:00:00 1970 PST
|
|
692 | 2 | 00692 | Fri Apr 03 00:00:00 1970 PST
|
|
693 | 3 | 00693 | Sat Apr 04 00:00:00 1970 PST
|
|
694 | 4 | 00694 | Sun Apr 05 00:00:00 1970 PST
|
|
695 | 5 | 00695 | Mon Apr 06 00:00:00 1970 PST
|
|
696 | 6 | 00696 | Tue Apr 07 00:00:00 1970 PST
|
|
697 | 7 | 00697 | Wed Apr 08 00:00:00 1970 PST
|
|
698 | 8 | 00698 | Thu Apr 09 00:00:00 1970 PST
|
|
699 | 9 | 00699 | Fri Apr 10 00:00:00 1970 PST
|
|
700 | 0 | 00700 | Thu Jan 01 00:00:00 1970 PST
|
|
701 | 1 | 00701 | Fri Jan 02 00:00:00 1970 PST
|
|
702 | 2 | 00702 | Sat Jan 03 00:00:00 1970 PST
|
|
703 | 3 | 00703 | Sun Jan 04 00:00:00 1970 PST
|
|
704 | 4 | 00704 | Mon Jan 05 00:00:00 1970 PST
|
|
705 | 5 | 00705 | Tue Jan 06 00:00:00 1970 PST
|
|
706 | 6 | 00706 | Wed Jan 07 00:00:00 1970 PST
|
|
707 | 7 | 00707 | Thu Jan 08 00:00:00 1970 PST
|
|
708 | 8 | 00708 | Fri Jan 09 00:00:00 1970 PST
|
|
709 | 9 | 00709 | Sat Jan 10 00:00:00 1970 PST
|
|
710 | 0 | 00710 | Sun Jan 11 00:00:00 1970 PST
|
|
711 | 1 | 00711 | Mon Jan 12 00:00:00 1970 PST
|
|
712 | 2 | 00712 | Tue Jan 13 00:00:00 1970 PST
|
|
713 | 3 | 00713 | Wed Jan 14 00:00:00 1970 PST
|
|
714 | 4 | 00714 | Thu Jan 15 00:00:00 1970 PST
|
|
715 | 5 | 00715 | Fri Jan 16 00:00:00 1970 PST
|
|
716 | 6 | 00716 | Sat Jan 17 00:00:00 1970 PST
|
|
717 | 7 | 00717 | Sun Jan 18 00:00:00 1970 PST
|
|
718 | 8 | 00718 | Mon Jan 19 00:00:00 1970 PST
|
|
719 | 9 | 00719 | Tue Jan 20 00:00:00 1970 PST
|
|
720 | 0 | 00720 | Wed Jan 21 00:00:00 1970 PST
|
|
721 | 1 | 00721 | Thu Jan 22 00:00:00 1970 PST
|
|
722 | 2 | 00722 | Fri Jan 23 00:00:00 1970 PST
|
|
723 | 3 | 00723 | Sat Jan 24 00:00:00 1970 PST
|
|
724 | 4 | 00724 | Sun Jan 25 00:00:00 1970 PST
|
|
725 | 5 | 00725 | Mon Jan 26 00:00:00 1970 PST
|
|
726 | 6 | 00726 | Tue Jan 27 00:00:00 1970 PST
|
|
727 | 7 | 00727 | Wed Jan 28 00:00:00 1970 PST
|
|
728 | 8 | 00728 | Thu Jan 29 00:00:00 1970 PST
|
|
729 | 9 | 00729 | Fri Jan 30 00:00:00 1970 PST
|
|
730 | 0 | 00730 | Sat Jan 31 00:00:00 1970 PST
|
|
731 | 1 | 00731 | Sun Feb 01 00:00:00 1970 PST
|
|
732 | 2 | 00732 | Mon Feb 02 00:00:00 1970 PST
|
|
733 | 3 | 00733 | Tue Feb 03 00:00:00 1970 PST
|
|
734 | 4 | 00734 | Wed Feb 04 00:00:00 1970 PST
|
|
735 | 5 | 00735 | Thu Feb 05 00:00:00 1970 PST
|
|
736 | 6 | 00736 | Fri Feb 06 00:00:00 1970 PST
|
|
737 | 7 | 00737 | Sat Feb 07 00:00:00 1970 PST
|
|
738 | 8 | 00738 | Sun Feb 08 00:00:00 1970 PST
|
|
739 | 9 | 00739 | Mon Feb 09 00:00:00 1970 PST
|
|
740 | 0 | 00740 | Tue Feb 10 00:00:00 1970 PST
|
|
741 | 1 | 00741 | Wed Feb 11 00:00:00 1970 PST
|
|
742 | 2 | 00742 | Thu Feb 12 00:00:00 1970 PST
|
|
743 | 3 | 00743 | Fri Feb 13 00:00:00 1970 PST
|
|
744 | 4 | 00744 | Sat Feb 14 00:00:00 1970 PST
|
|
745 | 5 | 00745 | Sun Feb 15 00:00:00 1970 PST
|
|
746 | 6 | 00746 | Mon Feb 16 00:00:00 1970 PST
|
|
747 | 7 | 00747 | Tue Feb 17 00:00:00 1970 PST
|
|
748 | 8 | 00748 | Wed Feb 18 00:00:00 1970 PST
|
|
749 | 9 | 00749 | Thu Feb 19 00:00:00 1970 PST
|
|
750 | 0 | 00750 | Fri Feb 20 00:00:00 1970 PST
|
|
751 | 1 | 00751 | Sat Feb 21 00:00:00 1970 PST
|
|
752 | 2 | 00752 | Sun Feb 22 00:00:00 1970 PST
|
|
753 | 3 | 00753 | Mon Feb 23 00:00:00 1970 PST
|
|
754 | 4 | 00754 | Tue Feb 24 00:00:00 1970 PST
|
|
755 | 5 | 00755 | Wed Feb 25 00:00:00 1970 PST
|
|
756 | 6 | 00756 | Thu Feb 26 00:00:00 1970 PST
|
|
757 | 7 | 00757 | Fri Feb 27 00:00:00 1970 PST
|
|
758 | 8 | 00758 | Sat Feb 28 00:00:00 1970 PST
|
|
759 | 9 | 00759 | Sun Mar 01 00:00:00 1970 PST
|
|
760 | 0 | 00760 | Mon Mar 02 00:00:00 1970 PST
|
|
761 | 1 | 00761 | Tue Mar 03 00:00:00 1970 PST
|
|
762 | 2 | 00762 | Wed Mar 04 00:00:00 1970 PST
|
|
763 | 3 | 00763 | Thu Mar 05 00:00:00 1970 PST
|
|
764 | 4 | 00764 | Fri Mar 06 00:00:00 1970 PST
|
|
765 | 5 | 00765 | Sat Mar 07 00:00:00 1970 PST
|
|
766 | 6 | 00766 | Sun Mar 08 00:00:00 1970 PST
|
|
767 | 7 | 00767 | Mon Mar 09 00:00:00 1970 PST
|
|
768 | 8 | 00768 | Tue Mar 10 00:00:00 1970 PST
|
|
769 | 9 | 00769 | Wed Mar 11 00:00:00 1970 PST
|
|
770 | 0 | 00770 | Thu Mar 12 00:00:00 1970 PST
|
|
771 | 1 | 00771 | Fri Mar 13 00:00:00 1970 PST
|
|
772 | 2 | 00772 | Sat Mar 14 00:00:00 1970 PST
|
|
773 | 3 | 00773 | Sun Mar 15 00:00:00 1970 PST
|
|
774 | 4 | 00774 | Mon Mar 16 00:00:00 1970 PST
|
|
775 | 5 | 00775 | Tue Mar 17 00:00:00 1970 PST
|
|
776 | 6 | 00776 | Wed Mar 18 00:00:00 1970 PST
|
|
777 | 7 | 00777 | Thu Mar 19 00:00:00 1970 PST
|
|
778 | 8 | 00778 | Fri Mar 20 00:00:00 1970 PST
|
|
779 | 9 | 00779 | Sat Mar 21 00:00:00 1970 PST
|
|
780 | 0 | 00780 | Sun Mar 22 00:00:00 1970 PST
|
|
781 | 1 | 00781 | Mon Mar 23 00:00:00 1970 PST
|
|
782 | 2 | 00782 | Tue Mar 24 00:00:00 1970 PST
|
|
783 | 3 | 00783 | Wed Mar 25 00:00:00 1970 PST
|
|
784 | 4 | 00784 | Thu Mar 26 00:00:00 1970 PST
|
|
785 | 5 | 00785 | Fri Mar 27 00:00:00 1970 PST
|
|
786 | 6 | 00786 | Sat Mar 28 00:00:00 1970 PST
|
|
787 | 7 | 00787 | Sun Mar 29 00:00:00 1970 PST
|
|
788 | 8 | 00788 | Mon Mar 30 00:00:00 1970 PST
|
|
789 | 9 | 00789 | Tue Mar 31 00:00:00 1970 PST
|
|
790 | 0 | 00790 | Wed Apr 01 00:00:00 1970 PST
|
|
791 | 1 | 00791 | Thu Apr 02 00:00:00 1970 PST
|
|
792 | 2 | 00792 | Fri Apr 03 00:00:00 1970 PST
|
|
793 | 3 | 00793 | Sat Apr 04 00:00:00 1970 PST
|
|
794 | 4 | 00794 | Sun Apr 05 00:00:00 1970 PST
|
|
795 | 5 | 00795 | Mon Apr 06 00:00:00 1970 PST
|
|
796 | 6 | 00796 | Tue Apr 07 00:00:00 1970 PST
|
|
797 | 7 | 00797 | Wed Apr 08 00:00:00 1970 PST
|
|
798 | 8 | 00798 | Thu Apr 09 00:00:00 1970 PST
|
|
799 | 9 | 00799 | Fri Apr 10 00:00:00 1970 PST
|
|
800 | 0 | 00800 | Thu Jan 01 00:00:00 1970 PST
|
|
801 | 1 | 00801 | Fri Jan 02 00:00:00 1970 PST
|
|
802 | 2 | 00802 | Sat Jan 03 00:00:00 1970 PST
|
|
803 | 3 | 00803 | Sun Jan 04 00:00:00 1970 PST
|
|
804 | 4 | 00804 | Mon Jan 05 00:00:00 1970 PST
|
|
805 | 5 | 00805 | Tue Jan 06 00:00:00 1970 PST
|
|
806 | 6 | 00806 | Wed Jan 07 00:00:00 1970 PST
|
|
807 | 7 | 00807 | Thu Jan 08 00:00:00 1970 PST
|
|
808 | 8 | 00808 | Fri Jan 09 00:00:00 1970 PST
|
|
809 | 9 | 00809 | Sat Jan 10 00:00:00 1970 PST
|
|
810 | 0 | 00810 | Sun Jan 11 00:00:00 1970 PST
|
|
811 | 1 | 00811 | Mon Jan 12 00:00:00 1970 PST
|
|
812 | 2 | 00812 | Tue Jan 13 00:00:00 1970 PST
|
|
813 | 3 | 00813 | Wed Jan 14 00:00:00 1970 PST
|
|
814 | 4 | 00814 | Thu Jan 15 00:00:00 1970 PST
|
|
815 | 5 | 00815 | Fri Jan 16 00:00:00 1970 PST
|
|
816 | 6 | 00816 | Sat Jan 17 00:00:00 1970 PST
|
|
817 | 7 | 00817 | Sun Jan 18 00:00:00 1970 PST
|
|
818 | 8 | 00818 | Mon Jan 19 00:00:00 1970 PST
|
|
819 | 9 | 00819 | Tue Jan 20 00:00:00 1970 PST
|
|
820 | 0 | 00820 | Wed Jan 21 00:00:00 1970 PST
|
|
821 | 1 | 00821 | Thu Jan 22 00:00:00 1970 PST
|
|
822 | 2 | 00822 | Fri Jan 23 00:00:00 1970 PST
|
|
823 | 3 | 00823 | Sat Jan 24 00:00:00 1970 PST
|
|
824 | 4 | 00824 | Sun Jan 25 00:00:00 1970 PST
|
|
825 | 5 | 00825 | Mon Jan 26 00:00:00 1970 PST
|
|
826 | 6 | 00826 | Tue Jan 27 00:00:00 1970 PST
|
|
827 | 7 | 00827 | Wed Jan 28 00:00:00 1970 PST
|
|
828 | 8 | 00828 | Thu Jan 29 00:00:00 1970 PST
|
|
829 | 9 | 00829 | Fri Jan 30 00:00:00 1970 PST
|
|
830 | 0 | 00830 | Sat Jan 31 00:00:00 1970 PST
|
|
831 | 1 | 00831 | Sun Feb 01 00:00:00 1970 PST
|
|
832 | 2 | 00832 | Mon Feb 02 00:00:00 1970 PST
|
|
833 | 3 | 00833 | Tue Feb 03 00:00:00 1970 PST
|
|
834 | 4 | 00834 | Wed Feb 04 00:00:00 1970 PST
|
|
835 | 5 | 00835 | Thu Feb 05 00:00:00 1970 PST
|
|
836 | 6 | 00836 | Fri Feb 06 00:00:00 1970 PST
|
|
837 | 7 | 00837 | Sat Feb 07 00:00:00 1970 PST
|
|
838 | 8 | 00838 | Sun Feb 08 00:00:00 1970 PST
|
|
839 | 9 | 00839 | Mon Feb 09 00:00:00 1970 PST
|
|
840 | 0 | 00840 | Tue Feb 10 00:00:00 1970 PST
|
|
841 | 1 | 00841 | Wed Feb 11 00:00:00 1970 PST
|
|
842 | 2 | 00842 | Thu Feb 12 00:00:00 1970 PST
|
|
843 | 3 | 00843 | Fri Feb 13 00:00:00 1970 PST
|
|
844 | 4 | 00844 | Sat Feb 14 00:00:00 1970 PST
|
|
845 | 5 | 00845 | Sun Feb 15 00:00:00 1970 PST
|
|
846 | 6 | 00846 | Mon Feb 16 00:00:00 1970 PST
|
|
847 | 7 | 00847 | Tue Feb 17 00:00:00 1970 PST
|
|
848 | 8 | 00848 | Wed Feb 18 00:00:00 1970 PST
|
|
849 | 9 | 00849 | Thu Feb 19 00:00:00 1970 PST
|
|
850 | 0 | 00850 | Fri Feb 20 00:00:00 1970 PST
|
|
851 | 1 | 00851 | Sat Feb 21 00:00:00 1970 PST
|
|
852 | 2 | 00852 | Sun Feb 22 00:00:00 1970 PST
|
|
853 | 3 | 00853 | Mon Feb 23 00:00:00 1970 PST
|
|
854 | 4 | 00854 | Tue Feb 24 00:00:00 1970 PST
|
|
855 | 5 | 00855 | Wed Feb 25 00:00:00 1970 PST
|
|
856 | 6 | 00856 | Thu Feb 26 00:00:00 1970 PST
|
|
857 | 7 | 00857 | Fri Feb 27 00:00:00 1970 PST
|
|
858 | 8 | 00858 | Sat Feb 28 00:00:00 1970 PST
|
|
859 | 9 | 00859 | Sun Mar 01 00:00:00 1970 PST
|
|
860 | 0 | 00860 | Mon Mar 02 00:00:00 1970 PST
|
|
861 | 1 | 00861 | Tue Mar 03 00:00:00 1970 PST
|
|
862 | 2 | 00862 | Wed Mar 04 00:00:00 1970 PST
|
|
863 | 3 | 00863 | Thu Mar 05 00:00:00 1970 PST
|
|
864 | 4 | 00864 | Fri Mar 06 00:00:00 1970 PST
|
|
865 | 5 | 00865 | Sat Mar 07 00:00:00 1970 PST
|
|
866 | 6 | 00866 | Sun Mar 08 00:00:00 1970 PST
|
|
867 | 7 | 00867 | Mon Mar 09 00:00:00 1970 PST
|
|
868 | 8 | 00868 | Tue Mar 10 00:00:00 1970 PST
|
|
869 | 9 | 00869 | Wed Mar 11 00:00:00 1970 PST
|
|
870 | 0 | 00870 | Thu Mar 12 00:00:00 1970 PST
|
|
871 | 1 | 00871 | Fri Mar 13 00:00:00 1970 PST
|
|
872 | 2 | 00872 | Sat Mar 14 00:00:00 1970 PST
|
|
873 | 3 | 00873 | Sun Mar 15 00:00:00 1970 PST
|
|
874 | 4 | 00874 | Mon Mar 16 00:00:00 1970 PST
|
|
875 | 5 | 00875 | Tue Mar 17 00:00:00 1970 PST
|
|
876 | 6 | 00876 | Wed Mar 18 00:00:00 1970 PST
|
|
877 | 7 | 00877 | Thu Mar 19 00:00:00 1970 PST
|
|
878 | 8 | 00878 | Fri Mar 20 00:00:00 1970 PST
|
|
879 | 9 | 00879 | Sat Mar 21 00:00:00 1970 PST
|
|
880 | 0 | 00880 | Sun Mar 22 00:00:00 1970 PST
|
|
881 | 1 | 00881 | Mon Mar 23 00:00:00 1970 PST
|
|
882 | 2 | 00882 | Tue Mar 24 00:00:00 1970 PST
|
|
883 | 3 | 00883 | Wed Mar 25 00:00:00 1970 PST
|
|
884 | 4 | 00884 | Thu Mar 26 00:00:00 1970 PST
|
|
885 | 5 | 00885 | Fri Mar 27 00:00:00 1970 PST
|
|
886 | 6 | 00886 | Sat Mar 28 00:00:00 1970 PST
|
|
887 | 7 | 00887 | Sun Mar 29 00:00:00 1970 PST
|
|
888 | 8 | 00888 | Mon Mar 30 00:00:00 1970 PST
|
|
889 | 9 | 00889 | Tue Mar 31 00:00:00 1970 PST
|
|
890 | 0 | 00890 | Wed Apr 01 00:00:00 1970 PST
|
|
891 | 1 | 00891 | Thu Apr 02 00:00:00 1970 PST
|
|
892 | 2 | 00892 | Fri Apr 03 00:00:00 1970 PST
|
|
893 | 3 | 00893 | Sat Apr 04 00:00:00 1970 PST
|
|
894 | 4 | 00894 | Sun Apr 05 00:00:00 1970 PST
|
|
895 | 5 | 00895 | Mon Apr 06 00:00:00 1970 PST
|
|
896 | 6 | 00896 | Tue Apr 07 00:00:00 1970 PST
|
|
897 | 7 | 00897 | Wed Apr 08 00:00:00 1970 PST
|
|
898 | 8 | 00898 | Thu Apr 09 00:00:00 1970 PST
|
|
899 | 9 | 00899 | Fri Apr 10 00:00:00 1970 PST
|
|
900 | 0 | 00900 | Thu Jan 01 00:00:00 1970 PST
|
|
901 | 1 | 00901 | Fri Jan 02 00:00:00 1970 PST
|
|
902 | 2 | 00902 | Sat Jan 03 00:00:00 1970 PST
|
|
903 | 3 | 00903 | Sun Jan 04 00:00:00 1970 PST
|
|
904 | 4 | 00904 | Mon Jan 05 00:00:00 1970 PST
|
|
905 | 5 | 00905 | Tue Jan 06 00:00:00 1970 PST
|
|
906 | 6 | 00906 | Wed Jan 07 00:00:00 1970 PST
|
|
907 | 7 | 00907 | Thu Jan 08 00:00:00 1970 PST
|
|
908 | 8 | 00908 | Fri Jan 09 00:00:00 1970 PST
|
|
909 | 9 | 00909 | Sat Jan 10 00:00:00 1970 PST
|
|
910 | 0 | 00910 | Sun Jan 11 00:00:00 1970 PST
|
|
911 | 1 | 00911 | Mon Jan 12 00:00:00 1970 PST
|
|
912 | 2 | 00912 | Tue Jan 13 00:00:00 1970 PST
|
|
913 | 3 | 00913 | Wed Jan 14 00:00:00 1970 PST
|
|
914 | 4 | 00914 | Thu Jan 15 00:00:00 1970 PST
|
|
915 | 5 | 00915 | Fri Jan 16 00:00:00 1970 PST
|
|
916 | 6 | 00916 | Sat Jan 17 00:00:00 1970 PST
|
|
917 | 7 | 00917 | Sun Jan 18 00:00:00 1970 PST
|
|
918 | 8 | 00918 | Mon Jan 19 00:00:00 1970 PST
|
|
919 | 9 | 00919 | Tue Jan 20 00:00:00 1970 PST
|
|
920 | 0 | 00920 | Wed Jan 21 00:00:00 1970 PST
|
|
921 | 1 | 00921 | Thu Jan 22 00:00:00 1970 PST
|
|
922 | 2 | 00922 | Fri Jan 23 00:00:00 1970 PST
|
|
923 | 3 | 00923 | Sat Jan 24 00:00:00 1970 PST
|
|
924 | 4 | 00924 | Sun Jan 25 00:00:00 1970 PST
|
|
925 | 5 | 00925 | Mon Jan 26 00:00:00 1970 PST
|
|
926 | 6 | 00926 | Tue Jan 27 00:00:00 1970 PST
|
|
927 | 7 | 00927 | Wed Jan 28 00:00:00 1970 PST
|
|
928 | 8 | 00928 | Thu Jan 29 00:00:00 1970 PST
|
|
929 | 9 | 00929 | Fri Jan 30 00:00:00 1970 PST
|
|
930 | 0 | 00930 | Sat Jan 31 00:00:00 1970 PST
|
|
931 | 1 | 00931 | Sun Feb 01 00:00:00 1970 PST
|
|
932 | 2 | 00932 | Mon Feb 02 00:00:00 1970 PST
|
|
933 | 3 | 00933 | Tue Feb 03 00:00:00 1970 PST
|
|
934 | 4 | 00934 | Wed Feb 04 00:00:00 1970 PST
|
|
935 | 5 | 00935 | Thu Feb 05 00:00:00 1970 PST
|
|
936 | 6 | 00936 | Fri Feb 06 00:00:00 1970 PST
|
|
937 | 7 | 00937 | Sat Feb 07 00:00:00 1970 PST
|
|
938 | 8 | 00938 | Sun Feb 08 00:00:00 1970 PST
|
|
939 | 9 | 00939 | Mon Feb 09 00:00:00 1970 PST
|
|
940 | 0 | 00940 | Tue Feb 10 00:00:00 1970 PST
|
|
941 | 1 | 00941 | Wed Feb 11 00:00:00 1970 PST
|
|
942 | 2 | 00942 | Thu Feb 12 00:00:00 1970 PST
|
|
943 | 3 | 00943 | Fri Feb 13 00:00:00 1970 PST
|
|
944 | 4 | 00944 | Sat Feb 14 00:00:00 1970 PST
|
|
945 | 5 | 00945 | Sun Feb 15 00:00:00 1970 PST
|
|
946 | 6 | 00946 | Mon Feb 16 00:00:00 1970 PST
|
|
947 | 7 | 00947 | Tue Feb 17 00:00:00 1970 PST
|
|
948 | 8 | 00948 | Wed Feb 18 00:00:00 1970 PST
|
|
949 | 9 | 00949 | Thu Feb 19 00:00:00 1970 PST
|
|
950 | 0 | 00950 | Fri Feb 20 00:00:00 1970 PST
|
|
951 | 1 | 00951 | Sat Feb 21 00:00:00 1970 PST
|
|
952 | 2 | 00952 | Sun Feb 22 00:00:00 1970 PST
|
|
953 | 3 | 00953 | Mon Feb 23 00:00:00 1970 PST
|
|
954 | 4 | 00954 | Tue Feb 24 00:00:00 1970 PST
|
|
955 | 5 | 00955 | Wed Feb 25 00:00:00 1970 PST
|
|
956 | 6 | 00956 | Thu Feb 26 00:00:00 1970 PST
|
|
957 | 7 | 00957 | Fri Feb 27 00:00:00 1970 PST
|
|
958 | 8 | 00958 | Sat Feb 28 00:00:00 1970 PST
|
|
959 | 9 | 00959 | Sun Mar 01 00:00:00 1970 PST
|
|
960 | 0 | 00960 | Mon Mar 02 00:00:00 1970 PST
|
|
961 | 1 | 00961 | Tue Mar 03 00:00:00 1970 PST
|
|
962 | 2 | 00962 | Wed Mar 04 00:00:00 1970 PST
|
|
963 | 3 | 00963 | Thu Mar 05 00:00:00 1970 PST
|
|
964 | 4 | 00964 | Fri Mar 06 00:00:00 1970 PST
|
|
965 | 5 | 00965 | Sat Mar 07 00:00:00 1970 PST
|
|
966 | 6 | 00966 | Sun Mar 08 00:00:00 1970 PST
|
|
967 | 7 | 00967 | Mon Mar 09 00:00:00 1970 PST
|
|
968 | 8 | 00968 | Tue Mar 10 00:00:00 1970 PST
|
|
969 | 9 | 00969 | Wed Mar 11 00:00:00 1970 PST
|
|
970 | 0 | 00970 | Thu Mar 12 00:00:00 1970 PST
|
|
971 | 1 | 00971 | Fri Mar 13 00:00:00 1970 PST
|
|
972 | 2 | 00972 | Sat Mar 14 00:00:00 1970 PST
|
|
973 | 3 | 00973 | Sun Mar 15 00:00:00 1970 PST
|
|
974 | 4 | 00974 | Mon Mar 16 00:00:00 1970 PST
|
|
975 | 5 | 00975 | Tue Mar 17 00:00:00 1970 PST
|
|
976 | 6 | 00976 | Wed Mar 18 00:00:00 1970 PST
|
|
977 | 7 | 00977 | Thu Mar 19 00:00:00 1970 PST
|
|
978 | 8 | 00978 | Fri Mar 20 00:00:00 1970 PST
|
|
979 | 9 | 00979 | Sat Mar 21 00:00:00 1970 PST
|
|
980 | 0 | 00980 | Sun Mar 22 00:00:00 1970 PST
|
|
981 | 1 | 00981 | Mon Mar 23 00:00:00 1970 PST
|
|
982 | 2 | 00982 | Tue Mar 24 00:00:00 1970 PST
|
|
983 | 3 | 00983 | Wed Mar 25 00:00:00 1970 PST
|
|
984 | 4 | 00984 | Thu Mar 26 00:00:00 1970 PST
|
|
985 | 5 | 00985 | Fri Mar 27 00:00:00 1970 PST
|
|
986 | 6 | 00986 | Sat Mar 28 00:00:00 1970 PST
|
|
987 | 7 | 00987 | Sun Mar 29 00:00:00 1970 PST
|
|
988 | 8 | 00988 | Mon Mar 30 00:00:00 1970 PST
|
|
989 | 9 | 00989 | Tue Mar 31 00:00:00 1970 PST
|
|
990 | 0 | 00990 | Wed Apr 01 00:00:00 1970 PST
|
|
991 | 1 | 00991 | Thu Apr 02 00:00:00 1970 PST
|
|
992 | 2 | 00992 | Fri Apr 03 00:00:00 1970 PST
|
|
993 | 3 | 00993 | Sat Apr 04 00:00:00 1970 PST
|
|
994 | 4 | 00994 | Sun Apr 05 00:00:00 1970 PST
|
|
995 | 5 | 00995 | Mon Apr 06 00:00:00 1970 PST
|
|
996 | 6 | 00996 | Tue Apr 07 00:00:00 1970 PST
|
|
997 | 7 | 00997 | Wed Apr 08 00:00:00 1970 PST
|
|
998 | 8 | 00998 | Thu Apr 09 00:00:00 1970 PST
|
|
999 | 9 | 00999 | Fri Apr 10 00:00:00 1970 PST
|
|
1000 | 0 | 01000 | Thu Jan 01 00:00:00 1970 PST
|
|
1001 | 101 | 0000100001 |
|
|
1002 | 102 | 0000200002 |
|
|
1003 | 103 | 0000300003 |
|
|
1004 | 104 | 0000400004 |
|
|
1005 | 105 | 0000500005 |
|
|
1006 | 106 | 0000600006 |
|
|
1007 | 107 | 0000700007 |
|
|
1008 | 108 | 0000800008 |
|
|
1009 | 109 | 0000900009 |
|
|
1010 | 100 | 0001000010 |
|
|
1011 | 101 | 0001100011 |
|
|
1012 | 102 | 0001200012 |
|
|
1013 | 103 | 0001300013 |
|
|
1014 | 104 | 0001400014 |
|
|
1015 | 105 | 0001500015 |
|
|
1016 | 106 | 0001600016 |
|
|
1017 | 107 | 0001700017 |
|
|
1018 | 108 | 0001800018 |
|
|
1019 | 109 | 0001900019 |
|
|
1020 | 100 | 0002000020 |
|
|
1104 | 204 | ddd |
|
|
1105 | 205 | eee |
|
|
(1022 rows)
|
|
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: check constraints
|
|
-- --------------------------------------
|
|
-- openGauss not support to "ALTER FOREIGN TABLE ft1 ADD CONSTRAINT", so this test module
|
|
-- is unuseful.
|
|
-- ======================================================================================================================================
|
|
-- Consistent check constraints provide consistent results
|
|
ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2positive CHECK (c2 >= 0);
|
|
ERROR: "ft1" is not a table
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(*)
|
|
-> Foreign Scan on public.ft1
|
|
Node ID: 1
|
|
Remote SQL: SELECT NULL FROM "S 1"."T 1" WHERE ((c2 < 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT NULL FROM "S 1"."T 1" WHERE ((c2 < 0))
|
|
Row Adapter
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: NULL::text
|
|
Filter: ("T 1".c2 < 0)
|
|
|
|
(14 rows)
|
|
|
|
SELECT count(*) FROM ft1 WHERE c2 < 0;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SET constraint_exclusion = 'on';
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0;
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------
|
|
Aggregate
|
|
Output: count(*)
|
|
-> Foreign Scan on public.ft1
|
|
Node ID: 1
|
|
Remote SQL: SELECT NULL FROM "S 1"."T 1" WHERE ((c2 < 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT NULL FROM "S 1"."T 1" WHERE ((c2 < 0))
|
|
Row Adapter
|
|
Output: (NULL::text)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: NULL::text
|
|
Filter: ("T 1".c2 < 0)
|
|
|
|
(14 rows)
|
|
|
|
SELECT count(*) FROM ft1 WHERE c2 < 0;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
RESET constraint_exclusion;
|
|
-- check constraint is enforced on the remote side, not locally
|
|
INSERT INTO ft1(c1, c2) VALUES(1111, -2); -- c2positive
|
|
UPDATE ft1 SET c2 = -c2 WHERE c1 = 1; -- c2positive
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE (("C 1" = 1)) FOR UPDATE
|
|
ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2positive;
|
|
ERROR: constraint "ft1_c2positive" of relation "ft1" does not exist
|
|
-- But inconsistent check constraints provide inconsistent results
|
|
ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2negative CHECK (c2 < 0);
|
|
ERROR: "ft1" is not a table
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(*))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT count(*) FROM "S 1"."T 1" WHERE ((c2 >= 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(*) FROM "S 1"."T 1" WHERE ((c2 >= 0))
|
|
Row Adapter
|
|
Output: (count(*))
|
|
-> Vector Aggregate
|
|
Output: count(*)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: 'Dummy'
|
|
Filter: ("T 1".c2 >= 0)
|
|
|
|
(16 rows)
|
|
|
|
SELECT count(*) FROM ft1 WHERE c2 >= 0;
|
|
count
|
|
-------
|
|
1022
|
|
(1 row)
|
|
|
|
SET constraint_exclusion = 'on';
|
|
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------
|
|
Foreign Scan
|
|
Output: (count(*))
|
|
Node ID: 1
|
|
Relations: Aggregate on (public.ft1)
|
|
Remote SQL: SELECT count(*) FROM "S 1"."T 1" WHERE ((c2 >= 0))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT count(*) FROM "S 1"."T 1" WHERE ((c2 >= 0))
|
|
Row Adapter
|
|
Output: (count(*))
|
|
-> Vector Aggregate
|
|
Output: count(*)
|
|
-> CStore Scan on "S 1"."T 1"
|
|
Output: 'Dummy'
|
|
Filter: ("T 1".c2 >= 0)
|
|
|
|
(16 rows)
|
|
|
|
SELECT count(*) FROM ft1 WHERE c2 >= 0;
|
|
count
|
|
-------
|
|
1022
|
|
(1 row)
|
|
|
|
RESET constraint_exclusion;
|
|
-- local check constraint is not actually enforced
|
|
INSERT INTO ft1(c1, c2) VALUES(1111, 2);
|
|
ERROR: duplicate key value violates unique constraint "t1_pkey"
|
|
DETAIL: Key ("C 1")=(1111) already exists.
|
|
CONTEXT: Remote SQL command: INSERT INTO "S 1"."T 1"("C 1", c2, c3, c4, c5, c6, c7, c8) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
|
UPDATE ft1 SET c2 = c2 + 1 WHERE c1 = 1;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "T 1"
|
|
CONTEXT: Remote SQL command: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8, ctid, tableoid FROM "S 1"."T 1" WHERE (("C 1" = 1)) FOR UPDATE
|
|
ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2negative;
|
|
ERROR: constraint "ft1_c2negative" of relation "ft1" does not exist
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: IUD VIEW and WITH CHECK OPTION constraints
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
CREATE TABLE base_tbl (id int, a int, b int) with (orientation=column);
|
|
ALTER TABLE base_tbl SET (autovacuum_enabled = 'false');
|
|
CREATE FOREIGN TABLE foreign_tbl (id int, a int, b int) SERVER loopback OPTIONS (table_name 'base_tbl');
|
|
CREATE VIEW rw_view1 AS SELECT * FROM foreign_tbl WHERE a < b and id = 1;
|
|
CREATE VIEW rw_view2 AS SELECT * FROM foreign_tbl WHERE a < b and id = 2 WITH CHECK OPTION;
|
|
\d+ rw_view1
|
|
View "public.rw_view1"
|
|
Column | Type | Modifiers | Storage | Description
|
|
--------+---------+-----------+---------+-------------
|
|
id | integer | | plain |
|
|
a | integer | | plain |
|
|
b | integer | | plain |
|
|
View definition:
|
|
SELECT *
|
|
FROM foreign_tbl
|
|
WHERE foreign_tbl.a < foreign_tbl.b AND foreign_tbl.id = 1;
|
|
|
|
\d+ rw_view2
|
|
View "public.rw_view2"
|
|
Column | Type | Modifiers | Storage | Description
|
|
--------+---------+-----------+---------+-------------
|
|
id | integer | | plain |
|
|
a | integer | | plain |
|
|
b | integer | | plain |
|
|
View definition:
|
|
SELECT *
|
|
FROM foreign_tbl
|
|
WHERE foreign_tbl.a < foreign_tbl.b AND foreign_tbl.id = 2;
|
|
Options: check_option=cascaded
|
|
|
|
CREATE OR REPLACE FUNCTION checkdata(out tbname text, out id int, out a int, out b int) RETURNS SETOF record as $$
|
|
select * from (
|
|
(select 'rw_view1', * from rw_view1 where id = 1) union all
|
|
(select 'rw_view2', * from rw_view2 where id = 2) union all
|
|
(select 'base_tbl', * from base_tbl) union all
|
|
(select 'foreign_tbl', * from foreign_tbl)
|
|
) data(tbname, id, a, b)
|
|
order by 1,2,3,4;
|
|
$$ language sql;
|
|
-- simple case
|
|
EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view1 VALUES (1, 0, 5); -- should success
|
|
QUERY PLAN
|
|
------------------------------
|
|
Insert on public.foreign_tbl
|
|
-> Result
|
|
Output: 1, 0, 5
|
|
(3 rows)
|
|
|
|
INSERT INTO rw_view1 VALUES (1, 0, 5);
|
|
EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view1 VALUES (1, 10, 5); -- should success
|
|
QUERY PLAN
|
|
------------------------------
|
|
Insert on public.foreign_tbl
|
|
-> Result
|
|
Output: 1, 10, 5
|
|
(3 rows)
|
|
|
|
INSERT INTO rw_view1 VALUES (1, 10, 5);
|
|
EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view2 VALUES (2, 0, 5); -- should failed
|
|
QUERY PLAN
|
|
------------------------------
|
|
Insert on public.foreign_tbl
|
|
-> Result
|
|
Output: 2, 0, 5
|
|
(3 rows)
|
|
|
|
INSERT INTO rw_view2 VALUES (2, 0, 5);
|
|
ERROR: Un-support feature
|
|
DETAIL: column stored relation doesn't support INSERT returning
|
|
CONTEXT: Remote SQL command: INSERT INTO public.base_tbl(id, a, b) VALUES ($1, $2, $3) RETURNING id, a, b
|
|
select * from checkdata();
|
|
tbname | id | a | b
|
|
-------------+----+----+---
|
|
base_tbl | 1 | 0 | 5
|
|
base_tbl | 1 | 10 | 5
|
|
foreign_tbl | 1 | 0 | 5
|
|
foreign_tbl | 1 | 10 | 5
|
|
rw_view1 | 1 | 0 | 5
|
|
(5 rows)
|
|
|
|
EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view1 SET a = a + 20 where id = 1; -- should success
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------
|
|
Update on public.foreign_tbl
|
|
-> Foreign Scan on public.foreign_tbl
|
|
Output: foreign_tbl.id, (foreign_tbl.a + 20), foreign_tbl.b, foreign_tbl.ctid, foreign_tbl.tableoid
|
|
Node ID: 1
|
|
Remote SQL: SELECT id, a, b, ctid, tableoid FROM public.base_tbl WHERE ((a < b)) AND ((id = 1))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT id, a, b, ctid, tableoid FROM public.base_tbl WHERE ((a < b)) AND ((id = 1))
|
|
Row Adapter
|
|
Output: id, a, b, ctid, tableoid
|
|
-> CStore Scan on public.base_tbl
|
|
Output: id, a, b, ctid, tableoid
|
|
Filter: ((base_tbl.a < base_tbl.b) AND (base_tbl.id = 1))
|
|
|
|
(14 rows)
|
|
|
|
UPDATE rw_view1 SET a = a + 20 where id = 1;
|
|
select * from checkdata();
|
|
tbname | id | a | b
|
|
-------------+----+----+---
|
|
base_tbl | 1 | 10 | 5
|
|
base_tbl | 1 | 20 | 5
|
|
foreign_tbl | 1 | 10 | 5
|
|
foreign_tbl | 1 | 20 | 5
|
|
(4 rows)
|
|
|
|
insert into base_tbl values(1,100,99),(2,100,99);
|
|
EXPLAIN (VERBOSE, COSTS OFF) delete from rw_view1 where id = 1;
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------
|
|
Delete on public.foreign_tbl
|
|
-> Foreign Scan on public.foreign_tbl
|
|
Output: foreign_tbl.ctid, foreign_tbl.tableoid
|
|
Node ID: 1
|
|
Remote SQL: SELECT ctid, tableoid FROM public.base_tbl WHERE ((a < b)) AND ((id = 1))
|
|
|
|
FDW remote plans:
|
|
Node 1: EXPLAIN (VERBOSE ON, COSTS OFF) SELECT ctid, tableoid FROM public.base_tbl WHERE ((a < b)) AND ((id = 1))
|
|
Row Adapter
|
|
Output: ctid, tableoid
|
|
-> CStore Scan on public.base_tbl
|
|
Output: ctid, tableoid
|
|
Filter: ((base_tbl.a < base_tbl.b) AND (base_tbl.id = 1))
|
|
|
|
(14 rows)
|
|
|
|
delete from rw_view1 where id = 1;
|
|
select * from checkdata();
|
|
tbname | id | a | b
|
|
-------------+----+-----+----
|
|
base_tbl | 1 | 10 | 5
|
|
base_tbl | 1 | 20 | 5
|
|
base_tbl | 1 | 100 | 99
|
|
base_tbl | 2 | 100 | 99
|
|
foreign_tbl | 1 | 10 | 5
|
|
foreign_tbl | 1 | 20 | 5
|
|
foreign_tbl | 1 | 100 | 99
|
|
foreign_tbl | 2 | 100 | 99
|
|
(8 rows)
|
|
|
|
delete from base_tbl;
|
|
-- with trigger
|
|
CREATE FUNCTION row_before_insupd_trigfunc() RETURNS trigger AS $$BEGIN NEW.a := NEW.a + 10; RETURN NEW; END$$ LANGUAGE plpgsql;
|
|
CREATE TRIGGER row_before_insupd_trigger BEFORE INSERT OR UPDATE ON base_tbl FOR EACH ROW EXECUTE PROCEDURE row_before_insupd_trigfunc();
|
|
ERROR: Only support CREATE TRIGGER on regular row table.
|
|
-- not support, do nothing
|
|
DROP TRIGGER row_before_insupd_trigger ON base_tbl;
|
|
ERROR: trigger "row_before_insupd_trigger" for table "base_tbl" does not exist
|
|
DROP FUNCTION row_before_insupd_trigfunc;
|
|
DROP FUNCTION checkdata;
|
|
DROP VIEW rw_view1 cascade;
|
|
DROP VIEW rw_view2 cascade;
|
|
DROP FOREIGN TABLE foreign_tbl CASCADE;
|
|
DROP TABLE base_tbl CASCADE;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test serial columns (ie, sequence-based defaults)
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
create table loc1 (f1 serial, f2 text) with (orientation=column);
|
|
NOTICE: CREATE TABLE will create implicit sequence "loc1_f1_seq" for serial column "loc1.f1"
|
|
alter table loc1 set (autovacuum_enabled = 'false');
|
|
create foreign table rem1 (f1 serial, f2 text)
|
|
server loopback options(table_name 'loc1');
|
|
NOTICE: CREATE FOREIGN TABLE will create implicit sequence "rem1_f1_seq" for serial column "rem1.f1"
|
|
select pg_catalog.setval('rem1_f1_seq', 10, false);
|
|
setval
|
|
--------
|
|
10
|
|
(1 row)
|
|
|
|
insert into loc1(f2) values('hi');
|
|
insert into rem1(f2) values('hi remote');
|
|
insert into loc1(f2) values('bye');
|
|
insert into rem1(f2) values('bye remote');
|
|
select * from loc1;
|
|
f1 | f2
|
|
----+------------
|
|
1 | hi
|
|
10 | hi remote
|
|
2 | bye
|
|
11 | bye remote
|
|
(4 rows)
|
|
|
|
select * from rem1;
|
|
f1 | f2
|
|
----+------------
|
|
1 | hi
|
|
10 | hi remote
|
|
2 | bye
|
|
11 | bye remote
|
|
(4 rows)
|
|
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test generated columns
|
|
-- --------------------------------------
|
|
-- openGauss not support generated columns in column table.
|
|
-- ======================================================================================================================================
|
|
create table gloc1 (
|
|
a int,
|
|
b int generated always as (a * 2) stored)
|
|
with (orientation=column);
|
|
ERROR: column/timeseries store unsupport constraint "GENERATED COL"
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test local triggers
|
|
-- --------------------------------------
|
|
-- openGauss not support create trigger on foreign table and column table.
|
|
-- ======================================================================================================================================
|
|
create table tglog(id serial, context text) with (orientation=column);
|
|
NOTICE: CREATE TABLE will create implicit sequence "tglog_id_seq" for serial column "tglog.id"
|
|
create table previd(a int) with (orientation=column);
|
|
insert into previd values(0);
|
|
create or replace function showtrigger(id out int, context out text) returns setof record LANGUAGE plpgsql as
|
|
$$
|
|
DECLARE
|
|
r RECORD;
|
|
prev int;
|
|
BEGIN
|
|
select max(a) from previd into prev;
|
|
update previd set a = (select max(id) from tglog);
|
|
|
|
FOR r IN SELECT * FROM tglog where id > prev ORDER BY id
|
|
LOOP
|
|
id := r.id;
|
|
context := r.context;
|
|
return next;
|
|
END LOOP;
|
|
END;$$;
|
|
|
|
-- Trigger functions "borrowed" from triggers regress test.
|
|
CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE plpgsql AS $$
|
|
BEGIN
|
|
insert into tglog(context) values(
|
|
format('trigger_func(%s) called: action = %s, when = %s, level = %s',
|
|
TG_ARGV[0], TG_OP, TG_WHEN, TG_LEVEL));
|
|
RETURN NULL;
|
|
END;$$;
|
|
-- error, openGauss not support create trigger on foreign table
|
|
CREATE TRIGGER trig_stmt_before BEFORE DELETE OR INSERT OR UPDATE ON rem1
|
|
FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func();
|
|
ERROR: "rem1" is not a table or view
|
|
CREATE TRIGGER trig_stmt_after AFTER DELETE OR INSERT OR UPDATE ON rem1
|
|
FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func();
|
|
ERROR: "rem1" is not a table or view
|
|
-- success
|
|
CREATE TRIGGER trig_stmt_before BEFORE DELETE OR INSERT OR UPDATE ON loc1 --nspt
|
|
FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func();
|
|
ERROR: Only support CREATE TRIGGER on regular row table.
|
|
CREATE TRIGGER trig_stmt_after AFTER DELETE OR INSERT OR UPDATE ON loc1 --nspt
|
|
FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func();
|
|
ERROR: Only support CREATE TRIGGER on regular row table.
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test inheritance features
|
|
-- TEST-MODULE: test tuple routing for foreign-table partitions
|
|
-- --------------------------------------
|
|
-- unsupport feature of openGauss
|
|
-- ======================================================================================================================================
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test COPY FROM
|
|
-- --------------------------------------
|
|
-- ======================================================================================================================================
|
|
create table loc2 (f1 int primary key, f2 text) with (orientation=column);
|
|
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "loc2_pkey" for table "loc2"
|
|
alter table loc2 set (autovacuum_enabled = 'false');
|
|
create foreign table rem2 (f1 int, f2 text) server loopback options(table_name 'loc2');
|
|
-- Test basic functionality
|
|
copy rem2 from stdin;
|
|
select * from rem2;
|
|
f1 | f2
|
|
----+-----
|
|
1 | foo
|
|
2 | bar
|
|
(2 rows)
|
|
|
|
delete from rem2;
|
|
ERROR: SELECT FOR UPDATE/SHARE/NO KEY UPDATE/KEY SHARE cannot be used with column table "loc2"
|
|
CONTEXT: Remote SQL command: SELECT ctid, tableoid FROM public.loc2 FOR UPDATE
|
|
-- check constraint is enforced on the remote side, not locally
|
|
copy rem2 from stdin;
|
|
ERROR: duplicate key value violates unique constraint "loc2_pkey"
|
|
DETAIL: Key (f1)=(2) already exists.
|
|
CONTEXT: Remote SQL command: INSERT INTO public.loc2(f1, f2) VALUES ($1, $2)
|
|
COPY rem2, line 2: "2 bar"
|
|
select * from rem2;
|
|
f1 | f2
|
|
----+-----
|
|
1 | foo
|
|
2 | bar
|
|
(2 rows)
|
|
|
|
drop foreign table rem2;
|
|
drop table loc2;
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: test for TRUNCATE
|
|
-- TEST-MODULE: test IMPORT FOREIGN SCHEMA
|
|
-- TEST-MODULE: test partitionwise joins
|
|
-- TEST-MODULE: test partitionwise aggregates
|
|
-- TEST-MODULE: access rights and superuser
|
|
-- TEST-MODULE: reestablish new connection
|
|
-- TEST-MODULE: batch insert
|
|
-- TEST-MODULE: test asynchronous execution
|
|
-- TEST-MODULE: test invalid server and foreign table options
|
|
-- --------------------------------------
|
|
-- openGauss not support this feature, therefore, some cases that can run properly after modification are retained,
|
|
-- and some cases that cannot be supported are directly deleted.
|
|
-- If you want to restore the test case later, refer to README in the file header.
|
|
-- ======================================================================================================================================
|
|
-- ======================================================================================================================================
|
|
-- TEST-MODULE: clean up all the test data
|
|
-- --------------------------------------
|
|
-- heihei!
|
|
-- ======================================================================================================================================
|
|
\c regression
|
|
drop database postgresfdw_test_db_cstore;
|