@@ -388,13 +388,14 @@ EXPLAIN (VERBOSE, COSTS OFF)
388
388
Output: t1.c1, t2."C 1"
389
389
-> Merge Join
390
390
Output: t1.c1, t2."C 1"
391
+ Inner Unique: true
391
392
Merge Cond: (t1.c1 = t2."C 1")
392
393
-> Foreign Scan on public.ft2 t1
393
394
Output: t1.c1
394
395
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
395
396
-> Index Only Scan using t1_pkey on "S 1"."T 1" t2
396
397
Output: t2."C 1"
397
- (10 rows)
398
+ (11 rows)
398
399
399
400
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;
400
401
c1 | C 1
@@ -421,13 +422,14 @@ EXPLAIN (VERBOSE, COSTS OFF)
421
422
Output: t1.c1, t2."C 1"
422
423
-> Merge Left Join
423
424
Output: t1.c1, t2."C 1"
425
+ Inner Unique: true
424
426
Merge Cond: (t1.c1 = t2."C 1")
425
427
-> Foreign Scan on public.ft2 t1
426
428
Output: t1.c1
427
429
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
428
430
-> Index Only Scan using t1_pkey on "S 1"."T 1" t2
429
431
Output: t2."C 1"
430
- (10 rows)
432
+ (11 rows)
431
433
432
434
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;
433
435
c1 | C 1
@@ -454,14 +456,15 @@ EXPLAIN (VERBOSE, COSTS OFF)
454
456
Output: t1."C 1"
455
457
-> Merge Right Join
456
458
Output: t1."C 1"
459
+ Inner Unique: true
457
460
Merge Cond: (t3.c1 = t1."C 1")
458
461
-> Foreign Scan
459
462
Output: t3.c1
460
463
Relations: (public.ft1 t2) INNER JOIN (public.ft2 t3)
461
464
Remote SQL: SELECT r3."C 1" FROM ("S 1"."T 1" r2 INNER JOIN "S 1"."T 1" r3 ON (((r2."C 1" = r3."C 1")))) ORDER BY r2."C 1" ASC NULLS LAST
462
465
-> Index Only Scan using t1_pkey on "S 1"."T 1" t1
463
466
Output: t1."C 1"
464
- (11 rows)
467
+ (12 rows)
465
468
466
469
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;
467
470
C 1
@@ -489,14 +492,15 @@ EXPLAIN (VERBOSE, COSTS OFF)
489
492
Output: t1."C 1", t2.c1, t3.c1
490
493
-> Merge Right Join
491
494
Output: t1."C 1", t2.c1, t3.c1
495
+ Inner Unique: true
492
496
Merge Cond: (t3.c1 = t1."C 1")
493
497
-> Foreign Scan
494
498
Output: t3.c1, t2.c1
495
499
Relations: (public.ft2 t3) LEFT JOIN (public.ft1 t2)
496
500
Remote SQL: SELECT r3."C 1", r2."C 1" FROM ("S 1"."T 1" r3 LEFT JOIN "S 1"."T 1" r2 ON (((r2."C 1" = r3."C 1")))) ORDER BY r3."C 1" ASC NULLS LAST
497
501
-> Index Only Scan using t1_pkey on "S 1"."T 1" t1
498
502
Output: t1."C 1"
499
- (11 rows)
503
+ (12 rows)
500
504
501
505
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;
502
506
C 1 | c1 | c1
@@ -522,14 +526,15 @@ EXPLAIN (VERBOSE, COSTS OFF)
522
526
Output: t1."C 1", t2.c1, t3.c1
523
527
-> Merge Full Join
524
528
Output: t1."C 1", t2.c1, t3.c1
529
+ Inner Unique: true
525
530
Merge Cond: (t3.c1 = t1."C 1")
526
531
-> Foreign Scan
527
532
Output: t2.c1, t3.c1
528
533
Relations: (public.ft1 t2) FULL JOIN (public.ft2 t3)
529
534
Remote SQL: SELECT r2."C 1", r3."C 1" FROM ("S 1"."T 1" r2 FULL JOIN "S 1"."T 1" r3 ON (((r2."C 1" = r3."C 1")))) ORDER BY r3."C 1" ASC NULLS LAST
530
535
-> Index Only Scan using t1_pkey on "S 1"."T 1" t1
531
536
Output: t1."C 1"
532
- (11 rows)
537
+ (12 rows)
533
538
534
539
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;
535
540
C 1 | c1 | c1
@@ -1759,8 +1764,8 @@ SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER B
1759
1764
-- SEMI JOIN, not pushed down
1760
1765
EXPLAIN (VERBOSE, COSTS OFF)
1761
1766
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;
1762
- QUERY PLAN
1763
- ---------------------------------------------------------------------------------------------
1767
+ QUERY PLAN
1768
+ ---------------------------------------------------------------------------------------
1764
1769
Limit
1765
1770
Output: t1.c1
1766
1771
-> Merge Semi Join
@@ -1769,12 +1774,10 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1)
1769
1774
-> Foreign Scan on public.ft1 t1
1770
1775
Output: t1.c1
1771
1776
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
1772
- -> Materialize
1777
+ -> Foreign Scan on public.ft2 t2
1773
1778
Output: t2.c1
1774
- -> Foreign Scan on public.ft2 t2
1775
- Output: t2.c1
1776
- Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
1777
- (13 rows)
1779
+ Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
1780
+ (11 rows)
1778
1781
1779
1782
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;
1780
1783
c1
@@ -1804,12 +1807,10 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2
1804
1807
-> Foreign Scan on public.ft1 t1
1805
1808
Output: t1.c1
1806
1809
Remote SQL: SELECT "C 1" FROM "S 1"."T 1" ORDER BY "C 1" ASC NULLS LAST
1807
- -> Materialize
1810
+ -> Foreign Scan on public.ft2 t2
1808
1811
Output: t2.c2
1809
- -> Foreign Scan on public.ft2 t2
1810
- Output: t2.c2
1811
- Remote SQL: SELECT c2 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
1812
- (13 rows)
1812
+ Remote SQL: SELECT c2 FROM "S 1"."T 1" ORDER BY c2 ASC NULLS LAST
1813
+ (11 rows)
1813
1814
1814
1815
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;
1815
1816
c1
@@ -2837,20 +2838,18 @@ explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C";
2837
2838
2838
2839
explain (verbose, costs off) select * from ft3 f, loct3 l
2839
2840
where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo';
2840
- QUERY PLAN
2841
- -------------------------------------------------------------
2842
- Hash Join
2841
+ QUERY PLAN
2842
+ ---------------------------------------------------------
2843
+ Nested Loop
2843
2844
Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3
2844
- Hash Cond: ((f.f3)::text = (l.f3)::text)
2845
+ Join Filter: ((f.f3)::text = (l.f3)::text)
2846
+ -> Index Scan using loct3_f1_key on public.loct3 l
2847
+ Output: l.f1, l.f2, l.f3
2848
+ Index Cond: (l.f1 = 'foo'::text)
2845
2849
-> Foreign Scan on public.ft3 f
2846
2850
Output: f.f1, f.f2, f.f3
2847
2851
Remote SQL: SELECT f1, f2, f3 FROM public.loct3
2848
- -> Hash
2849
- Output: l.f1, l.f2, l.f3
2850
- -> Index Scan using loct3_f1_key on public.loct3 l
2851
- Output: l.f1, l.f2, l.f3
2852
- Index Cond: (l.f1 = 'foo'::text)
2853
- (11 rows)
2852
+ (9 rows)
2854
2853
2855
2854
-- ===================================================================
2856
2855
-- test writable foreign table stuff
@@ -5367,6 +5366,7 @@ select * from bar where f1 in (select f1 from foo) for share;
5367
5366
Output: bar.f1, bar.f2, bar.ctid, bar.*, bar.tableoid, foo.ctid, foo.*, foo.tableoid
5368
5367
-> Hash Join
5369
5368
Output: bar.f1, bar.f2, bar.ctid, bar.*, bar.tableoid, foo.ctid, foo.*, foo.tableoid
5369
+ Inner Unique: true
5370
5370
Hash Cond: (bar.f1 = foo.f1)
5371
5371
-> Append
5372
5372
-> Seq Scan on public.bar
@@ -5385,7 +5385,7 @@ select * from bar where f1 in (select f1 from foo) for share;
5385
5385
-> Foreign Scan on public.foo2
5386
5386
Output: foo2.ctid, foo2.*, foo2.tableoid, foo2.f1
5387
5387
Remote SQL: SELECT f1, f2, f3, ctid FROM public.loct1
5388
- (22 rows)
5388
+ (23 rows)
5389
5389
5390
5390
select * from bar where f1 in (select f1 from foo) for share;
5391
5391
f1 | f2
@@ -5407,6 +5407,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo);
5407
5407
Remote SQL: UPDATE public.loct2 SET f2 = $2 WHERE ctid = $1
5408
5408
-> Hash Join
5409
5409
Output: bar.f1, (bar.f2 + 100), bar.ctid, foo.ctid, foo.*, foo.tableoid
5410
+ Inner Unique: true
5410
5411
Hash Cond: (bar.f1 = foo.f1)
5411
5412
-> Seq Scan on public.bar
5412
5413
Output: bar.f1, bar.f2, bar.ctid
@@ -5423,6 +5424,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo);
5423
5424
Remote SQL: SELECT f1, f2, f3, ctid FROM public.loct1
5424
5425
-> Hash Join
5425
5426
Output: bar2.f1, (bar2.f2 + 100), bar2.f3, bar2.ctid, foo.ctid, foo.*, foo.tableoid
5427
+ Inner Unique: true
5426
5428
Hash Cond: (bar2.f1 = foo.f1)
5427
5429
-> Foreign Scan on public.bar2
5428
5430
Output: bar2.f1, bar2.f2, bar2.f3, bar2.ctid
@@ -5438,7 +5440,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo);
5438
5440
-> Foreign Scan on public.foo2
5439
5441
Output: foo2.ctid, foo2.*, foo2.tableoid, foo2.f1
5440
5442
Remote SQL: SELECT f1, f2, f3, ctid FROM public.loct1
5441
- (37 rows)
5443
+ (39 rows)
5442
5444
5443
5445
update bar set f2 = f2 + 100 where f1 in (select f1 from foo);
5444
5446
select tableoid::regclass, * from bar order by 1,2;
0 commit comments