|
|
|
|
@ -6349,6 +6349,50 @@ on true; |
|
|
|
|
-> Seq Scan on int8_tbl y |
|
|
|
|
(7 rows) |
|
|
|
|
|
|
|
|
|
-- Test processing target lists in lateral subqueries |
|
|
|
|
explain (verbose, costs off) |
|
|
|
|
SELECT t3.a FROM sj t1, sj t2, |
|
|
|
|
LATERAL (SELECT t1.a WHERE t1.a <> 1 |
|
|
|
|
GROUP BY (t1.a) HAVING t1.a > 0 ORDER BY t1.a LIMIT 1) t3, |
|
|
|
|
LATERAL (SELECT t1.a,t3.a WHERE t1.a <> t3.a+t2.a |
|
|
|
|
GROUP BY (t3.a) HAVING t1.a > t3.a*t3.a+t2.a/t1.a LIMIT 2) t4, |
|
|
|
|
LATERAL (SELECT * FROM sj TABLESAMPLE bernoulli(t1.a/t2.a) |
|
|
|
|
REPEATABLE (t1.a+t2.a)) t5, |
|
|
|
|
LATERAL generate_series(1, t1.a + t2.a) AS t6 |
|
|
|
|
WHERE t1.a = t2.a; |
|
|
|
|
QUERY PLAN |
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------- |
|
|
|
|
Nested Loop |
|
|
|
|
Output: (t2.a) |
|
|
|
|
-> Nested Loop |
|
|
|
|
Output: t2.a, (t2.a) |
|
|
|
|
-> Nested Loop |
|
|
|
|
Output: t2.a, (t2.a) |
|
|
|
|
-> Nested Loop |
|
|
|
|
Output: t2.a, (t2.a) |
|
|
|
|
-> Seq Scan on public.sj t2 |
|
|
|
|
Output: t2.a, t2.b, t2.c |
|
|
|
|
Filter: (t2.a IS NOT NULL) |
|
|
|
|
-> Limit |
|
|
|
|
Output: (t2.a) |
|
|
|
|
-> Group |
|
|
|
|
Output: t2.a |
|
|
|
|
-> Result |
|
|
|
|
One-Time Filter: ((t2.a <> 1) AND (t2.a > 0)) |
|
|
|
|
-> Limit |
|
|
|
|
Output: NULL::integer, ((t2.a)) |
|
|
|
|
-> Group |
|
|
|
|
Output: NULL::integer, (t2.a) |
|
|
|
|
-> Result |
|
|
|
|
One-Time Filter: ((t2.a <> ((t2.a) + t2.a)) AND (t2.a > (((t2.a) * (t2.a)) + (t2.a / t2.a)))) |
|
|
|
|
-> Sample Scan on public.sj |
|
|
|
|
Output: sj.a, sj.b, sj.c |
|
|
|
|
Sampling: bernoulli ((t2.a / t2.a)) REPEATABLE ((t2.a + t2.a)) |
|
|
|
|
-> Function Scan on pg_catalog.generate_series t6 |
|
|
|
|
Output: t6.t6 |
|
|
|
|
Function Call: generate_series(1, (t2.a + t2.a)) |
|
|
|
|
(29 rows) |
|
|
|
|
|
|
|
|
|
-- Check updating of Lateral links from top-level query to the removing relation |
|
|
|
|
explain (COSTS OFF) |
|
|
|
|
SELECT * FROM pg_am am WHERE am.amname IN ( |
|
|
|
|
|