explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W3jr

Settings
# exclusive inclusive rows x rows loops node
1. 0.642 2,796.538 ↑ 705.7 18 1

HashAggregate (cost=555,823.60..555,982.38 rows=12,702 width=100) (actual time=2,796.498..2,796.538 rows=18 loops=1)

  • Group Key: d.id, d.plan_shifts
  • Functions: 53
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 10.639 ms, Inlining 12.072 ms, Optimization 462.423 ms, Emission 286.547 ms, Total 771.681 ms
2. 35.736 2,795.896 ↑ 238.3 533 1

Merge Right Join (cost=514,749.20..552,012.97 rows=127,021 width=68) (actual time=2,793.736..2,795.896 rows=533 loops=1)

  • Merge Cond: ((w.month_request_data_id = d.id) AND ((date_part('month'::text, w.target_date)) = ((d.month)::double precision)))
3. 1,145.164 2,743.608 ↑ 4.4 641,999 1

Sort (cost=477,146.27..484,209.48 rows=2,825,286 width=20) (actual time=2,668.759..2,743.608 rows=641,999 loops=1)

  • Sort Key: w.month_request_data_id, (date_part('month'::text, w.target_date))
  • Sort Method: external merge Disk: 97,408kB
4. 1,598.444 1,598.444 ↑ 1.0 2,823,298 1

Seq Scan on waybill w (cost=0.00..116,474.86 rows=2,825,286 width=20) (actual time=763.283..1,598.444 rows=2,823,298 loops=1)

5. 0.063 16.552 ↑ 244.7 519 1

Sort (cost=37,602.94..37,920.49 rows=127,021 width=64) (actual time=16.511..16.552 rows=519 loops=1)

  • Sort Key: d.id, ((d.month)::double precision)
  • Sort Method: quicksort Memory: 27kB
6. 0.007 16.489 ↑ 7,056.7 18 1

Subquery Scan on d (cost=23,976.94..26,834.92 rows=127,021 width=64) (actual time=15.764..16.489 rows=18 loops=1)

7. 1.279 16.482 ↑ 7,056.7 18 1

HashAggregate (cost=23,976.94..25,564.71 rows=127,021 width=64) (actual time=15.760..16.482 rows=18 loops=1)

  • Group Key: mrd.id, mr.month
8. 0.073 15.203 ↑ 241.9 525 1

Nested Loop (cost=24.02..18,896.10 rows=127,021 width=56) (actual time=7.126..15.203 rows=525 loops=1)

9. 0.307 14.870 ↑ 442.6 20 1

Hash Join (cost=23.60..3,143.40 rows=8,853 width=32) (actual time=7.087..14.870 rows=20 loops=1)

  • Hash Cond: (mrd.agreement_id = a.id)
10. 6.857 14.485 ↑ 4.4 4,002 1

Hash Join (cost=2.81..3,075.81 rows=17,670 width=36) (actual time=1.641..14.485 rows=4,002 loops=1)

  • Hash Cond: (mrd.month_request_id = mr.id)
11. 7.608 7.608 ↑ 1.0 64,137 1

Seq Scan on month_request_data mrd (cost=0.00..2,897.37 rows=64,137 width=36) (actual time=0.017..7.608 rows=64,137 loops=1)

12. 0.005 0.020 ↑ 3.4 8 1

Hash (cost=2.47..2.47 rows=27 width=8) (actual time=0.020..0.020 rows=8 loops=1)

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

Seq Scan on month_request mr (cost=0.00..2.47 rows=27 width=8) (actual time=0.012..0.015 rows=8 loops=1)

  • Filter: ((date_start <= '2020-06-10'::date) AND (date_end > '2020-06-10'::date))
  • Rows Removed by Filter: 90
14. 0.004 0.078 ↑ 60.0 4 1

Hash (cost=17.79..17.79 rows=240 width=4) (actual time=0.078..0.078 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.074 0.074 ↑ 60.0 4 1

Seq Scan on agreement a (cost=0.00..17.79 rows=240 width=4) (actual time=0.071..0.074 rows=4 loops=1)

  • Filter: (smart_service IS TRUE)
  • Rows Removed by Filter: 439
16. 0.260 0.260 ↓ 1.1 26 20

Index Scan using month_request_data_day_877358ce on month_request_data_day mrdd (cost=0.42..1.54 rows=24 width=28) (actual time=0.005..0.013 rows=26 loops=20)

  • Index Cond: (month_request_data_id = mrd.id)
  • Filter: (deleted IS NULL)
Planning time : 1.516 ms
Execution time : 2,825.870 ms