explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5jVk

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 6.805 ↑ 1.0 50 1

Limit (cost=5.69..659.13 rows=50 width=4,021) (actual time=0.924..6.805 rows=50 loops=1)

2. 5.675 6.784 ↑ 22,324.7 50 1

Nested Loop Left Join (cost=5.69..14,587,763.78 rows=1,116,233 width=4,021) (actual time=0.924..6.784 rows=50 loops=1)

3. 0.048 1.109 ↑ 22,324.7 50 1

Nested Loop Left Join (cost=5.27..11,749,138.37 rows=1,116,233 width=4,311) (actual time=0.192..1.109 rows=50 loops=1)

4. 0.057 1.061 ↑ 22,324.7 50 1

Nested Loop Left Join (cost=4.84..10,558,524.81 rows=1,116,233 width=4,281) (actual time=0.190..1.061 rows=50 loops=1)

5. 0.045 0.804 ↑ 22,324.7 50 1

Nested Loop Left Join (cost=4.41..9,117,444.51 rows=1,116,233 width=4,182) (actual time=0.079..0.804 rows=50 loops=1)

6. 0.057 0.759 ↑ 22,324.7 50 1

Nested Loop (cost=4.13..8,253,632.09 rows=1,116,233 width=4,150) (actual time=0.078..0.759 rows=50 loops=1)

7. 0.065 0.352 ↑ 22,324.7 50 1

Nested Loop Left Join (cost=3.70..6,812,551.78 rows=1,116,233 width=4,040) (actual time=0.065..0.352 rows=50 loops=1)

8. 0.032 0.287 ↑ 22,324.7 50 1

Nested Loop (cost=2.99..3,269,738.99 rows=1,116,233 width=3,979) (actual time=0.063..0.287 rows=50 loops=1)

9. 0.030 0.155 ↑ 16,008.7 50 1

Merge Left Join (cost=2.84..2,969,422.81 rows=800,435 width=3,962) (actual time=0.055..0.155 rows=50 loops=1)

  • Merge Cond: (f.id = i.offer_id)
10. 0.002 0.076 ↑ 159,155.8 5 1

Nested Loop Left Join (cost=2.41..1,512,310.92 rows=795,779 width=3,954) (actual time=0.034..0.076 rows=5 loops=1)

  • Join Filter: (r.travellingcustomer_id = pi.id)
  • Rows Removed by Join Filter: 5
11. 0.006 0.069 ↑ 159,155.8 5 1

Nested Loop Left Join (cost=2.41..1,500,374.22 rows=795,779 width=2,602) (actual time=0.031..0.069 rows=5 loops=1)

  • Join Filter: (r.bookingcustomer_id = ci.id)
  • Rows Removed by Join Filter: 5
12. 0.004 0.058 ↑ 159,155.8 5 1

Nested Loop Left Join (cost=2.41..1,488,437.51 rows=795,779 width=655) (actual time=0.025..0.058 rows=5 loops=1)

13. 0.005 0.054 ↑ 159,155.8 5 1

Merge Join (cost=2.12..862,657.68 rows=795,779 width=315) (actual time=0.024..0.054 rows=5 loops=1)

  • Merge Cond: (f.id = r.selectedoffer_id)
14. 0.002 0.013 ↑ 767,746.0 1 1

Nested Loop (cost=0.70..603,187.45 rows=767,746 width=122) (actual time=0.012..0.013 rows=1 loops=1)

15. 0.007 0.007 ↑ 767,746.0 1 1

Index Scan using md_offer_pkey on md_offer f (cost=0.42..263,067.65 rows=767,746 width=12) (actual time=0.006..0.007 rows=1 loops=1)

16. 0.004 0.004 ↑ 1.0 1 1

Index Scan using md_vehicletype_pkey on md_vehicle_type vt (cost=0.27..0.43 rows=1 width=110) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id = f.vehicletype_id)
17. 0.036 0.036 ↑ 159,155.8 5 1

