explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qXVI

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 77.519 ↑ 2,000.0 1 1

Subquery Scan on subquery1 (cost=1,570.68..1,671.20 rows=2,000 width=24) (actual time=77.516..77.519 rows=1 loops=1)

2. 16.427 77.491 ↑ 2,000.0 1 1

HashAggregate (cost=1,570.68..1,581.20 rows=2,000 width=21) (actual time=77.489..77.491 rows=1 loops=1)

  • Group Key: ews_mrp_job_orders.name, (sum(ews_mrp_release_orders.release_qty))
3. 2.204 61.064 ↓ 598.0 1,196 1

Hash Join (cost=426.82..1,570.66 rows=2 width=21) (actual time=37.368..61.064 rows=1,196 loops=1)

  • Hash Cond: (ews_attendance_day.location_id = hr_locations.id)
4. 3.663 58.803 ↓ 27.9 1,257 1

Nested Loop (cost=424.37..1,568.00 rows=45 width=23) (actual time=37.277..58.803 rows=1,257 loops=1)

5. 1.987 50.112 ↓ 27.9 1,257 1

Nested Loop (cost=423.95..1,546.34 rows=45 width=25) (actual time=37.264..50.112 rows=1,257 loops=1)

6. 17.501 45.902 ↓ 3.2 13 1

Hash Join (cost=423.53..1,515.26 rows=4 width=17) (actual time=28.451..45.902 rows=13 loops=1)

  • Hash Cond: (mrp_bom.job_id = ews_mrp_job_orders.id)
7. 14.399 14.399 ↑ 1.0 16,589 1

Seq Scan on mrp_bom (cost=0.00..1,029.05 rows=16,705 width=8) (actual time=0.023..14.399 rows=16,589 loops=1)

8. 0.010 14.002 ↑ 1.0 1 1

Hash (cost=423.52..423.52 rows=1 width=17) (actual time=14.002..14.002 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 1.366 13.992 ↑ 1.0 1 1

Hash Right Join (cost=393.49..423.52 rows=1 width=17) (actual time=12.822..13.992 rows=1 loops=1)

  • Hash Cond: (ews_mrp_release_orders.release_order_id = ews_mrp_job_orders.id)
10. 6.195 12.606 ↓ 1.4 1,816 1

HashAggregate (cost=385.18..397.82 rows=1,264 width=8) (actual time=11.098..12.606 rows=1,816 loops=1)

  • Group Key: ews_mrp_release_orders.release_order_id
11. 6.411 6.411 ↓ 1.1 4,604 1

Seq Scan on ews_mrp_release_orders (cost=0.00..363.41 rows=4,353 width=8) (actual time=0.006..6.411 rows=4,604 loops=1)

  • Filter: (active AND (NOT obsolete) AND ((original_detail_code)::text = ANY ('{4,6,8}'::text[])))
  • Rows Removed by Filter: 2,888
12. 0.005 0.020 ↑ 1.0 1 1

Hash (cost=8.30..8.30 rows=1 width=9) (actual time=0.020..0.020 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.015 0.015 ↑ 1.0 1 1

Index Scan using ews_mrp_job_orders_job_name_uniq on ews_mrp_job_orders (cost=0.28..8.30 rows=1 width=9) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: ((name)::text = '1455'::text)
14. 2.223 2.223 ↑ 1.4 97 13

Index Scan using ews_attendace_bom_id_index on ews_attendance (cost=0.42..6.42 rows=135 width=18) (actual time=0.006..0.171 rows=97 loops=13)

  • Index Cond: (bom_id = mrp_bom.id)
  • Filter: (active AND (punch_out_time IS NOT NULL))
  • Rows Removed by Filter: 1
15. 5.028 5.028 ↑ 1.0 1 1,257

Index Scan using ews_attendance_day_pkey on ews_attendance_day (cost=0.42..0.47 rows=1 width=6) (actual time=0.003..0.004 rows=1 loops=1,257)

  • Index Cond: (id = ews_attendance.ews_attendance_day_id)
  • Filter: (sign_date <= '2020-05-31'::date)
16. 0.008 0.057 ↑ 1.0 1 1

Hash (cost=2.44..2.44 rows=1 width=4) (actual time=0.057..0.057 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.020 0.049 ↑ 1.0 1 1

Hash Join (cost=1.27..2.44 rows=1 width=4) (actual time=0.044..0.049 rows=1 loops=1)

  • Hash Cond: (hr_locations.location_id = ews_location.id)
18. 0.014 0.014 ↑ 1.0 11 1

Seq Scan on hr_locations (cost=0.00..1.11 rows=11 width=8) (actual time=0.004..0.014 rows=11 loops=1)

19. 0.006 0.015 ↑ 1.0 1 1

Hash (cost=1.26..1.26 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
20. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on ews_location (cost=0.00..1.26 rows=1 width=4) (actual time=0.007..0.009 rows=1 loops=1)

  • Filter: (partner_id = 5,628)
  • Rows Removed by Filter: 20
Planning time : 2.184 ms
Execution time : 77.832 ms