explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PCnr7

Settings
# exclusive inclusive rows x rows loops node
1. 0.151 8.589 ↓ 10.0 100 1

Nested Loop (cost=2,037.92..2,706.70 rows=10 width=306) (actual time=4.415..8.589 rows=100 loops=1)

  • Join Filter: (c.place_cod = sp.place_cod)
2.          

CTE cte

3. 0.261 4.418 ↑ 2.5 100 1

HashAggregate (cost=2,034.73..2,037.21 rows=248 width=12) (actual time=4.365..4.418 rows=100 loops=1)

  • Group Key: sw.place_cod
4. 0.532 4.157 ↓ 1.0 344 1

Nested Loop (cost=20.37..2,033.07 rows=333 width=4) (actual time=1.030..4.157 rows=344 loops=1)

5. 0.400 2.284 ↓ 1.0 447 1

Hash Join (cost=19.94..895.93 rows=430 width=8) (actual time=0.982..2.284 rows=447 loops=1)

  • Hash Cond: (sw.place_cod = sp_1.place_cod)
6. 0.972 0.972 ↓ 1.0 447 1

Index Scan using ix_sortworker_ch_dt on sortworker sw (cost=0.54..875.39 rows=430 width=4) (actual time=0.063..0.972 rows=447 loops=1)

  • Index Cond: (ch_dt >= (timezone('Europe/Moscow'::text, now()) - '00:15:00'::interval))
7. 0.236 0.912 ↑ 1.0 551 1

Hash (cost=12.51..12.51 rows=551 width=4) (actual time=0.911..0.912 rows=551 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
8. 0.676 0.676 ↑ 1.0 551 1

Seq Scan on sortplace sp_1 (cost=0.00..12.51 rows=551 width=4) (actual time=0.008..0.676 rows=551 loops=1)

9. 1.341 1.341 ↑ 1.0 1 447

Index Scan using pk_storageplace on storageplace spl_1 (cost=0.43..2.64 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=447)

  • Index Cond: (place_cod = sp_1.place_cod)
  • Filter: (office_id = 507)
  • Rows Removed by Filter: 0
10. 0.340 8.238 ↓ 10.0 100 1

Nested Loop (cost=0.43..666.44 rows=10 width=294) (actual time=4.407..8.238 rows=100 loops=1)

  • Join Filter: (spl.wh_id = w.wh_id)
  • Rows Removed by Join Filter: 600
11. 0.016 0.016 ↓ 7.0 7 1

Seq Scan on warehouse w (cost=0.00..1.18 rows=1 width=278) (actual time=0.008..0.016 rows=7 loops=1)

  • Filter: (office_id = 507)
  • Rows Removed by Filter: 7
12. 1.008 7.882 ↑ 2.5 100 7

Nested Loop (cost=0.43..662.16 rows=248 width=20) (actual time=0.630..1.126 rows=100 loops=7)

13. 4.774 4.774 ↑ 2.5 100 7

CTE Scan on cte c (cost=0.00..4.96 rows=248 width=12) (actual time=0.624..0.682 rows=100 loops=7)

14. 2.100 2.100 ↑ 1.0 1 700

Index Scan using pk_storageplace on storageplace spl (cost=0.43..2.65 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=700)

  • Index Cond: (place_cod = c.place_cod)
15. 0.200 0.200 ↑ 1.0 1 100

Index Scan using pk_sortplace on sortplace sp (cost=0.28..0.29 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=100)

  • Index Cond: (place_cod = spl.place_cod)
Planning time : 0.665 ms
Execution time : 8.722 ms