Left Join(五)
ws out: Avg 1.0 rows x 2 workers. Max 1 rows (seg42) with 0.133 ms to first row, 0.135 ms to end, start offset by 18 ms.
Slice statistics:
(slice0) Executor memory: 332K bytes.
(slice1) Executor memory: 583K bytes avg x 64 workers, 4353K bytes max (seg42). Work_mem: 74K bytes max.
Statement statistics:
Memory used: 128000K bytes
Total runtime: 116.997 ms
(27 rows)
bigdatagp=# explain analyze select * from tgt1 a left join tgt2 b on a.id=b.id where id=6 order by a.id;
ERROR: column reference "id" is ambiguous
LINE 1: ...* from tgt1 a left join tgt2 b on a.id=b.id where id=6 order...
^
bigdatagp=# explain analyze select * from tgt1 a left join tgt2 b on a.id=b.id where a.id=6 order by a.id;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=7.17..7.18 rows=4 width=14)
Merge Key: "?column5?"
Rows out: (No row requested) 0 rows at destination with 3.212 ms to end, start offset by 339 ms.
-> Sort (cost=7.17..7.18 rows=1 width=14)
Sort Key: a.id
Rows out: (No row requested) 0 rows with 0 ms to end.
Executor memory: 58K bytes.
Work_mem used: 58K bytes. Workfile: (0 spilling, 0 reused)
-> Hash Left Join (cost=2.04..7.14 rows=1 width=14)
Hash Cond: a.id = b.id
Rows out: (No row requested) 0 rows with 0 ms to end.
-> Seq Scan on tgt1 a (cost=0.00..5.06 rows=1 width=7)
Filter: id = 6
Rows out: (No row requested) 0 rows with 0 ms to end.
-> Hash (cost=2.02..2.02 rows=1 width=7)
Rows in: (No row requested) 0 rows with 0 ms to end.
-> Seq Scan on tgt2 b (cost=0.00..2.02 rows=1 width=7)
Filter: id = 6
Rows out: (No row requested) 0 rows with 0 ms to end.
Slice statistics:
(slice0) Executor memory: 252K bytes.
(slice1) Executor memory: 251K bytes (seg3). Work_mem: 58K bytes max.
Statement statistics:
Memory used: 128000K bytes
Total runtime: 342.067 ms
(25 rows)
bigdatagp=# explain analyze select * from tgt1 a left join tgt2 b on a.id=b.id and a.id=6 order by a.id;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 64:1 (slice1; segments: 64) (cost=7.23..7.24 rows=1 width=14)
Merge Key: "?column5?"
Rows out: 5 rows at destination with 435 ms to end, start offset by 1.130 ms.
->
Sort (cost=7.23..7.24 rows=1 width=14)
Sort Key: a.id
Rows out: Avg 1.0 rows x 5 workers. Max 1 rows (seg42) with 5.156 ms to first row, 5.158 ms to end, start offset by 7.597 ms.
Executor memory: 58K bytes avg, 58K bytes max (seg0).
Work_mem used: 58K bytes avg, 58K bytes max (seg0). Workfile: (0 spilling, 0 reused)
-> Hash Left Join (cost=2.04..7.17 rows=1 width=14)
Hash Cond: a.id = b.id
Join Filter: a.id = 6
Rows out: Avg 1.0 rows x 5 workers. Max 1 rows (seg42) with 4.155 ms to first row, 4.813 ms to end, start offset by 7.930 ms.
Executor memory: 1K bytes avg, 1K bytes max (seg42).
Work_mem used: 1K bytes avg, 1K bytes max (seg42). Workfile: (0 spilling, 0 reused)
(seg42) Hash chain length 1.0 avg, 1 max, using 1 of 262151 buckets.
-> Seq Scan on tgt1 a (cost=0.00..5.05 rows=1 width=7)
Rows out: Avg 1.0 rows x 5 workers. Max 1 rows (seg42) with 0.126 ms to first row, 0.127 ms to end, start offset by 7.941 ms.
-> Hash (cost=2.02..2