explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mIrV

Settings
# exclusive inclusive rows x rows loops node
1. 201.807 122,986.900 ↑ 1.0 25 1

Limit (cost=0.43..1,423.52 rows=25 width=4) (actual time=13,476.899..122,986.9 rows=25 loops=1)

  • Buffers: shared hit=4631694, temp read=12324 written=12588
2. 109,030.658 122,785.093 ↑ 154,816.9 25 1

Index Scan using id_service_id_in_p on carsharing_rental carsharing_rental (cost=0.43..220,318,179.54 rows=3,870,422 width=4) (actual time=13,476.896..122,785.093 rows=25 loops=1)

  • Index Cond: (carsharing_rental.in_progress = false)
  • Filter: ((NOT carsharing_rental.in_progress) AND ((upper((carsharing_rental.id)::text) ~~ 'ASH%'::text) OR (upper((carsharing_rental.event_id)::text) ~~ 'ASH%'::text) OR (alternatives: SubPlan 1 or hashed SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4)))
  • Buffers: shared hit=4631694, temp read=12324 written=12588
3.          

SubPlan (for Index Scan)

4. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=1.7..25.92 rows=1 width=0) (never executed)

5. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=1.27..25.34 rows=1 width=16) (never executed)

6. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=0.85..16.9 rows=1 width=4) (never executed)

7. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using carsharing_customer_pkey on carsharing_customer u0 (cost=0.42..8.44 rows=1 width=4) (never executed)

  • Index Cond: (u0.customer_ptr_id = carsharing_rental.customer_id)
8. 0.000 0.000 ↓ 0.0 0 0

Index Scan using common_customer_pkey on common_customer u1 (cost=0.42..8.44 rows=1 width=8) (never executed)

  • Index Cond: (u1.id = carsharing_rental.customer_id)
9. 0.000 0.000 ↓ 0.0 0 0

Index Scan using common_userprofile_pkey on common_userprofile u2 (cost=0.42..8.44 rows=1 width=20) (never executed)

  • Index Cond: (u2.id = u1.user_profile_id)
10. 0.000 0.000 ↓ 0.0 0 0

Index Scan using auth_user_pkey on auth_user u3 (cost=0.42..0.57 rows=1 width=35) (never executed)

  • Index Cond: (u3.id = u2.user_id)
  • Filter: ((upper((u2.phone_number)::text) ~~ '%ASH%'::text) OR (upper((u3.email)::text) ~~ 'ASH%'::text) OR (upper((u3.first_name)::text) ~~ 'ASH%'::text) OR (upper((u3.last_name)::text) ~~ 'ASH%'::text))
11. 262.742 13,678.029 ↑ 1.6 578 1

Gather (cost=35,668.88..76,578.05 rows=936 width=4) (actual time=6,528.843..13,678.029 rows=578 loops=1)

  • Buffers: shared hit=52538, temp read=12324 written=12588
12. 2.723 13,415.287 ↑ 2.0 193 3

Nested Loop (cost=34,668.88..75,484.45 rows=390 width=4) (actual time=6,336.185..13,415.287 rows=193 loops=3)

  • Buffers: shared hit=52538, temp read=12324 written=12588
13. 1.719 13,412.552 ↑ 2.0 193 3

Nested Loop (cost=34,668.45..75,296.95 rows=390 width=4) (actual time=6,336.155..13,412.552 rows=193 loops=3)

  • Buffers: shared hit=50222, temp read=12324 written=12588
14. 8,848.095 13,410.827 ↑ 2.0 194 3

Hash Join (cost=34,668.03..75,101.29 rows=390 width=4) (actual time=6,336.118..13,410.827 rows=194 loops=3)

  • Buffers: shared hit=47894, temp read=12324 written=12588
15. 1,601.440 1,601.440 ↑ 1.3 349,051 3

Seq Scan on auth_user u3_1 (cost=0..29,908.36 rows=436,536 width=35) (actual time=0.009..1,601.44 rows=349,051 loops=3)

  • Buffers: shared hit=25543
16. 1,368.815 2,961.292 ↑ 1.3 349,014 3

Hash (cost=26,657.67..26,657.67 rows=436,268 width=20) (actual time=2,961.291..2,961.292 rows=349,014 loops=3)

  • Buffers: shared hit=22295, temp written=5268
17. 1,592.477 1,592.477 ↑ 1.3 349,014 3

Seq Scan on common_userprofile u2_1 (cost=0..26,657.67 rows=436,268 width=20) (actual time=0.011..1,592.477 rows=349,014 loops=3)

  • Buffers: shared hit=22295
18. 0.006 0.006 ↑ 1.0 1 582

Index Scan using common_customer_user_profile_id_key on common_customer u1_1 (cost=0.42..0.5 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=582)

  • Index Cond: (u1_1.user_profile_id = u2_1.id)
  • Buffers: shared hit=2328
19. 0.012 0.012 ↑ 1.0 1 578

Index Only Scan using carsharing_customer_pkey on carsharing_customer u0_1 (cost=0.42..0.48 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=578)

  • Index Cond: (u0_1.customer_ptr_id = u1_1.id)
  • Heap Fetches: 578
  • Buffers: shared hit=2316
20. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=0.55..16.6 rows=1 width=0) (never executed)

21. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using carsharing_vehicle_pkey on carsharing_vehicle u0_2 (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Index Cond: (u0_2.vehicle_ptr_id = carsharing_rental.vehicle_id)
22. 0.000 0.000 ↓ 0.0 0 0

Index Scan using common_vehicle_pkey on common_vehicle u1_2 (cost=0.28..8.31 rows=1 width=4) (never executed)

  • Index Cond: (u1_2.id = carsharing_rental.vehicle_id)
  • Filter: ((upper((u1_2.vin_number)::text) ~~ 'ASH%'::text) OR (upper((u1_2.license_plate_number)::text) ~~ '%ASH%'::text))
23. 0.024 76.406 ↑ 5.0 1 1

Hash Join (cost=104.3..502.14 rows=5 width=4) (actual time=32.345..76.406 rows=1 loops=1)

  • Buffers: shared hit=457
24. 44.081 44.081 ↑ 95.0 1 1

Seq Scan on common_vehicle u1_3 (cost=0..397.6 rows=95 width=4) (actual time=0.024..44.081 rows=1 loops=1)

  • Filter: ((upper((u1_3.vin_number)::text) ~~ 'ASH%'::text) OR (upper((u1_3.license_plate_number)::text) ~~ '%ASH%'::text))
  • Buffers: shared hit=355
25. 22.605 32.301 ↓ 47.1 4,801 1

Hash (cost=103.02..103.02 rows=102 width=4) (actual time=32.3..32.301 rows=4,801 loops=1)

  • Buffers: shared hit=102
26. 9.696 9.696 ↓ 47.1 4,801 1

Seq Scan on carsharing_vehicle u0_3 (cost=0..103.02 rows=102 width=4) (actual time=0.007..9.696 rows=4,801 loops=1)

  • Buffers: shared hit=102