explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3nVL : plan

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 423.395 ↓ 5.0 5 1

Limit (cost=37.08..37.09 rows=1 width=143) (actual time=423.392..423.395 rows=5 loops=1)

  • Buffers: shared hit=111773 read=26061 written=7735
2. 2.140 423.392 ↓ 5.0 5 1

Sort (cost=37.08..37.09 rows=1 width=143) (actual time=423.391..423.392 rows=5 loops=1)

  • Sort Key: directions.popularity DESC
  • Sort Method: top-N heapsort Memory: 26kB
  • Buffers: shared hit=111773 read=26061 written=7735
3. 0.000 421.252 ↓ 3,666.0 3,666 1

Nested Loop (cost=2.11..37.07 rows=1 width=143) (actual time=0.219..421.252 rows=3,666 loops=1)

  • Buffers: shared hit=111770 read=26061 written=7735
4. 5.710 331.629 ↓ 6,921.0 6,921 1

Nested Loop (cost=1.27..28.01 rows=1 width=143) (actual time=0.159..331.629 rows=6,921 loops=1)

  • Buffers: shared hit=65650 read=20162 written=5784
5. 305.156 305.156 ↓ 6,921.0 6,921 1

Index Scan using index_directions_on_domain_id on directions directions (cost=0.43..11.11 rows=1 width=143) (actual time=0.08..305.156 rows=6,921 loops=1)

  • Index Cond: (directions.domain_id = 1)
  • Filter: ((directions.from_id <> 3863) AND (directions.to_id = 4037))
  • Buffers: shared hit=10279 read=20162 written=5784
6. 0.000 20.763 ↑ 1.0 1 6,921

Nested Loop (cost=0.84..16.89 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=6,921)

  • Buffers: shared hit=55371
7. 13.842 13.842 ↑ 1.0 1 6,921

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

  • Index Cond: (cities_1.id = 4037)
  • Filter: (NOT cities_1.hide)
  • Buffers: shared hit=27687
8. 13.842 13.842 ↑ 1.0 1 6,921

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 time=0.002..0.002 rows=1 loops=6,921)

  • Index Cond: ((cities_service_configs_1.service_config_id = 15) AND (cities_service_configs_1.city_id = 4037))
  • Buffers: shared hit=27684
9. 7.007 89.973 ↑ 1.0 1 6,921

Nested Loop (cost=0.84..9.05 rows=1 width=12) (actual time=0.013..0.013 rows=1 loops=6,921)

  • Buffers: shared hit=46120 read=5899 written=1951
10. 69.210 69.210 ↑ 1.0 1 6,921

Index Scan using cities_pkey on cities cities (cost=0.42..8.44 rows=1 width=8) (actual time=0.01..0.01 rows=1 loops=6,921)

  • Index Cond: (cities.id = directions.from_id)
  • Filter: (NOT cities.hide)
  • Buffers: shared hit=21865 read=5842 written=1922
11. 13.756 13.756 ↑ 1.0 1 6,878

Index Only Scan using index_cities_service_configs_on_service_config_id_and_city_id on cities_service_configs cities_service_configs (cost=0.42..0.6 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=6,878)

  • Index Cond: ((cities_service_configs.service_config_id = 15) AND (cities_service_configs.city_id = cities.id))
  • Buffers: shared hit=24255 read=57 written=29