Some cleanup in multi_subquery test.

Remove trailing whitespace and use of EXPLAIN instead of
EXPLAIN (COSTS OFF).
pull/1351/head
Andres Freund 2017-04-26 11:16:59 -07:00
parent b0585c7df6
commit 1f93c325fa
3 changed files with 161 additions and 149 deletions

View File

@ -702,7 +702,8 @@ LIMIT
-- Same queries above with explain -- Same queries above with explain
-- Simple join subquery pushdown -- Simple join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average avg(array_length(events, 1)) AS event_average
FROM FROM
(SELECT (SELECT
@ -729,7 +730,8 @@ FROM
user_id) AS subquery; user_id) AS subquery;
-- Union and left join subquery pushdown -- Union and left join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
hasdone hasdone
FROM FROM
@ -793,7 +795,8 @@ GROUP BY
hasdone; hasdone;
-- Union, left join and having subquery pushdown -- Union, left join and having subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
count_pay count_pay
FROM ( FROM (
@ -865,7 +868,8 @@ ORDER BY
count_pay; count_pay;
-- Lateral join subquery pushdown -- Lateral join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
tenant_id, tenant_id,
user_id, user_id,
user_lastseen, user_lastseen,

View File

@ -732,7 +732,8 @@ LIMIT
-- Same queries above with explain -- Same queries above with explain
-- Simple join subquery pushdown -- Simple join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average avg(array_length(events, 1)) AS event_average
FROM FROM
(SELECT (SELECT
@ -759,29 +760,30 @@ FROM
user_id) AS subquery; user_id) AS subquery;
QUERY PLAN QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=0.00..0.00 rows=0 width=0) Aggregate
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> Aggregate (cost=40.01..40.02 rows=1 width=16) -> Aggregate
-> GroupAggregate (cost=39.89..39.99 rows=1 width=48) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Merge Join (cost=39.89..39.97 rows=1 width=540) -> Merge Join
Merge Cond: ((((users.composite_id).tenant_id) = ((events.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events.composite_id).user_id))) Merge Cond: ((((users.composite_id).tenant_id) = ((events.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events.composite_id).user_id)))
-> Sort (cost=28.08..28.09 rows=6 width=32) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Sort (cost=11.81..11.82 rows=3 width=556) -> Sort
Sort Key: ((events.composite_id).tenant_id), ((events.composite_id).user_id) Sort Key: ((events.composite_id).tenant_id), ((events.composite_id).user_id)
-> Seq Scan on events_270009 events (cost=0.00..11.79 rows=3 width=556) -> Seq Scan on events_270009 events
Filter: ((event_type)::text = ANY ('{click,submit,pay}'::text[])) Filter: ((event_type)::text = ANY ('{click,submit,pay}'::text[]))
(19 rows) (19 rows)
-- Union and left join subquery pushdown -- Union and left join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
hasdone hasdone
FROM FROM
@ -845,50 +847,51 @@ GROUP BY
hasdone; hasdone;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HashAggregate (cost=0.00..0.00 rows=0 width=0) HashAggregate
Group Key: remote_scan.hasdone Group Key: remote_scan.hasdone
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> GroupAggregate (cost=91.93..91.98 rows=2 width=48) -> GroupAggregate
Group Key: subquery_top.hasdone Group Key: subquery_top.hasdone
-> Sort (cost=91.93..91.93 rows=2 width=64) -> Sort
Sort Key: subquery_top.hasdone Sort Key: subquery_top.hasdone
-> Subquery Scan on subquery_top (cost=91.85..91.92 rows=2 width=64) -> Subquery Scan on subquery_top
-> GroupAggregate (cost=91.85..91.90 rows=2 width=112) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
-> Sort (cost=91.85..91.85 rows=2 width=88) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
-> Merge Left Join (cost=91.75..91.84 rows=2 width=88) -> Merge Left Join
Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id))) Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id)))
-> Unique (cost=79.46..79.48 rows=2 width=56) -> Unique
-> Sort (cost=79.46..79.47 rows=2 width=56) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time
-> Append (cost=0.00..79.45 rows=2 width=56) -> Append
-> Nested Loop (cost=0.00..39.72 rows=1 width=56) -> Nested Loop
Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id)) Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id))
-> Seq Scan on events_270009 events (cost=0.00..11.62 rows=1 width=40) -> Seq Scan on events_270009 events
Filter: ((event_type)::text = 'click'::text) Filter: ((event_type)::text = 'click'::text)
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Nested Loop (cost=0.00..39.72 rows=1 width=56) -> Nested Loop
Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id)) Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id))
-> Seq Scan on events_270009 events_1 (cost=0.00..11.62 rows=1 width=40) -> Seq Scan on events_270009 events_1
Filter: ((event_type)::text = 'submit'::text) Filter: ((event_type)::text = 'submit'::text)
-> Seq Scan on users_270013 users_1 (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users_1
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Materialize (cost=12.29..12.31 rows=1 width=48) -> Materialize
-> Unique (cost=12.29..12.30 rows=1 width=80) -> Unique
-> Sort (cost=12.29..12.29 rows=1 width=80) -> Sort
Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id) Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id)
-> Seq Scan on events_270009 events_2 (cost=0.00..12.28 rows=1 width=80) -> Seq Scan on events_270009 events_2
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text))
(40 rows) (40 rows)
-- Union, left join and having subquery pushdown -- Union, left join and having subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
count_pay count_pay
FROM ( FROM (
@ -960,7 +963,8 @@ ORDER BY
count_pay; count_pay;
ERROR: bogus varattno for OUTER_VAR var: 3 ERROR: bogus varattno for OUTER_VAR var: 3
-- Lateral join subquery pushdown -- Lateral join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
tenant_id, tenant_id,
user_id, user_id,
user_lastseen, user_lastseen,
@ -1011,31 +1015,31 @@ LIMIT
10; 10;
QUERY PLAN QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_lastseen DESC Sort Key: remote_scan.user_lastseen DESC
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> Limit (cost=100.43..100.44 rows=6 width=56) -> Limit
-> Sort (cost=100.43..100.44 rows=6 width=56) -> Sort
Sort Key: (max(users.lastseen)) DESC Sort Key: (max(users.lastseen)) DESC
-> GroupAggregate (cost=100.14..100.29 rows=6 width=56) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Sort (cost=100.14..100.16 rows=6 width=548) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Nested Loop Left Join (cost=40.04..100.06 rows=6 width=548) -> Nested Loop Left Join
-> Limit (cost=28.08..28.09 rows=6 width=24) -> Limit
-> Sort (cost=28.08..28.09 rows=6 width=24) -> Sort
Sort Key: users.lastseen DESC Sort Key: users.lastseen DESC
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=24) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Limit (cost=11.96..11.96 rows=1 width=524) -> Limit
-> Sort (cost=11.96..11.96 rows=1 width=524) -> Sort
Sort Key: events.event_time DESC Sort Key: events.event_time DESC
-> Seq Scan on events_270009 events (cost=0.00..11.95 rows=1 width=524) -> Seq Scan on events_270009 events
Filter: (((composite_id).tenant_id = ((users.composite_id).tenant_id)) AND ((composite_id).user_id = ((users.composite_id).user_id))) Filter: (((composite_id).tenant_id = ((users.composite_id).tenant_id)) AND ((composite_id).user_id = ((users.composite_id).user_id)))
(26 rows) (26 rows)

View File

@ -732,7 +732,8 @@ LIMIT
-- Same queries above with explain -- Same queries above with explain
-- Simple join subquery pushdown -- Simple join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average avg(array_length(events, 1)) AS event_average
FROM FROM
(SELECT (SELECT
@ -759,29 +760,30 @@ FROM
user_id) AS subquery; user_id) AS subquery;
QUERY PLAN QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=0.00..0.00 rows=0 width=0) Aggregate
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> Aggregate (cost=40.01..40.02 rows=1 width=32) -> Aggregate
-> GroupAggregate (cost=39.89..39.99 rows=1 width=556) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Merge Join (cost=39.89..39.97 rows=1 width=556) -> Merge Join
Merge Cond: ((((users.composite_id).tenant_id) = ((events.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events.composite_id).user_id))) Merge Cond: ((((users.composite_id).tenant_id) = ((events.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events.composite_id).user_id)))
-> Sort (cost=28.08..28.09 rows=6 width=32) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Sort (cost=11.81..11.82 rows=3 width=556) -> Sort
Sort Key: ((events.composite_id).tenant_id), ((events.composite_id).user_id) Sort Key: ((events.composite_id).tenant_id), ((events.composite_id).user_id)
-> Seq Scan on events_270009 events (cost=0.00..11.79 rows=3 width=556) -> Seq Scan on events_270009 events
Filter: ((event_type)::text = ANY ('{click,submit,pay}'::text[])) Filter: ((event_type)::text = ANY ('{click,submit,pay}'::text[]))
(19 rows) (19 rows)
-- Union and left join subquery pushdown -- Union and left join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
hasdone hasdone
FROM FROM
@ -845,47 +847,48 @@ GROUP BY
hasdone; hasdone;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HashAggregate (cost=0.00..0.00 rows=0 width=0) HashAggregate
Group Key: remote_scan.hasdone Group Key: remote_scan.hasdone
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> HashAggregate (cost=91.94..91.96 rows=2 width=64) -> HashAggregate
Group Key: COALESCE(('Has done paying'::text), 'Has not done paying'::text) Group Key: COALESCE(('Has done paying'::text), 'Has not done paying'::text)
-> GroupAggregate (cost=91.85..91.90 rows=2 width=88) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
-> Sort (cost=91.85..91.85 rows=2 width=88) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
-> Merge Left Join (cost=91.75..91.84 rows=2 width=88) -> Merge Left Join
Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id))) Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id)))
-> Unique (cost=79.46..79.48 rows=2 width=40) -> Unique
-> Sort (cost=79.46..79.47 rows=2 width=40) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time
-> Append (cost=0.00..79.45 rows=2 width=40) -> Append
-> Nested Loop (cost=0.00..39.72 rows=1 width=40) -> Nested Loop
Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id)) Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id))
-> Seq Scan on events_270009 events (cost=0.00..11.62 rows=1 width=40) -> Seq Scan on events_270009 events
Filter: ((event_type)::text = 'click'::text) Filter: ((event_type)::text = 'click'::text)
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Nested Loop (cost=0.00..39.72 rows=1 width=40) -> Nested Loop
Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id)) Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id))
-> Seq Scan on events_270009 events_1 (cost=0.00..11.62 rows=1 width=40) -> Seq Scan on events_270009 events_1
Filter: ((event_type)::text = 'submit'::text) Filter: ((event_type)::text = 'submit'::text)
-> Seq Scan on users_270013 users_1 (cost=0.00..28.00 rows=6 width=32) -> Seq Scan on users_270013 users_1
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Materialize (cost=12.29..12.31 rows=1 width=48) -> Materialize
-> Unique (cost=12.29..12.30 rows=1 width=32) -> Unique
-> Sort (cost=12.29..12.29 rows=1 width=32) -> Sort
Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id) Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id)
-> Seq Scan on events_270009 events_2 (cost=0.00..12.28 rows=1 width=32) -> Seq Scan on events_270009 events_2
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text))
(37 rows) (37 rows)
-- Union, left join and having subquery pushdown -- Union, left join and having subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
avg(array_length(events, 1)) AS event_average, avg(array_length(events, 1)) AS event_average,
count_pay count_pay
FROM ( FROM (
@ -957,7 +960,8 @@ ORDER BY
count_pay; count_pay;
ERROR: bogus varattno for OUTER_VAR var: 3 ERROR: bogus varattno for OUTER_VAR var: 3
-- Lateral join subquery pushdown -- Lateral join subquery pushdown
EXPLAIN SELECT EXPLAIN (COSTS OFF)
SELECT
tenant_id, tenant_id,
user_id, user_id,
user_lastseen, user_lastseen,
@ -1008,31 +1012,31 @@ LIMIT
10; 10;
QUERY PLAN QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_lastseen DESC Sort Key: remote_scan.user_lastseen DESC
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> Limit (cost=100.43..100.44 rows=6 width=56) -> Limit
-> Sort (cost=100.43..100.44 rows=6 width=56) -> Sort
Sort Key: (max(users.lastseen)) DESC Sort Key: (max(users.lastseen)) DESC
-> GroupAggregate (cost=100.14..100.29 rows=6 width=548) -> GroupAggregate
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Sort (cost=100.14..100.16 rows=6 width=548) -> Sort
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id) Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
-> Nested Loop Left Join (cost=40.04..100.06 rows=6 width=548) -> Nested Loop Left Join
-> Limit (cost=28.08..28.09 rows=6 width=40) -> Limit
-> Sort (cost=28.08..28.09 rows=6 width=40) -> Sort
Sort Key: users.lastseen DESC Sort Key: users.lastseen DESC
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=40) -> Seq Scan on users_270013 users
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type)) Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
-> Limit (cost=11.96..11.96 rows=1 width=524) -> Limit
-> Sort (cost=11.96..11.96 rows=1 width=524) -> Sort
Sort Key: events.event_time DESC Sort Key: events.event_time DESC
-> Seq Scan on events_270009 events (cost=0.00..11.95 rows=1 width=524) -> Seq Scan on events_270009 events
Filter: (((composite_id).tenant_id = ((users.composite_id).tenant_id)) AND ((composite_id).user_id = ((users.composite_id).user_id))) Filter: (((composite_id).tenant_id = ((users.composite_id).tenant_id)) AND ((composite_id).user_id = ((users.composite_id).user_id)))
(26 rows) (26 rows)