explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yxht : Optimization for: plan #B8xQ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.281 ↑ 1.0 1 1

Nested Loop Semi Join (cost=43.53..73.74 rows=1 width=32) (actual time=0.278..0.281 rows=1 loops=1)

  • Join Filter: (tcom.id = pb_1.mapping_id)
  • Rows Removed by Join Filter: 1
2.          

Initplan (forNested Loop Semi Join)

3. 0.004 0.120 ↑ 1.0 1 1

Aggregate (cost=21.21..21.23 rows=1 width=1) (actual time=0.120..0.120 rows=1 loops=1)

4. 0.030 0.116 ↓ 4.0 4 1

Hash Join (cost=0.05..21.21 rows=1 width=0) (actual time=0.111..0.116 rows=4 loops=1)

  • Hash Cond: (sa.code = "*VALUES*".column1)
  • Join Filter: ((sa.start_day <= "*VALUES*".column2) AND (sa.start_month <= "*VALUES*".column3) AND (sa.end_day >= "*VALUES*".column2) AND (sa.end_month >= "*VALUES*".column3))
5. 0.076 0.076 ↑ 200.0 4 1

Seq Scan on special_airports sa (cost=0.00..18.00 rows=800 width=48) (actual time=0.075..0.076 rows=4 loops=1)

6. 0.005 0.010 ↑ 1.0 2 1

Hash (cost=0.03..0.03 rows=2 width=40) (actual time=0.010..0.010 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.005 0.005 ↑ 1.0 2 1

Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=40) (actual time=0.004..0.005 rows=2 loops=1)

8. 0.004 0.187 ↑ 1.0 1 1

Nested Loop (cost=22.30..30.34 rows=1 width=40) (actual time=0.184..0.187 rows=1 loops=1)

9. 0.008 0.043 ↓ 2.0 2 1

HashAggregate (cost=22.15..22.16 rows=1 width=4) (actual time=0.042..0.043 rows=2 loops=1)

  • Group Key: pb.mapping_id
10. 0.035 0.035 ↓ 2.0 2 1

Seq Scan on price_bands pb (cost=0.00..22.15 rows=1 width=4) (actual time=0.027..0.035 rows=2 loops=1)

  • Filter: ((NOT is_deleted) AND (price_start < '30'::numeric) AND (price_end >= '30'::numeric) AND (pricing_band_group_name = 'high'::text) AND ((price_currency)::text = 'EUR'::text) AND (count = 1))
  • Rows Removed by Filter: 12
11. 0.140 0.140 ↓ 0.0 0 2

Index Scan using travel_cancellation_option_mapping_pkey on travel_cancellation_option_mapping tcom (cost=0.15..8.17 rows=1 width=36) (actual time=0.069..0.070 rows=0 loops=2)

  • Index Cond: (id = pb.mapping_id)
  • Filter: ((NOT is_deleted) AND (fare_class = 'SuperValue'::text) AND (special_airport = $0))
  • Rows Removed by Filter: 0
12. 0.008 0.090 ↓ 2.0 2 1

Materialize (cost=0.00..22.15 rows=1 width=4) (actual time=0.017..0.090 rows=2 loops=1)

13. 0.082 0.082 ↓ 2.0 2 1

Seq Scan on price_bands pb_1 (cost=0.00..22.15 rows=1 width=4) (actual time=0.014..0.082 rows=2 loops=1)

  • Filter: ((NOT is_deleted) AND (price_start < '15'::numeric) AND (price_end >= '15'::numeric) AND ((price_currency)::text = 'EUR'::text) AND (count = 1) AND (pricing_band_group_name = 'low'::text))
  • Rows Removed by Filter: 10
Planning time : 1.155 ms
Execution time : 0.677 ms