explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 993P

Settings
# exclusive inclusive rows x rows loops node
1. 1.860 16.650 ↓ 35.5 709 1

Nested Loop (cost=188.06..1,498.77 rows=20 width=793) (actual time=5.521..16.650 rows=709 loops=1)

2.          

CTE basic_data

3. 0.006 0.089 ↑ 1.0 1 1

Nested Loop (cost=4.87..42.51 rows=1 width=46) (actual time=0.073..0.089 rows=1 loops=1)

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

Nested Loop (cost=4.87..41.35 rows=1 width=49) (actual time=0.065..0.076 rows=1 loops=1)

5. 0.003 0.069 ↑ 1.0 1 1

Nested Loop (cost=4.74..41.11 rows=1 width=15) (actual time=0.060..0.069 rows=1 loops=1)

  • Join Filter: (ct.countryid = fc.countryid)
6. 0.008 0.008 ↑ 1.0 1 1

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

  • Filter: (featureid = 2)
  • Rows Removed by Filter: 50
7. 0.000 0.058 ↑ 2.0 1 1

Nested Loop (cost=4.74..39.98 rows=2 width=10) (actual time=0.052..0.058 rows=1 loops=1)

8. 0.004 0.055 ↑ 2.0 1 1

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

9. 0.009 0.048 ↑ 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.048 rows=1 loops=1)

  • Recheck Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Filter: _st_contains(polygongeo, '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=2
10. 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)
11. 0.003 0.003 ↑ 1.0 1 1

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

  • Index Cond: (id = ap.id)
12. 0.003 0.003 ↑ 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.003 rows=1 loops=1)

  • Index Cond: (id = a.cityid)
13. 0.003 0.003 ↑ 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.002..0.003 rows=1 loops=1)

  • Index Cond: (countryid = ct.countryid)
14. 0.007 0.007 ↑ 1.0 7 1

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

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

Initplan (forNested Loop)

16. 0.093 0.093 ↑ 1.0 1 1

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

17. 0.002 0.002 ↑ 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.002 rows=1 loops=1)

18. 0.001 0.001 ↑ 1.0 1 1

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

19. 0.001 0.001 ↑ 1.0 1 1

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

21. 0.000 0.000 ↑ 1.0 1 1

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

22. 0.000 0.000 ↑ 1.0 1 1

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

23. 0.001 0.001 ↑ 1.0 1 1

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

24. 0.000 0.000 ↑ 1.0 1 1

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

25. 1.006 13.263 ↓ 34.0 714 1

Nested Loop (cost=145.26..1,322.48 rows=21 width=167) (actual time=5.401..13.263 rows=714 loops=1)

  • Join Filter: (ca.restaurantid = brandrestaurant.restaurantid)
26. 0.957 10.829 ↓ 32.5 714 1

Nested Loop (cost=144.98..1,313.01 rows=22 width=169) (actual time=5.394..10.829 rows=714 loops=1)

  • Join Filter: (ca.restaurantid = r.id)
27. 0.547 7.730 ↓ 10.8 714 1

Hash Join (cost=144.70..1,257.66 rows=66 width=54) (actual time=5.380..7.730 rows=714 loops=1)

  • Hash Cond: (ca.restaurantid = sl.referenceid)
28. 1.843 2.190 ↓ 10.8 714 1

Bitmap Heap Scan on tgb_coveragepolygon ca (cost=10.42..1,123.04 rows=66 width=36) (actual time=0.373..2.190 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
29. 0.347 0.347 ↓ 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.347..0.347 rows=1,885 loops=1)

  • Index Cond: (polygongeo ~ '0101000020E6100000915F3FC406FF4740D7DCD1FF72553D40'::geometry)
30. 2.210 4.993 ↑ 1.0 6,913 1

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

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

Seq Scan on tlb_slug sl (cost=0.00..116.30 rows=6,913 width=18) (actual time=0.007..2.783 rows=6,913 loops=1)

  • Filter: ((NOT isdeleted) AND (typeid = 1) AND (brandtype = 1))
  • Rows Removed by Filter: 9
32. 2.142 2.142 ↑ 1.0 1 714

Index Scan using mwq_restaurant_pkey on mwq_restaurant r (cost=0.28..0.84 rows=1 width=115) (actual time=0.002..0.003 rows=1 loops=714)

  • Index Cond: (id = sl.referenceid)
  • Filter: ((NOT isdeleted) AND (NOT isdeleted) AND (status <> 3) AND (status <> 3))
33. 1.428 1.428 ↑ 1.0 1 714

Index Scan using tlb_restaurantbrand_resttid_idx on tlb_restaurant_brand brandrestaurant (cost=0.28..0.43 rows=1 width=10) (actual time=0.002..0.002 rows=1 loops=714)

  • Index Cond: (restaurantid = sl.referenceid)
  • Filter: (isactive AND (NOT isdeleted) AND (brandtype = 1))
34. 1.428 1.428 ↑ 1.0 1 714

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

  • Index Cond: (id = ca.branchid)
  • Filter: ((NOT isdeleted) AND (status <> 3))
  • Rows Removed by Filter: 0