explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8QXr

Settings
# exclusive inclusive rows x rows loops node
1. 0.184 11.018 ↑ 10.8 419 1

Unique (cost=9,318.46..9,352.42 rows=4,528 width=8) (actual time=10.772..11.018 rows=419 loops=1)

2. 1.345 10.834 ↑ 3.1 1,458 1

Sort (cost=9,318.46..9,329.78 rows=4,528 width=8) (actual time=10.772..10.834 rows=1,458 loops=1)

  • Sort Key: c1.city_iata, c2.city_iata
  • Sort Method: quicksort Memory: 117kB
3. 1.082 9.489 ↑ 3.1 1,458 1

Nested Loop (cost=1.85..9,043.50 rows=4,528 width=8) (actual time=0.054..9.489 rows=1,458 loops=1)

4. 0.707 3.331 ↑ 1.6 846 1

Nested Loop (cost=0.93..2,141.80 rows=1,380 width=8) (actual time=0.035..3.331 rows=846 loops=1)

5. 0.062 0.062 ↑ 1.0 427 1

Seq Scan on dirs (cost=0.00..6.27 rows=427 width=8) (actual time=0.009..0.062 rows=427 loops=1)

6. 0.427 2.562 ↑ 1.5 2 427

Bitmap Heap Scan on aircities c1 (cost=0.93..4.97 rows=3 width=8) (actual time=0.006..0.006 rows=2 loops=427)

  • Recheck Cond: ((dirs.fst = air_iata) OR (dirs.fst = city_iata))
  • Heap Blocks: exact=540
7. 0.427 2.135 ↓ 0.0 0 427

BitmapOr (cost=0.93..0.93 rows=3 width=0) (actual time=0.005..0.005 rows=0 loops=427)

8. 0.854 0.854 ↑ 1.0 1 427

Bitmap Index Scan on aircities_air_iata_idx (cost=0.00..0.46 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=427)

  • Index Cond: (dirs.fst = air_iata)
9. 0.854 0.854 ↑ 1.0 2 427

Bitmap Index Scan on aircities_city_iata_idx (cost=0.00..0.47 rows=2 width=0) (actual time=0.002..0.002 rows=2 loops=427)

  • Index Cond: (dirs.fst = city_iata)
10. 0.846 5.076 ↑ 1.5 2 846

Bitmap Heap Scan on aircities c2 (cost=0.93..4.97 rows=3 width=8) (actual time=0.006..0.006 rows=2 loops=846)

  • Recheck Cond: ((dirs.snd = air_iata) OR (dirs.snd = city_iata))
  • Heap Blocks: exact=1008
11. 0.846 4.230 ↓ 0.0 0 846

BitmapOr (cost=0.93..0.93 rows=3 width=0) (actual time=0.005..0.005 rows=0 loops=846)

12. 1.692 1.692 ↑ 1.0 1 846

Bitmap Index Scan on aircities_air_iata_idx (cost=0.00..0.46 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=846)

  • Index Cond: (dirs.snd = air_iata)
13. 1.692 1.692 ↑ 1.0 2 846

Bitmap Index Scan on aircities_city_iata_idx (cost=0.00..0.47 rows=2 width=0) (actual time=0.002..0.002 rows=2 loops=846)

  • Index Cond: (dirs.snd = city_iata)
Planning time : 0.409 ms
Execution time : 11.068 ms