explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Eha4

Settings
# exclusive inclusive rows x rows loops node
1. 5.714 46.303 ↓ 624.0 624 1

Nested Loop Left Join (cost=20,000,000,069.95..20,000,001,489.77 rows=1 width=1,084) (actual time=0.748..46.303 rows=624 loops=1)

2.          

CTE basic_data

3. 0.003 0.096 ↑ 1.0 1 1

Nested Loop (cost=20,000,000,008.13..20,000,000,043.83 rows=1 width=46) (actual time=0.087..0.096 rows=1 loops=1)

4. 0.005 0.089 ↑ 1.0 1 1

Nested Loop (cost=20,000,000,007.99..20,000,000,043.57 rows=1 width=20) (actual time=0.081..0.089 rows=1 loops=1)

  • Join Filter: (fc.countryid = ct.countryid)
5. 0.005 0.033 ↑ 1.0 1 1

Merge Join (cost=20,000,000,003.38..20,000,000,003.44 rows=1 width=10) (actual time=0.032..0.033 rows=1 loops=1)

  • Merge Cond: (fc.countryid = fc2.countryid)
6. 0.006 0.016 ↑ 1.0 1 1

Sort (cost=10,000,000,001.65..10,000,000,001.65 rows=1 width=5) (actual time=0.016..0.016 rows=1 loops=1)

  • Sort Key: fc.countryid
  • Sort Method: quicksort Memory: 25kB
7. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on tgb_featurecountry fc (cost=10,000,000,000.00..10,000,000,001.64 rows=1 width=5) (actual time=0.007..0.010 rows=1 loops=1)

  • Filter: (featureid = 2)
  • Rows Removed by Filter: 50
8. 0.003 0.012 ↑ 3.5 2 1

Sort (cost=10,000,000,001.74..10,000,000,001.75 rows=7 width=5) (actual time=0.012..0.012 rows=2 loops=1)

  • Sort Key: fc2.countryid
  • Sort Method: quicksort Memory: 25kB
9. 0.009 0.009 ↑ 1.0 7 1

Seq Scan on tgb_featurecountry fc2 (cost=10,000,000,000.00..10,000,000,001.64 rows=7 width=5) (actual time=0.003..0.009 rows=7 loops=1)

  • Filter: (featureid = 1)
  • Rows Removed by Filter: 44
10. 0.001 0.051 ↑ 2.0 1 1

Nested Loop (cost=4.61..40.11 rows=2 width=10) (actual time=0.046..0.051 rows=1 loops=1)

11. 0.003 0.047 ↑ 2.0 1 1

Nested Loop (cost=4.47..39.76 rows=2 width=10) (actual time=0.043..0.047 rows=1 loops=1)

12. 0.008 0.041 ↑ 2.0 1 1

