explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1PSy

Settings
# exclusive inclusive rows x rows loops node
1. 7.598 5,383.689 ↓ 710.0 710 1

Nested Loop Left Join (cost=172.37..2,909.55 rows=1 width=1,083) (actual time=13.507..5,383.689 rows=710 loops=1)

2.          

CTE basic_data

3. 0.002 0.077 ↑ 1.0 1 1

Nested Loop (cost=4.87..41.35 rows=1 width=45) (actual time=0.066..0.077 rows=1 loops=1)

4. 0.004 0.073 ↑ 1.0 1 1

Nested Loop (cost=4.74..41.11 rows=1 width=14) (actual time=0.063..0.073 rows=1 loops=1)

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

Seq Scan on tgb_featurecountry fc (cost=0.00..1.13 rows=1 width=5) (actual time=0.006..0.009 rows=1 loops=1)

  • Filter: (featureid = 2)
  • Rows Removed by Filter: 50
6. 0.003 0.060 ↑ 2.0 1 1

Nested Loop (cost=4.74..39.98 rows=2 width=9) (actual time=0.054..0.060 rows=1 loops=1)

7. 0.001 0.055 ↑ 2.0 1 1

Nested Loop (cost=4.59..39.67 rows=2 width=9) (actual time=0.050..0.055 rows=1 loops=1)

8. 0.010 0.049 ↑ 2.0 1 1

Bitmap Heap Scan on mwq_areapolygons ap (cost=4.31..23.09 rows=2 width=4) (actual time=0.045..0.049 rows=1 loops=1)

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

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

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

Index Scan using mwq_area_pkey on mwq_area a_1 (cost=0.28..8.29 rows=1 width=9) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (id = ap.id)
11. 0.002 0.002 ↑ 1.0 1 1

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

  • Index Cond: (id = a_1.cityid)
12. 0.002 0.002 ↑ 1.0 1 1

Index Scan using tgb_countrysettings_pkey on tgb_countrysettings cs (cost=0.13..0.24 rows=1 width=34) (actual time=0.001..0.002 rows=1 loops=1)

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

Initplan (forNested Loop Left Join)

14. 0.001 0.001 ↑ 1.0 1 1

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

15. 0.001 0.001 ↑ 1.0 1 1

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

16. 0.000 0.000 ↑ 1.0 1 1

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

17. 0.001 0.001 ↑ 1.0 1 1

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

18. 0.001 0.001 ↑ 1.0 1 1

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

19. 0.001 0.001 ↑ 1.0 1 1

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

20. 0.001 0.001 ↑ 1.0 1 1

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

21. 0.080 0.080 ↑ 1.0 1 1

CTE Scan on basic_data basic_data_7 (cost=0.00..0.00 rows=1 width=4) (actual time=0.069..0.080 rows=1 loops=1)

22. 1.757 5,374.585 ↓ 710.0 710 1

Nested Loop (cost=130.74..2,867.79 rows=1 width=359) (actual time=13.379..5,374.585 rows=710 loops=1)

  • Join Filter: (ca.restaurantid = cr.restaurantid)
23. 2,303.026 5,367.858 ↓ 710.0 710 1

Nested Loop (cost=130.45..2,867.49 rows=1 width=342) (actual time=13.371..5,367.858 rows=710 loops=1)

  • Join Filter: (ca.branchid = bd.branchid)
  • Rows Removed by Join Filter: 9667030
24. 1.421 33.884 ↓ 708.0 708 1

Nested Loop (cost=130.45..1,681.93 rows=1 width=282) (actual time=5.265..33.884 rows=708 loops=1)

25. 0.883 29.631 ↓ 44.2 708 1

Nested Loop (cost=130.03..1,548.94 rows=16 width=270) (actual time=5.258..29.631 rows=708 loops=1)

26. 1.062 26.624 ↓ 44.2 708 1

Nested Loop (cost=129.74..1,542.32 rows=16 width=266) (actual time=5.254..26.624 rows=708 loops=1)

27. 1.070 22.730 ↓ 44.2 708 1

Nested Loop (cost=129.32..1,410.35 rows=16 width=269) (actual time=5.247..22.730 rows=708 loops=1)

