explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CILb : With index on cancelled_at and confirmed_at

Settings
# exclusive inclusive rows x rows loops node
1. 0.037 0.780 ↓ 8.0 8 1

Nested Loop Semi Join (cost=18.12..48.36 rows=1 width=1,730) (actual time=0.476..0.780 rows=8 loops=1)

2. 0.043 0.145 ↓ 46.0 46 1

Bitmap Heap Scan on booking_requests (cost=16.56..20.58 rows=1 width=1,730) (actual time=0.110..0.145 rows=46 loops=1)

  • Recheck Cond: ((training_id = 724,736) AND (domain_id = 43))
  • Filter: ((created_at > '2016-01-01 00:00:00'::timestamp without time zone) AND (id <> 177016))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=36
3. 0.004 0.102 ↓ 0.0 0 1

BitmapAnd (cost=16.56..16.56 rows=1 width=0) (actual time=0.102..0.102 rows=0 loops=1)

4. 0.010 0.010 ↓ 5.9 47 1

Bitmap Index Scan on index_booking_requests_on_training_id (cost=0.00..4.48 rows=8 width=0) (actual time=0.010..0.010 rows=47 loops=1)

  • Index Cond: (training_id = 724,736)
5. 0.088 0.088 ↓ 1.2 531 1

Bitmap Index Scan on index_booking_requests_on_domain_id (cost=0.00..11.83 rows=455 width=0) (actual time=0.088..0.088 rows=531 loops=1)

  • Index Cond: (domain_id = 43)
6. 0.008 0.598 ↓ 0.0 0 46

Nested Loop Left Join (cost=1.56..27.77 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=46)

  • Filter: (booking_request_invoice_appliances.id IS NULL)
  • Rows Removed by Filter: 1
7. 0.044 0.460 ↑ 1.0 1 46

Nested Loop Left Join (cost=1.27..27.42 rows=1 width=16) (actual time=0.008..0.010 rows=1 loops=46)

8. 0.056 0.276 ↑ 1.0 1 46

Nested Loop (cost=0.85..14.97 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=46)

9. 0.138 0.138 ↑ 1.0 1 46

Index Scan using index_conversions_on_booking_request_id on conversions (cost=0.43..8.45 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=46)

  • Index Cond: (booking_request_id = booking_requests.id)
  • Filter: (domain_id = 43)
10. 0.082 0.082 ↑ 1.0 1 41

Index Scan using booking_requests_pkey on booking_requests booking_requests_1 (cost=0.42..4.78 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=41)

  • Index Cond: (id = conversions.booking_request_id)
  • Filter: ((cancelled_at IS NULL) AND (confirmed_at IS NOT NULL) AND (training_id = 724,736) AND (domain_id = ANY ('{10,18,43,14,48,101,103,104,105,109,115,138,149,237,150,195,209,211,215,223,222,225,227,229,233,234,235,236,238,240,242,245,246,248,249,250,253,254,255,261}'::integer[])))
  • Rows Removed by Filter: 0
11. 0.140 0.140 ↑ 1.0 2 35

Index Scan using index_price_details_on_booking_request_id on booking_request_price_details (cost=0.42..12.42 rows=2 width=16) (actual time=0.003..0.004 rows=2 loops=35)

  • Index Cond: (booking_request_id = booking_requests_1.id)
  • Filter: ((deleted_at IS NULL) AND (type IS NULL))
  • Rows Removed by Filter: 1
12. 0.130 0.130 ↑ 1.0 1 65

Index Scan using booking_request_invoices_price_detail_idy on booking_request_invoice_appliances (cost=0.29..0.34 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=65)

  • Index Cond: (booking_request_price_detail_id = booking_request_price_details.id)
  • Filter: active
  • Rows Removed by Filter: 1
Planning time : 4.099 ms
Execution time : 0.855 ms