explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B8xQ

Settings

Optimization(s) for this plan:

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

Nested Loop Semi Join (cost=67.26..159.31 rows=1 width=32) (actual time=1.299..1.543 rows=1 loops=1)

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

Initplan (forNested Loop Semi Join)

3. 0.078 0.443 ↑ 1.0 1 1

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

4. 0.168 0.365 ↓ 4.0 4 1

Hash Join (cost=0.05..21.21 rows=1 width=0) (actual time=0.224..0.365 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.082 0.082 ↑ 200.0 4 1

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

6. 0.059 0.115 ↑ 1.0 2 1

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

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

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

8. 0.070 0.219 ↑ 1.0 1 1

Limit (cost=23.01..23.02 rows=1 width=24) (actual time=0.148..0.219 rows=1 loops=1)

9. 0.069 0.149 ↑ 1.0 1 1

Sort (cost=23.01..23.02 rows=1 width=24) (actual time=0.127..0.149 rows=1 loops=1)

  • Sort Key: pb.price
  • Sort Method: top-N heapsort Memory: 25kB
10. 0.080 0.080 ↓ 3.0 3 1

Seq Scan on price_bands pb (cost=0.00..23.00 rows=1 width=24) (actual time=0.027..0.080 rows=3 loops=1)

  • Filter: ((NOT is_deleted) AND (price >= '30'::numeric) AND (pricing_band_group_name = 'high'::text) AND ((price_currency)::text = 'EUR'::text) AND (count = 1))
  • Rows Removed by Filter: 4
11. 0.073 0.200 ↑ 1.0 1 1

Limit (cost=23.01..23.02 rows=1 width=24) (actual time=0.128..0.200 rows=1 loops=1)

12. 0.048 0.127 ↑ 1.0 1 1

Sort (cost=23.01..23.02 rows=1 width=24) (actual time=0.107..0.127 rows=1 loops=1)

  • Sort Key: pb_1.price
  • Sort Method: top-N heapsort Memory: 25kB
13. 0.079 0.079 ↓ 3.0 3 1

Seq Scan on price_bands pb_1 (cost=0.00..23.00 rows=1 width=24) (actual time=0.016..0.079 rows=3 loops=1)

  • Filter: ((NOT is_deleted) AND (price >= '15'::numeric) AND (pricing_band_group_name = 'low'::text) AND ((price_currency)::text = 'EUR'::text) AND (count = 1))
  • Rows Removed by Filter: 4
14. 0.176 1.192 ↑ 1.0 1 1

Nested Loop Semi Join (cost=0.00..56.35 rows=1 width=40) (actual time=0.971..1.192 rows=1 loops=1)

  • Join Filter: (tcom.id = travel_cancellation_option_mapping_to_price_band.mapping_id)
  • Rows Removed by Join Filter: 7
15. 0.540 0.540 ↓ 4.0 4 1

Seq Scan on travel_cancellation_option_mapping tcom (cost=0.00..20.65 rows=1 width=36) (actual time=0.482..0.540 rows=4 loops=1)

  • Filter: ((NOT is_deleted) AND (fare_class = 'SuperValue'::text) AND (special_airport = $0))
  • Rows Removed by Filter: 4
16. 0.187 0.476 ↑ 5.0 2 4

Materialize (cost=0.00..35.55 rows=10 width=4) (actual time=0.085..0.119 rows=2 loops=4)

17. 0.289 0.289 ↑ 5.0 2 1

Seq Scan on travel_cancellation_option_mapping_to_price_band (cost=0.00..35.50 rows=10 width=4) (actual time=0.257..0.289 rows=2 loops=1)

  • Filter: (price_band_id = $1)
  • Rows Removed by Filter: 12
18. 0.056 0.297 ↑ 5.0 2 1

Materialize (cost=0.00..35.55 rows=10 width=4) (actual time=0.256..0.297 rows=2 loops=1)

19. 0.241 0.241 ↑ 5.0 2 1

Seq Scan on travel_cancellation_option_mapping_to_price_band travel_cancellation_option_mapping_to_price_band_1 (cost=0.00..35.50 rows=10 width=4) (actual time=0.221..0.241 rows=2 loops=1)

  • Filter: (price_band_id = $2)
  • Rows Removed by Filter: 10
Planning time : 2.976 ms
Execution time : 2.177 ms