explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0PeU

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 146.538 ↑ 1.0 20 1

Limit (cost=2.55..188.99 rows=20 width=4,210) (actual time=7.223..146.538 rows=20 loops=1)

2. 0.036 146.527 ↑ 8,911.0 20 1

Merge Join (cost=2.55..1,661,343.19 rows=178,221 width=4,210) (actual time=7.222..146.527 rows=20 loops=1)

  • Merge Cond: (package0_.fk_current_business_partner = businesspa6_.id_business_partner)
3. 0.113 146.480 ↑ 8,911.0 20 1

Nested Loop (cost=2.28..1,658,835.83 rows=178,221 width=4,063) (actual time=7.205..146.480 rows=20 loops=1)

  • Join Filter: (subrequest3_.fk_service_code = servicecod4_.id_service_code)
  • Rows Removed by Join Filter: 351
4. 0.044 146.247 ↑ 8,911.0 20 1

Nested Loop (cost=2.28..1,565,124.06 rows=178,221 width=3,983) (actual time=7.177..146.247 rows=20 loops=1)

5. 0.057 113.563 ↑ 8,911.0 20 1

Nested Loop (cost=1.85..1,215,511.88 rows=178,221 width=3,719) (actual time=5.662..113.563 rows=20 loops=1)

6. 0.041 83.926 ↑ 8,911.0 20 1

Nested Loop (cost=1.42..897,339.78 rows=178,221 width=3,604) (actual time=3.779..83.926 rows=20 loops=1)

7. 0.070 58.005 ↑ 8,911.0 20 1

Nested Loop Left Join (cost=0.98..570,992.67 rows=178,221 width=3,466) (actual time=2.312..58.005 rows=20 loops=1)

  • Filter: ((package0_.fk_current_task IS NULL) OR (subrequest5_.task_type <> 0) OR (subrequest5_.status <> ALL ('{0,1}'::integer[])))
8. 11.995 11.995 ↑ 8,912.8 20 1

Index Scan using packages_bp_status_received_at_id_idx on packages package0_ (cost=0.42..154,641.71 rows=178,256 width=3,197) (actual time=0.706..11.995 rows=20 loops=1)

9. 45.940 45.940 ↑ 1.0 1 20

Index Scan using subrequest_tasks_pkey on subrequest_tasks subrequest5_ (cost=0.56..2.32 rows=1 width=269) (actual time=2.297..2.297 rows=1 loops=20)

  • Index Cond: (package0_.fk_current_task = id)
10. 25.880 25.880 ↑ 1.0 1 20

Index Scan using requests_pkey on requests request1_ (cost=0.43..1.83 rows=1 width=138) (actual time=1.294..1.294 rows=1 loops=20)

  • Index Cond: (id_request = package0_.fk_request)
11. 29.580 29.580 ↑ 1.0 1 20

Index Scan using orders_pkey on orders order2_ (cost=0.43..1.79 rows=1 width=115) (actual time=1.479..1.479 rows=1 loops=20)

  • Index Cond: (id = request1_.fk_order)
12. 32.640 32.640 ↑ 1.0 1 20

Index Scan using sub_requests_pkey on sub_requests subrequest3_ (cost=0.43..1.96 rows=1 width=264) (actual time=1.632..1.632 rows=1 loops=20)

  • Index Cond: (id_sub_request = package0_.fk_current_sub_request)
13. 0.108 0.120 ↑ 1.9 19 20

Materialize (cost=0.00..1.54 rows=36 width=80) (actual time=0.001..0.006 rows=19 loops=20)

14. 0.012 0.012 ↑ 1.0 36 1

Seq Scan on service_codes servicecod4_ (cost=0.00..1.36 rows=36 width=80) (actual time=0.004..0.012 rows=36 loops=1)

15. 0.011 0.011 ↑ 139.3 3 1

Index Scan using business_partner_pkey on business_partners businesspa6_ (cost=0.27..278.55 rows=418 width=147) (actual time=0.008..0.011 rows=3 loops=1)

Planning time : 4.310 ms
Execution time : 146.857 ms