explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cgEJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=70,449,318.29..70,478,077.32 rows=1,278,179 width=97) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=70,449,318.29..70,452,513.74 rows=1,278,179 width=97) (actual rows= loops=)

  • Sort Key: prod_pois.cartodb_id, (st_distance(prod_pois.the_geom_webmercator, dev_adverts.the_geom_webmercator)), prod_pois.name, (st_x(prod_pois.the_geom)), (st_y(prod_pois.the_geom)), prod_pois.group_id, dev_adverts.cartodb_id, dev_adverts.the_geom_webmercator
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=54.55..70,249,772.78 rows=1,278,179 width=97) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Seq Scan on prod_pois (cost=0.00..59,667.79 rows=1,278,179 width=97) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Limit (cost=54.55..54.89 rows=1 width=56) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Result (cost=54.55..54.89 rows=1 width=56) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Sort (cost=54.55..54.56 rows=1 width=48) (actual rows= loops=)

  • Sort Key: (st_distance(prod_pois.the_geom_webmercator, dev_adverts.the_geom_webmercator))
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.65..54.54 rows=1 width=48) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on dev_adverts (cost=4.36..45.87 rows=1 width=48) (actual rows= loops=)

  • Recheck Cond: (the_geom_webmercator && st_expand(prod_pois.the_geom_webmercator, '40'::double precision))
  • Filter: ((prod_pois.the_geom_webmercator && st_expand(the_geom_webmercator, '40'::double precision)) AND _st_dwithin(prod_pois.the_geom_webmercator, the_geom_webmercator, '40'::double precision))
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on dev_adverts_the_geom_webmercator_idx (cost=0.00..4.36 rows=8 width=0) (actual rows= loops=)

  • Index Cond: (the_geom_webmercator && st_expand(prod_pois.the_geom_webmercator, '40'::double precision))
11. 0.000 0.000 ↓ 0.0

Index Scan using dev_postal_codes_pkey on dev_postal_codes pc (cost=0.29..8.30 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (cartodb_id = dev_adverts.postal_code_id)
  • Filter: (city_id && '{madrid}'::character varying[])