28. 1.470 18.808 ↓ 39.6 713 1

Nested Loop (cost=129.04..1,295.95 rows=18 width=201) (actual time=5.239..18.808 rows=713 loops=1)

  • Join Filter: (ca.restaurantid = brandrestaurant.restaurantid)
29. 1.566 15.199 ↓ 37.5 713 1

Nested Loop (cost=128.75..1,287.81 rows=19 width=189) (actual time=5.233..15.199 rows=713 loops=1)

  • Join Filter: (ca.restaurantid = r.id)
30. 0.725 10.068 ↓ 13.0 713 1

Hash Join (cost=128.47..1,241.68 rows=55 width=73) (actual time=5.221..10.068 rows=713 loops=1)

  • Hash Cond: (ca.deliverytime = tdt.value)
31. 0.949 9.317 ↓ 10.8 714 1

Hash Join (cost=127.39..1,240.35 rows=66 width=66) (actual time=5.187..9.317 rows=714 loops=1)

  • Hash Cond: (ca.restaurantid = sl.referenceid)
32. 3.221 3.571 ↓ 10.8 714 1

Bitmap Heap Scan on tgb_coveragepolygon ca (cost=10.42..1,123.04 rows=66 width=48) (actual time=0.375..3.571 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=106
33. 0.350 0.350 ↓ 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.350..0.350 rows=1,885 loops=1)

  • Index Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
34. 2.196 4.797 ↑ 1.0 6,913 1

Hash (cost=99.00..99.00 rows=6,913 width=18) (actual time=4.797..4.797 rows=6,913 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 417kB
35. 2.601 2.601 ↑ 1.0 6,913 1

Seq Scan on tlb_slug sl (cost=0.00..99.00 rows=6,913 width=18) (actual time=0.006..2.601 rows=6,913 loops=1)

  • Filter: ((NOT isdeleted) AND (typeid = 1))
  • Rows Removed by Filter: 9
36. 0.011 0.026 ↑ 1.0 29 1

Hash (cost=1.00..1.00 rows=29 width=9) (actual time=0.026..0.026 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
37. 0.015 0.015 ↑ 1.0 29 1

Seq Scan on tlb_deliverytimes tdt (cost=0.00..1.00 rows=29 width=9) (actual time=0.004..0.015 rows=29 loops=1)

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

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

  • Index Cond: (id = sl.referenceid)
  • Filter: ((NOT isdeleted) AND (NOT isdeleted) AND (status <> 3) AND (status <> 3))
39. 2.139 2.139 ↑ 1.0 1 713

Index Scan using tlb_restaurantbrand_resttid_idx on tlb_restaurant_brand brandrestaurant (cost=0.28..0.43 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=713)

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

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

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

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

  • Index Cond: (coveragepolygonid = ca.id)
42. 2.124 2.124 ↑ 1.0 1 708

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

  • Index Cond: (id = b.areaid)
43. 2.832 2.832 ↑ 1.0 1 708

Index Scan using tlb_restaurantlistdynamic_restid_areaid_idx on tlb_restaurantlistdynamic rld (cost=0.42..8.31 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=708)

  • Index Cond: ((areaid = ca.areaid) AND (restid = ca.restaurantid))
44. 3,030.948 3,030.948 ↑ 1.1 13,655 708

Seq Scan on tlb_branch_details bd (cost=0.00..1,147.47 rows=14,652 width=68) (actual time=0.458..4.281 rows=13,655 loops=708)

45. 4.970 4.970 ↑ 1.0 1 710

Index Scan using "tlb_CommonRestuarantFields_restid_idx" on tlb_commonrestuarantfields cr (cost=0.29..0.30 rows=1 width=37) (actual time=0.004..0.007 rows=1 loops=710)

  • Index Cond: (restaurantid = rld.restid)
46. 1.420 1.420 ↓ 0.0 0 710

Index Scan using "tlb_Sponsored_Restaurant_rest_area_idx" on tlb_sponsored_restaurant sp (cost=0.28..0.35 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=710)

  • Index Cond: ((r.id = restaurantid) AND (areaid = $11))