explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kat2

Settings
# exclusive inclusive rows x rows loops node
1. 18.430 1,034.794 ↑ 33.6 557 1

GroupAggregate (cost=131,264.05..132,200.60 rows=18,731 width=438) (actual time=1,012.253..1,034.794 rows=557 loops=1)

  • Group Key: work_order.work_order_id, option.option_name, event.event_start_date_time, event.event_end_date_time, company.company_name, users.first_name, users.last_name, event.probability_of_close, event.event_name, event.event_id, status.short_description, users.location, u.first_name, u.last_name
2. 71.011 1,016.364 ↓ 1.2 23,158 1

Sort (cost=131,264.05..131,310.88 rows=18,731 width=438) (actual time=1,012.245..1,016.364 rows=23,158 loops=1)

  • Sort Key: work_order.work_order_id DESC, option.option_name, event.event_start_date_time, event.event_end_date_time, company.company_name, users.first_name, users.last_name, event.probability_of_close, event.event_name, event.event_id, status.short_description, users.location, u.first_name, u.last_name
  • Sort Method: quicksort Memory: 17391kB
3. 110.835 945.353 ↓ 1.2 23,158 1

Hash Right Join (cost=9,144.24..129,934.80 rows=18,731 width=438) (actual time=86.615..945.353 rows=23,158 loops=1)

  • Hash Cond: (wol.work_order_id = work_order.work_order_id)
4. 798.774 798.774 ↓ 1.0 1,352,739 1

Seq Scan on work_order_line_item wol (cost=0.00..115,565.86 rows=1,343,304 width=12) (actual time=0.039..798.774 rows=1,352,739 loops=1)

  • Filter: ((NOT deleted) AND (((line_item_type)::text = 'R'::text) OR ((line_item_type)::text = 'K'::text)))
  • Rows Removed by Filter: 726585
5. 0.439 35.744 ↓ 1.1 557 1

Hash (cost=9,137.87..9,137.87 rows=509 width=430) (actual time=35.744..35.744 rows=557 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 205kB
6. 0.216 35.305 ↓ 1.1 557 1

Hash Left Join (cost=2,081.76..9,137.87 rows=509 width=430) (actual time=25.286..35.305 rows=557 loops=1)

  • Hash Cond: (work_order.payment_terms = option.option_id)
7. 0.163 35.000 ↓ 1.1 557 1

Hash Left Join (cost=2,072.64..9,121.76 rows=509 width=421) (actual time=25.191..35.000 rows=557 loops=1)

  • Hash Cond: (work_order.status_id = status.status_id)
8. 0.195 34.822 ↓ 1.1 557 1

Hash Left Join (cost=2,070.72..9,112.84 rows=509 width=412) (actual time=25.172..34.822 rows=557 loops=1)

  • Hash Cond: (work_order.project_manager_id = u.user_id)
9. 0.193 34.507 ↓ 1.1 557 1

Hash Left Join (cost=2,048.74..9,083.87 rows=509 width=403) (actual time=25.047..34.507 rows=557 loops=1)

  • Hash Cond: (work_order.sales_rep_id = users.user_id)
10. 0.374 34.137 ↓ 1.1 557 1

Hash Left Join (cost=2,026.76..9,054.89 rows=509 width=382) (actual time=24.861..34.137 rows=557 loops=1)

  • Hash Cond: (work_order.bill_to_company_id = company.company_id)
11. 0.807 17.620 ↓ 1.1 557 1

Nested Loop Left Join (cost=0.29..7,021.43 rows=509 width=357) (actual time=8.633..17.620 rows=557 loops=1)

12. 16.256 16.256 ↓ 1.1 557 1

Seq Scan on work_order (cost=0.00..3,870.55 rows=509 width=275) (actual time=8.616..16.256 rows=557 loops=1)

  • Filter: ((delivery_date_time >= '2019-02-22 00:00:00'::timestamp without time zone) AND (delivery_date_time <= '2019-03-25 23:59:00'::timestamp without time zone))
  • Rows Removed by Filter: 35935
13. 0.557 0.557 ↑ 1.0 1 557

Index Scan using event_pkey on event (cost=0.29..6.18 rows=1 width=82) (actual time=0.001..0.001 rows=1 loops=557)

  • Index Cond: (event_id = work_order.event_id)
14. 8.499 16.143 ↑ 1.0 48,643 1

Hash (cost=1,418.43..1,418.43 rows=48,643 width=29) (actual time=16.143..16.143 rows=48,643 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3495kB
15. 7.644 7.644 ↑ 1.0 48,643 1

Seq Scan on company (cost=0.00..1,418.43 rows=48,643 width=29) (actual time=0.005..7.644 rows=48,643 loops=1)

16. 0.094 0.177 ↑ 1.0 399 1

Hash (cost=16.99..16.99 rows=399 width=25) (actual time=0.177..0.177 rows=399 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
17. 0.083 0.083 ↑ 1.0 399 1

Seq Scan on users (cost=0.00..16.99 rows=399 width=25) (actual time=0.005..0.083 rows=399 loops=1)

18. 0.067 0.120 ↑ 1.0 399 1

Hash (cost=16.99..16.99 rows=399 width=17) (actual time=0.120..0.120 rows=399 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 28kB
19. 0.053 0.053 ↑ 1.0 399 1

Seq Scan on users u (cost=0.00..16.99 rows=399 width=17) (actual time=0.001..0.053 rows=399 loops=1)

20. 0.010 0.015 ↓ 1.1 44 1

Hash (cost=1.41..1.41 rows=41 width=13) (actual time=0.015..0.015 rows=44 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
21. 0.005 0.005 ↓ 1.1 44 1

Seq Scan on status (cost=0.00..1.41 rows=41 width=13) (actual time=0.003..0.005 rows=44 loops=1)

22. 0.050 0.089 ↓ 1.0 285 1

Hash (cost=5.72..5.72 rows=272 width=17) (actual time=0.089..0.089 rows=285 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
23. 0.039 0.039 ↓ 1.0 285 1

Seq Scan on option (cost=0.00..5.72 rows=272 width=17) (actual time=0.006..0.039 rows=285 loops=1)

Planning time : 2.291 ms