Bitmap Heap Scan on mwq_areapolygons ap (cost=4.19..23.14 rows=2 width=4) (actual time=0.038..0.041 rows=1 loops=1)

  • Recheck Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Filter: _st_contains(polygongeo, '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=2
13. 0.033 0.033 ↑ 2.5 2 1

Bitmap Index Scan on mwq_areapolygons_polygongeo (cost=0.00..4.18 rows=5 width=0) (actual time=0.033..0.033 rows=2 loops=1)

  • Index Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
14. 0.003 0.003 ↑ 1.0 1 1

Index Scan using mwq_area_pkey on mwq_area a_1 (cost=0.28..8.30 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (id = ap.id)
15. 0.003 0.003 ↑ 1.0 1 1

Index Scan using mwq_city_pkey on mwq_city ct (cost=0.14..0.16 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (id = a_1.cityid)
16. 0.004 0.004 ↑ 1.0 1 1

Index Scan using tgb_countrysettings_pkey on tgb_countrysettings cs (cost=0.13..0.25 rows=1 width=34) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (countryid = ct.countryid)
17.          

Initplan (forNested Loop Left Join)

18. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basic_data (cost=0.00..0.02 rows=1 width=1) (actual time=0.001..0.001 rows=1 loops=1)

19. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_1 (cost=0.00..0.02 rows=1 width=1) (actual time=0.000..0.000 rows=1 loops=1)

20. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_2 (cost=0.00..0.02 rows=1 width=1) (actual time=0.000..0.000 rows=1 loops=1)

21. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_3 (cost=0.00..0.02 rows=1 width=1) (actual time=0.000..0.000 rows=1 loops=1)

22. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_4 (cost=0.00..0.02 rows=1 width=1) (actual time=0.001..0.001 rows=1 loops=1)

23. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_5 (cost=0.00..0.02 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1)

24. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_6 (cost=0.00..0.02 rows=1 width=1) (actual time=0.001..0.001 rows=1 loops=1)

25. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_7 (cost=0.00..0.02 rows=1 width=1) (actual time=0.001..0.001 rows=1 loops=1)

26. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_8 (cost=0.00..0.02 rows=1 width=516) (actual time=0.000..0.000 rows=1 loops=1)

27. 0.099 0.099 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_9 (cost=0.00..0.02 rows=1 width=4) (actual time=0.090..0.099 rows=1 loops=1)

28. 1.310 39.238 ↓ 624.0 624 1

Nested Loop (cost=25.64..1,445.20 rows=1 width=360) (actual time=0.599..39.238 rows=624 loops=1)

  • Join Filter: (ca.restaurantid = cr.restaurantid)
29. 0.983 36.056 ↓ 624.0 624 1

Nested Loop (cost=25.36..1,444.88 rows=1 width=343) (actual time=0.592..36.056 rows=624 loops=1)

  • Join Filter: (ca.branchid = bd.branchid)
30. 1.110 32.585 ↓ 622.0 622 1

Nested Loop (cost=25.07..1,444.43 rows=1 width=283) (actual time=0.585..32.585 rows=622 loops=1)

31. 1.304 27.121 ↓ 44.4 622 1

Nested Loop (cost=24.65..1,326.99 rows=14 width=271) (actual time=0.578..27.121 rows=622 loops=1)

32. 1.352 24.573 ↓ 44.4 622 1

Nested Loop (cost=24.37..1,320.73 rows=14 width=267) (actual time=0.574..24.573 rows=622 loops=1)

  • Join Filter: (ca.restaurantid = sl.referenceid)
33. 1.236 21.355 ↓ 44.4 622 1

Nested Loop (cost=24.08..1,314.29 rows=14 width=249) (actual time=0.567..21.355 rows=622 loops=1)

34. 0.944 18.022 ↓ 46.6 699 1

Nested Loop (cost=23.66..1,188.53 rows=15 width=252) (actual time=0.559..18.022 rows=699 loops=1)

35. 1.418 14.262 ↓ 44.0 704 1

Nested Loop (cost=23.38..1,085.96 rows=16 width=184) (actual time=0.552..14.262 rows=704 loops=1)

  • Join Filter: (ca.restaurantid = brandrestaurant.restaurantid)
36. 1.623 10.732 ↓ 41.4 704 1

Nested Loop (cost=23.10..1,072.97 rows=17 width=172) (actual time=0.545..10.732 rows=704 loops=1)

37. 0.747 6.293 ↓ 13.8 704 1

Hash Join (cost=22.81..784.91 rows=51 width=55) (actual time=0.534..6.293 rows=704 loops=1)

  • Hash Cond: (ca.deliverytime = tdt.value)
38. 5.187 5.517 ↓ 11.2 705 1

Bitmap Heap Scan on tgb_coveragepolygon ca (cost=9.72..771.07 rows=63 width=48) (actual time=0.496..5.517 rows=705 loops=1)

  • Recheck Cond: ((polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry) AND (restaurantstatus <> 3))
  • Filter: _st_contains(polygongeo, '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Rows Removed by Filter: 611
  • Heap Blocks: exact=1205
39. 0.330 0.330 ↓ 6.9 1,316 1

Bitmap Index Scan on tgb_coveragepolygon_polygongeo_idx (cost=0.00..9.71 rows=190 width=0) (actual time=0.330..0.330 rows=1,316 loops=1)

  • Index Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
40. 0.011 0.029 ↑ 1.0 29 1

Hash (cost=12.73..12.73 rows=29 width=9) (actual time=0.029..0.029 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
41. 0.018 0.018 ↑ 1.0 29 1

Index Scan using "Value_Deleted_Status_Indx" on tlb_deliverytimes tdt (cost=0.14..12.73 rows=29 width=9) (actual time=0.005..0.018 rows=29 loops=1)

  • Index Cond: ((isdeleted = false) AND (status = false))
  • Filter: ((NOT isdeleted) AND (NOT status))
42. 2.816 2.816 ↑ 1.0 1 704

Index Scan using mwq_restaurant_pkey on mwq_restaurant r (cost=0.28..5.64 rows=1 width=117) (actual time=0.004..0.004 rows=1 loops=704)

  • Index Cond: (id = ca.restaurantid)
  • Filter: ((NOT isdeleted) AND (NOT isdeleted) AND (status <> 3) AND (status <> 3))
43. 2.112 2.112 ↑ 1.0 1 704

Index Scan using tlb_restaurantbrand_resttid_brndid_idx on tlb_restaurant_brand brandrestaurant (cost=0.28..0.75 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=704)

  • Index Cond: ((restaurantid = r.id) AND (brandtype = 1))
  • Filter: (isactive AND (NOT isdeleted))
44. 2.816 2.816 ↑ 1.0 1 704

Index Scan using mwq_branch_pkey on mwq_branch b (cost=0.29..6.40 rows=1 width=68) (actual time=0.003..0.004 rows=1 loops=704)

  • Index Cond: (id = ca.branchid)
  • Filter: ((NOT isdeleted) AND (status <> 3))
  • Rows Removed by Filter: 0
45. 2.097 2.097 ↑ 1.0 1 699

Index Scan using tlb_restaurant_timingstatus_pkey on tlb_coveragepolygon_timingstatus cpt (cost=0.42..8.37 rows=1 width=5) (actual time=0.003..0.003 rows=1 loops=699)

  • Index Cond: (coveragepolygonid = ca.id)
46. 1.866 1.866 ↑ 1.0 1 622

Index Scan using tlb_slug_referenceid_idx on tlb_slug sl (cost=0.28..0.45 rows=1 width=18) (actual time=0.003..0.003 rows=1 loops=622)

  • Index Cond: (referenceid = brandrestaurant.restaurantid)
  • Filter: ((NOT isdeleted) AND (typeid = 1) AND (brandtype = 1))
47. 1.244 1.244 ↑ 1.0 1 622

Index Scan using mwq_area_pkey on mwq_area a (cost=0.28..0.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=622)

  • Index Cond: (id = b.areaid)
48. 4.354 4.354 ↑ 1.0 1 622

Index Scan using tlb_restaurantlistdynamic_restid_areaid_idx on tlb_restaurantlistdynamic rld (cost=0.42..8.38 rows=1 width=20) (actual time=0.007..0.007 rows=1 loops=622)

  • Index Cond: ((areaid = ca.areaid) AND (restid = ca.restaurantid))
49. 2.488 2.488 ↑ 1.0 1 622

Index Scan using tlb_branchdetails_branchid_idx on tlb_branch_details bd (cost=0.29..0.44 rows=1 width=68) (actual time=0.003..0.004 rows=1 loops=622)

  • Index Cond: ((branchid = b.id) AND (brandtype = 1))
50. 1.872 1.872 ↑ 1.0 1 624

Index Scan using "tlb_CommonRestuarantFields_restid_idx" on tlb_commonrestuarantfields cr (cost=0.28..0.30 rows=1 width=37) (actual time=0.003..0.003 rows=1 loops=624)

  • Index Cond: (restaurantid = rld.restid)
51. 1.248 1.248 ↓ 0.0 0 624

Index Scan using "tlb_Sponsored_Restaurant_rest_area_brnd_idx" on tlb_sponsored_restaurant sp (cost=0.28..0.48 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=624)

  • Index Cond: ((r.id = restaurantid) AND (areaid = $13) AND (brandtype = 1))