explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2B6n

Settings
# exclusive inclusive rows x rows loops node
1. 6.168 58.987 ↓ 711.0 711 1

Nested Loop Left Join (cost=34.28..1,268.55 rows=1 width=1,536) (actual time=0.887..58.987 rows=711 loops=1)

2.          

CTE basic_data

3. 0.003 0.071 ↑ 1.0 1 1

Nested Loop (cost=0.71..20.54 rows=1 width=532) (actual time=0.056..0.071 rows=1 loops=1)

  • Join Filter: (ct.countryid = fc2.countryid)
  • Rows Removed by Join Filter: 6
4. 0.001 0.059 ↑ 1.0 1 1

Nested Loop (cost=0.71..18.81 rows=1 width=535) (actual time=0.049..0.059 rows=1 loops=1)

  • Join Filter: (ct.countryid = fc.countryid)
5. 0.002 0.050 ↑ 1.0 1 1

Nested Loop (cost=0.71..17.16 rows=1 width=530) (actual time=0.043..0.050 rows=1 loops=1)

6. 0.004 0.045 ↑ 1.0 1 1

Nested Loop (cost=0.57..16.90 rows=1 width=10) (actual time=0.039..0.045 rows=1 loops=1)

7. 0.002 0.039 ↑ 1.0 1 1

Nested Loop (cost=0.43..16.73 rows=1 width=10) (actual time=0.035..0.039 rows=1 loops=1)

8. 0.034 0.034 ↑ 1.0 1 1

Index Scan using mwq_areapolygons_polygongeo on mwq_areapolygons ap (cost=0.15..8.42 rows=1 width=4) (actual time=0.031..0.034 rows=1 loops=1)

  • Index Cond: (polygongeo && '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Filter: _st_intersects(polygongeo, '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Rows Removed by Filter: 1
9. 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.002..0.003 rows=1 loops=1)

  • Index Cond: (id = ap.id)
10. 0.002 0.002 ↑ 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.002 rows=1 loops=1)

  • Index Cond: (id = a_1.cityid)
11. 0.003 0.003 ↑ 1.0 1 1

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

  • Index Cond: (countryid = ct.countryid)
12. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on tgb_featurecountry fc (cost=0.00..1.64 rows=1 width=5) (actual time=0.005..0.008 rows=1 loops=1)

  • Filter: (featureid = 2)
  • Rows Removed by Filter: 50
13. 0.009 0.009 ↑ 1.0 7 1

Seq Scan on tgb_featurecountry fc2 (cost=0.00..1.64 rows=7 width=5) (actual time=0.003..0.009 rows=7 loops=1)

  • Filter: (featureid = 1)
  • Rows Removed by Filter: 44
14.          

Initplan (forNested Loop Left Join)

15. 0.002 0.002 ↑ 1.0 1 1

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

16. 0.001 0.001 ↑ 1.0 1 1

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

17. 0.001 0.001 ↑ 1.0 1 1

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

18. 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)

19. 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.000..0.001 rows=1 loops=1)

20. 0.001 0.001 ↑ 1.0 1 1

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

21. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_6 (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_7 (cost=0.00..0.02 rows=1 width=1) (actual time=0.000..0.001 rows=1 loops=1)

23. 0.002 0.002 ↑ 1.0 1 1

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

24. 0.075 0.075 ↑ 1.0 1 1

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

25. 1.382 51.313 ↓ 711.0 711 1

Nested Loop Left Join (cost=13.26..1,247.24 rows=1 width=990) (actual time=0.765..51.313 rows=711 loops=1)

26. 1.671 47.798 ↓ 711.0 711 1

Nested Loop Left Join (cost=12.98..1,246.49 rows=1 width=917) (actual time=0.760..47.798 rows=711 loops=1)

27. 1.324 44.000 ↓ 709.0 709 1

Nested Loop Left Join (cost=12.69..1,245.79 rows=1 width=812) (actual time=0.753..44.000 rows=709 loops=1)

28. 1.224 39.131 ↓ 709.0 709 1

Nested Loop (cost=12.27..1,237.33 rows=1 width=808) (actual time=0.745..39.131 rows=709 loops=1)

29. 0.777 36.489 ↓ 709.0 709 1

Nested Loop (cost=11.98..1,236.86 rows=1 width=804) (actual time=0.740..36.489 rows=709 loops=1)

30. 1.455 32.876 ↓ 709.0 709 1

Nested Loop (cost=11.56..1,228.53 rows=1 width=807) (actual time=0.733..32.876 rows=709 loops=1)

31. 1.352 29.282 ↓ 713.0 713 1

Nested Loop (cost=11.28..1,222.07 rows=1 width=704) (actual time=0.727..29.282 rows=713 loops=1)

  • Join Filter: (ca.restaurantid = brandrestaurant.restaurantid)
32. 1.078 25.791 ↓ 356.5 713 1

Nested Loop (cost=10.99..1,219.10 rows=2 width=688) (actual time=0.719..25.791 rows=713 loops=1)

  • Join Filter: (ca.restaurantid = sl.referenceid)
33. 1.463 21.861 ↓ 142.6 713 1

Nested Loop (cost=10.70..1,212.79 rows=5 width=665) (actual time=0.710..21.861 rows=713 loops=1)

34. 6.488 17.546 ↓ 50.9 713 1

Nested Loop (cost=10.42..1,133.42 rows=14 width=484) (actual time=0.700..17.546 rows=713 loops=1)

  • Join Filter: (ca.deliverytime = tdt.value)
  • Rows Removed by Join Filter: 19993
35. 5.611 6.060 ↓ 11.0 714 1

Bitmap Heap Scan on tgb_coveragepolygon ca (cost=10.42..1,124.30 rows=65 width=48) (actual time=0.664..6.060 rows=714 loops=1)

  • Recheck Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Filter: ((restaurantstatus <> 3) AND _st_contains(polygongeo, '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry))
  • Rows Removed by Filter: 1171
  • Heap Blocks: exact=1617
36. 0.449 0.449 ↓ 6.7 1,885 1

Bitmap Index Scan on tgb_coveragepolygon_polygongeo_idx (cost=0.00..10.41 rows=283 width=0) (actual time=0.449..0.449 rows=1,885 loops=1)

  • Index Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
37. 4.979 4.998 ↓ 3.6 29 714

Materialize (cost=0.00..1.34 rows=8 width=438) (actual time=0.000..0.007 rows=29 loops=714)

38. 0.019 0.019 ↓ 3.6 29 1

Seq Scan on tlb_deliverytimes tdt (cost=0.00..1.30 rows=8 width=438) (actual time=0.004..0.019 rows=29 loops=1)

  • Filter: ((NOT isdeleted) AND (NOT status))
  • Rows Removed by Filter: 1
39. 2.852 2.852 ↑ 1.0 1 713

Index Scan using mwq_restaurant_pkey on mwq_restaurant r (cost=0.28..5.66 rows=1 width=181) (actual time=0.004..0.004 rows=1 loops=713)

  • Index Cond: (id = ca.restaurantid)
  • Filter: ((NOT isdeleted) AND (NOT isdeleted) AND (status <> 3) AND (status <> 3))
40. 2.852 2.852 ↑ 1.0 1 713

Index Scan using tlb_slug_referenceid_idx on tlb_slug sl (cost=0.29..1.25 rows=1 width=23) (actual time=0.003..0.004 rows=1 loops=713)

  • Index Cond: (referenceid = r.id)
  • Filter: ((NOT isdeleted) AND (typeid = 1) AND (brandtype = 1))
  • Rows Removed by Filter: 1
41. 2.139 2.139 ↑ 1.0 1 713

Index Scan using tlb_restaurantbrand_resttid_brndid_idx on tlb_restaurant_brand brandrestaurant (cost=0.29..1.47 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=713)

  • Index Cond: ((restaurantid = sl.referenceid) AND (brandtype = 1))
  • Filter: (isactive AND (NOT isdeleted))
42. 2.139 2.139 ↑ 1.0 1 713

Index Scan using mwq_branch_pkey on mwq_branch b (cost=0.29..6.46 rows=1 width=107) (actual time=0.003..0.003 rows=1 loops=713)

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

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

  • Index Cond: (coveragepolygonid = ca.id)
44. 1.418 1.418 ↑ 1.0 1 709

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

  • Index Cond: (id = b.areaid)
45. 3.545 3.545 ↑ 1.0 1 709

Index Scan using "tlb_RestLstDynmc_restid_areaid_brndtyp_idx" on tlb_restaurantlistdynamic rld (cost=0.42..8.44 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=709)

  • Index Cond: ((restid = ca.restaurantid) AND (areaid = ca.areaid) AND (brandtype = 1))
46. 2.127 2.127 ↑ 1.0 1 709

Index Scan using tlb_branchdetails_branchid_idx on tlb_branch_details bd (cost=0.29..0.70 rows=1 width=109) (actual time=0.003..0.003 rows=1 loops=709)

  • Index Cond: ((b.id = branchid) AND (brandtype = 1))
47. 2.133 2.133 ↑ 1.0 1 711

Index Scan using "tlb_CommonRestuarantFields_restid_idx" on tlb_commonrestuarantfields cr (cost=0.28..0.73 rows=1 width=77) (actual time=0.003..0.003 rows=1 loops=711)

  • Index Cond: (r.id = restaurantid)
48. 1.422 1.422 ↓ 0.0 0 711

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

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