explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EVMJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 5,892.129 ↓ 0.0 0 1

Unique (cost=681,932.29..682,026.72 rows=1,614 width=81) (actual time=5,892.129..5,892.129 rows=0 loops=1)

2. 0.000 5,892.128 ↓ 0.0 0 1

Sort (cost=681,932.29..681,942.78 rows=4,197 width=81) (actual time=5,892.128..5,892.128 rows=0 loops=1)

  • Sort Key: oc.id, oc.created_time, oc.deleted, oc.updated_time, oc.version, oc.capture_time, oc.order_item_id, oc.container_id
  • Sort Method: quicksort Memory: 25kB
3. 24.297 5,908.103 ↓ 0.0 0 1

Gather (cost=2,311.95..681,679.73 rows=4,197 width=81) (actual time=5,892.095..5,908.103 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.001 5,883.806 ↓ 0.0 0 3

Nested Loop (cost=1,311.95..680,260.03 rows=1,749 width=81) (actual time=5,883.806..5,883.806 rows=0 loops=3)

  • Join Filter: (oc.order_item_id = tsto.order_item_id)
5. 1.743 5,883.805 ↓ 0.0 0 3

Hash Join (cost=1,304.54..573,462.00 rows=160 width=97) (actual time=5,883.805..5,883.805 rows=0 loops=3)

  • Hash Cond: (v.branch_office_id = bo.id)
6. 1,516.473 5,877.235 ↓ 6.0 1,995 3

Nested Loop (cost=35.78..572,192.37 rows=330 width=113) (actual time=0.932..5,877.235 rows=1,995 loops=3)

7. 1,542.984 4,360.004 ↓ 6.0 1,995 3

Nested Loop (cost=35.34..570,569.09 rows=335 width=113) (actual time=0.890..4,360.004 rows=1,995 loops=3)

8. 3.429 2,816.248 ↓ 6.0 1,995 3

Hash Join (cost=34.91..568,946.06 rows=335 width=113) (actual time=0.828..2,816.248 rows=1,995 loops=3)

  • Hash Cond: (oc.container_id = c.id)
9. 1,708.589 2,812.364 ↓ 5.9 1,995 3

Nested Loop (cost=0.56..568,910.83 rows=336 width=113) (actual time=0.358..2,812.364 rows=1,995 loops=3)

10. 1,102.925 1,102.925 ↓ 6.0 2,004 3

Parallel Seq Scan on order_container oc (cost=0.00..566,040.45 rows=336 width=81) (actual time=0.295..1,102.925 rows=2,004 loops=3)

  • Filter: ((capture_time > '2019-09-04 11:40:00.514+03'::timestamp with time zone) AND ((CURRENT_TIMESTAMP - capture_time) < '00:45:00'::interval))
  • Rows Removed by Filter: 8312264
11. 0.850 0.850 ↑ 1.0 1 6,013

Index Scan using order_item_pkey on order_item oi (cost=0.56..8.54 rows=1 width=32) (actual time=0.850..0.850 rows=1 loops=6,013)

  • Index Cond: (id = oc.order_item_id)
12. 0.222 0.455 ↓ 1.0 863 3

Hash (cost=23.60..23.60 rows=860 width=16) (actual time=0.455..0.455 rows=863 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 49kB
13. 0.233 0.233 ↓ 1.0 863 3

Seq Scan on container c (cost=0.00..23.60 rows=860 width=16) (actual time=0.014..0.233 rows=863 loops=3)

14. 0.772 0.772 ↑ 1.0 1 5,985

Index Scan using order__pkey on order_ o (cost=0.43..4.84 rows=1 width=32) (actual time=0.772..0.772 rows=1 loops=5,985)

  • Index Cond: (id = oi.order_id)
15. 0.758 0.758 ↑ 1.0 1 5,985

Index Scan using visit_pkey on visit v (cost=0.43..4.85 rows=1 width=32) (actual time=0.758..0.758 rows=1 loops=5,985)

  • Index Cond: (id = o.visit_id)
16. 0.007 4.827 ↑ 9,468.0 1 3

Hash (cost=1,150.41..1,150.41 rows=9,468 width=16) (actual time=4.827..4.827 rows=1 loops=3)

  • Buckets: 16384 Batches: 1 Memory Usage: 129kB
17. 4.818 4.820 ↑ 9,468.0 1 3

Seq Scan on branch_office bo (cost=23.39..1,150.41 rows=9,468 width=16) (actual time=4.120..4.820 rows=1 loops=3)

  • Filter: ((hashed SubPlan 1) OR (id = 'be5648fa-bc44-4fd9-bd09-7ba787688463'::uuid))
  • Rows Removed by Filter: 18966
18.          

SubPlan (forSeq Scan)

19. 0.002 0.002 ↓ 0.0 0 3

Seq Scan on branch_office_relation (cost=0.00..23.38 rows=5 width=16) (actual time=0.002..0.002 rows=0 loops=3)

  • Filter: (master = 'be5648fa-bc44-4fd9-bd09-7ba787688463'::uuid)
20. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on test_order tsto (cost=7.41..663.89 rows=288 width=16) (never executed)

  • Recheck Cond: (order_item_id = oi.id)
21. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_test_order_order_item_id (cost=0.00..7.34 rows=288 width=0) (never executed)

  • Index Cond: (order_item_id = oi.id)
Planning time : 2.565 ms
Execution time : 5,908.352 ms