explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6v6F

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

Limit (cost=2.11..152.12 rows=5 width=163) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=2.11..191,805.17 rows=6,393 width=163) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=1.27..160,954.63 rows=6,393 width=163) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Index Scan Backward using index_directions_on_popularity on directions (cost=0.43..160,857.83 rows=6,393 width=163) (actual rows= loops=)

  • Filter: ((from_id <> 3863) AND (domain_id = 1) AND (to_id = 4037))
5. 0.000 0.000 ↓ 0.0

Materialize (cost=0.84..16.89 rows=1 width=8) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..16.89 rows=1 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using cities_pkey on cities cities_1 (cost=0.42..8.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = 4037)
  • Filter: (NOT hide)
8. 0.000 0.000 ↓ 0.0

Index Only Scan using index_cities_service_configs_on_service_config_id_and_city_id on cities_service_configs cities_service_configs_1 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((service_config_id = 15) AND (city_id = 4037))
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..4.82 rows=1 width=12) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using cities_pkey on cities (cost=0.42..4.20 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = directions.from_id)
  • Filter: (NOT hide)
11. 0.000 0.000 ↓ 0.0

Index Only Scan using index_cities_service_configs_on_service_config_id_and_city_id on cities_service_configs (cost=0.42..0.60 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((service_config_id = 15) AND (city_id = cities.id))