Index Scan using idx_2c22b5ef36bc895b on md_abstract_reservation r (cost=0.42..263,627.44 rows=795,779 width=193) (actual time=0.009..0.036 rows=5 loops=1)

18. 0.000 0.000 ↓ 0.0 0 5

Index Scan using idx_vehicle_id on md_vehicle v (cost=0.29..0.78 rows=1 width=348) (actual time=0.000..0.000 rows=0 loops=5)

  • Index Cond: (r.vehicle_id = id)
19. 0.002 0.005 ↑ 1.0 1 5

Materialize (cost=0.00..0.03 rows=1 width=1,951) (actual time=0.000..0.001 rows=1 loops=5)

20. 0.003 0.003 ↑ 1.0 1 1

Subquery Scan on ci (cost=0.00..0.02 rows=1 width=1,951) (actual time=0.002..0.003 rows=1 loops=1)

21. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=1,951) (actual time=0.000..0.000 rows=1 loops=1)

22. 0.004 0.005 ↑ 1.0 1 5

Materialize (cost=0.00..0.03 rows=1 width=1,360) (actual time=0.001..0.001 rows=1 loops=5)

23. 0.000 0.001 ↑ 1.0 1 1

Subquery Scan on pi (cost=0.00..0.02 rows=1 width=1,360) (actual time=0.000..0.001 rows=1 loops=1)

24. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=1,951) (actual time=0.000..0.001 rows=1 loops=1)

25. 0.014 0.049 ↑ 15,444.8 50 1

Materialize (cost=0.43..1,470,906.38 rows=772,238 width=16) (actual time=0.018..0.049 rows=50 loops=1)

26. 0.035 0.035 ↑ 70,203.5 11 1

Index Scan using idx_60741d0f53c674ee on md_item i (cost=0.43..1,468,975.79 rows=772,238 width=16) (actual time=0.017..0.035 rows=11 loops=1)

  • Filter: (itemcode = ANY ('{101,102}'::integer[]))
  • Rows Removed by Filter: 12
27. 0.100 0.100 ↑ 1.0 1 50

Index Scan using idx_vehicle_type_translation_en on md_vehicle_type_translation t (cost=0.15..0.37 rows=1 width=29) (actual time=0.001..0.002 rows=1 loops=50)

  • Index Cond: (translatable_id = f.vehicletype_id)
28. 0.000 0.000 ↓ 0.0 0 50

Nested Loop Left Join (cost=0.71..3.16 rows=1 width=65) (actual time=0.000..0.000 rows=0 loops=50)

29. 0.000 0.000 ↓ 0.0 0 50

Index Scan using idx_character_driver on md_character c (cost=0.29..0.87 rows=1 width=35) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (r.driver_id = id)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using md_character_pkey on md_character cm (cost=0.42..2.28 rows=1 width=34) (never executed)

  • Index Cond: (c.company_id = id)
31. 0.350 0.350 ↑ 1.0 1 50

Index Scan using md_location_pkey on md_location loc (cost=0.43..1.28 rows=1 width=118) (actual time=0.007..0.007 rows=1 loops=50)

  • Index Cond: (id = r.origin_id)
32. 0.000 0.000 ↓ 0.0 0 50

Index Scan using md_area_pkey on md_area are (cost=0.28..0.76 rows=1 width=40) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (loc.cityareaid = id)
33. 0.200 0.200 ↑ 1.0 1 50

Index Scan using md_location_pkey on md_location loc_1 (cost=0.43..1.28 rows=1 width=111) (actual time=0.004..0.004 rows=1 loops=50)

  • Index Cond: (r.destination_id = id)
34. 0.000 0.000 ↓ 0.0 0 50

Index Scan using md_character_pkey on md_character dcm2 (cost=0.42..1.06 rows=1 width=34) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (r.drivercompany_id = id)
35. 0.000 0.000 ↓ 0.0 0 50

Index Scan using md_profile_pkey on md_profile p (cost=0.42..0.99 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (r.profile_id = id)
Planning time : 22.231 ms
Execution time : 7.107 ms