测试多列DK的选择性问题(二)

2014-11-24 15:45:42 · 作者: · 浏览: 8
ents: 4) (cost=1.11..4.20 rows=1 width=12)
Rows out: 4 rows at destination with 27 ms to first row, 29 ms to end, start offset by 54 ms.
-> Hash Join (cost=1.11..4.20 rows=1 width=12)
Hash Cond: t2.id = t1.id
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 18 ms to first row, 21 ms to end, start offset by 367 ms.
Executor memory: 1K bytes avg, 1K bytes max (seg0).
Work_mem used: 1K bytes avg, 1K bytes max (seg0). Workfile: (0 spilling, 0 reused)
(seg3) Hash chain length 1.0 avg, 1 max, using 4 of 524341 buckets.
-> Seq Scan on gtt2 t2 (cost=0.00..3.04 rows=1 width=6)
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 0.219 ms to first row, 0.220 ms to end, start offset by 385 ms.
-> Hash (cost=1.06..1.06 rows=1 width=6)
Rows in: Avg 4.0 rows x 4 workers. Max 4 rows (seg0) with 0.197 ms to end, start offset by -607 ms.
-> Broadcast Motion 4:4 (slice1; segments: 4) (cost=0.00..1.06 rows=1 width=6)
Rows out: Avg 4.0 rows x 4 workers at destination. Max 4 rows (seg0) with 0.107 ms to first row, 0.118 ms to end, start offset by -607
ms.
-> Seq Scan on gtt1 t1 (cost=0.00..1.01 rows=1 width=6)
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 3.709 ms to first row, 3.711 ms to end, start offset by 369 ms.
Slice statistics:
(slice0) Executor memory: 184K bytes.
(slice1) Executor memory: 212K bytes avg x 4 workers, 216K bytes max (seg0).
(slice2) Executor memory: 8401K bytes avg x 4 workers, 8401K bytes max (seg0). Work_mem: 1K bytes max.
Statement statistics:
Memory used: 128000K bytes
Total runtime: 84.302 ms
(23 rows)


gtlions=# explain analyze select * from gtt1 t1,gtt2 t2 where t1.name=t2.name;
QUERY PLAN

-------------------------------------------------------------------------------------------------------------------------------------------------------------
------
Gather Motion 4:1 (slice2; segments: 4) (cost=1.11..4.20 rows=1 width=12)
Rows out: 4 rows at destination with 24 ms to first row, 32 ms to end, start offset by 50 ms.
-> Hash Join (cost=1.11..4.20 rows=1 width=12)
Hash Cond: t2.name::text = t1.name::text
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 10 ms to first row, 13 ms to end, start offset by -253 ms.
Executor memory: 1K bytes avg, 1K bytes max (seg0).
Work_mem used: 1K bytes avg, 1K bytes max (seg0). Workfile: (0 spilling, 0 reused)
(seg3) Hash chain length 1.0 avg, 1 max, using 4 of 524341 buckets.
-> Seq Scan on gtt2 t2 (cost=0.00..3.04 rows=1 width=6)
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 0.187 ms to first row, 0.189 ms to end, start offset by -243 ms.
-> Hash (cost=1.06..1.06 rows=1 width=6)
Rows in: Avg 4.0 rows x 4 workers. Max 4 rows (seg0) with 3.477 ms to end, start offset by -1556 ms.
-> Broadcast Motion 4:4 (slice1; segments: 4) (cost=0.00..1.06 rows=1 width=6)
Rows out: Avg 4.0 rows x 4 workers at destination. Max 4 rows (seg0) with 0.161 ms to first row, 0.177 ms to end, start offset by -155
6 ms.
-> Seq Scan on gtt1 t1 (cost=0.00..1.01 rows=1 width=6)
Rows out: Avg 1.3 rows x 3 workers. Max 2 rows (seg3) with 0.143 ms to first row, 0.146 ms to end, start offset by -260 ms.
Slice statistics:
(slice0) Executor memory: 184K bytes.
(slice1) Executor memory: 212K bytes avg x 4 workers, 216K bytes max (seg0).
(slice2) Executor memory: 8401K bytes avg x 4 workers, 8401K bytes max (seg0). Work_mem: 1K bytes max.
Statement statistics:
Memory used: 128000K bytes
Total runtime: 82.710 ms
(23 rows)


gtlions=# explain analyze select * from gtt1 t1,gtt2 t2 where t1.id=t2.id and t1.name=t2.name;
QUERY PLAN
--