explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tAYT

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 93.241 ↑ 1.0 1 1

Aggregate (cost=11,384.26..11,384.27 rows=1 width=8) (actual time=93.240..93.241 rows=1 loops=1)

2. 43.362 93.203 ↑ 14,892.9 28 1

Subquery Scan on x (cost=3,976.26..6,171.76 rows=417,000 width=5) (actual time=50.090..93.203 rows=28 loops=1)

3. 1.828 49.841 ↑ 14.9 28 1

HashAggregate (cost=3,976.26..3,980.43 rows=417 width=5) (actual time=49.807..49.841 rows=28 loops=1)

  • Group Key: ews_mrp_job_orders.name
4. 6.236 48.013 ↓ 4.2 1,744 1

Nested Loop Left Join (cost=109.25..3,975.21 rows=417 width=5) (actual time=0.668..48.013 rows=1,744 loops=1)

5. 7.345 36.545 ↓ 4.2 1,744 1

Nested Loop Left Join (cost=108.97..3,836.63 rows=417 width=4) (actual time=0.661..36.545 rows=1,744 loops=1)

6. 5.530 23.968 ↓ 4.2 1,744 1

Nested Loop (cost=108.68..3,697.80 rows=417 width=4) (actual time=0.651..23.968 rows=1,744 loops=1)

7. 6.183 12.683 ↓ 5.0 1,151 1

Hash Join (cost=108.26..1,612.00 rows=229 width=4) (actual time=0.638..12.683 rows=1,151 loops=1)

  • Hash Cond: (ews_attendance_day.location_id = hr_locations.id)
8. 5.967 6.451 ↓ 1.1 5,200 1

Bitmap Heap Scan on ews_attendance_day (cost=105.81..1,587.10 rows=4,819 width=6) (actual time=0.573..6.451 rows=5,200 loops=1)

  • Recheck Cond: ((sign_date >= '2019-10-01'::date) AND (sign_date <= '2019-10-31'::date))
  • Heap Blocks: exact=671
9. 0.484 0.484 ↓ 1.1 5,200 1

Bitmap Index Scan on ews_attendance_day_sign_date_index (cost=0.00..104.61 rows=4,819 width=0) (actual time=0.484..0.484 rows=5,200 loops=1)

  • Index Cond: ((sign_date >= '2019-10-01'::date) AND (sign_date <= '2019-10-31'::date))
10. 0.003 0.049 ↑ 1.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.017 0.046 ↑ 1.0 1 1

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

  • Hash Cond: (hr_locations.location_id = ews_location.id)
12. 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)

13. 0.005 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
14. 0.010 0.010 ↑ 1.0 1 1

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

  • Filter: (partner_id = 5,628)
  • Rows Removed by Filter: 20
15. 5.755 5.755 ↑ 1.5 2 1,151

Index Scan using ews_attendance_ews_attendance_day_id_index on ews_attendance (cost=0.42..9.08 rows=3 width=10) (actual time=0.003..0.005 rows=2 loops=1,151)

  • Index Cond: (ews_attendance_day_id = ews_attendance_day.id)
  • Filter: (active AND (punch_out_time IS NOT NULL))
  • Rows Removed by Filter: 0
16. 5.232 5.232 ↑ 1.0 1 1,744

Index Scan using mrp_bom_pkey on mrp_bom (cost=0.29..0.32 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1,744)

  • Index Cond: (id = ews_attendance.bom_id)
17. 5.232 5.232 ↑ 1.0 1 1,744

Index Scan using ews_mrp_job_orders_pkey on ews_mrp_job_orders (cost=0.28..0.32 rows=1 width=9) (actual time=0.002..0.003 rows=1 loops=1,744)

  • Index Cond: (id = mrp_bom.job_id)
Planning time : 1.268 ms
Execution time : 93.388 ms