explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Aev : Optimization for: plan #6LA

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.020 107.730 ↑ 4.0 1 1

Sort (cost=2,984.99..2,985.00 rows=4 width=291) (actual time=107.730..107.730 rows=1 loops=1)

  • Sort Key: component.delivery_date
  • Sort Method: quicksort Memory: 25kB
2. 0.005 107.710 ↑ 4.0 1 1

Nested Loop (cost=1.71..2,984.95 rows=4 width=291) (actual time=41.369..107.710 rows=1 loops=1)

3. 0.003 107.675 ↑ 4.0 1 1

Nested Loop (cost=1.28..2,970.78 rows=4 width=219) (actual time=41.336..107.675 rows=1 loops=1)

4. 0.003 106.840 ↑ 5.0 1 1

Nested Loop (cost=0.85..2,957.77 rows=5 width=223) (actual time=40.502..106.840 rows=1 loops=1)

5. 0.097 105.858 ↑ 23.0 1 1

Nested Loop (cost=0.43..2,894.56 rows=23 width=219) (actual time=39.521..105.858 rows=1 loops=1)

6. 0.385 0.385 ↓ 1.1 356 1

Seq Scan on booking (cost=0.00..61.80 rows=335 width=8) (actual time=0.008..0.385 rows=356 loops=1)

  • Filter: (active AND ((status)::text = 'confirmed'::text))
  • Rows Removed by Filter: 216
7. 105.376 105.376 ↓ 0.0 0 356

Index Scan using component_enquiry_id_idx on component (cost=0.43..8.45 rows=1 width=211) (actual time=0.295..0.296 rows=0 loops=356)

  • Index Cond: (enquiry_id = booking.enquiry_id)
  • Filter: (active AND ((status IS NULL) OR (status = 'unallocated'::component_status)) AND (allocation_type = 'manual'::allocation_type) AND (component_type = 'job'::component_entity_type) AND (pm_id = ANY ('{308,301,176,184,135,12,76,93,109,162,319,366,339,187,58,84,91,334,186,605,477,514,258,558,311,905,338,209,219,44,214,136,130}'::integer[])))
  • Rows Removed by Filter: 1
8. 0.979 0.979 ↑ 1.0 1 1

Index Scan using orders_component_id_index on orders (cost=0.43..2.74 rows=1 width=4) (actual time=0.978..0.979 rows=1 loops=1)

  • Index Cond: (component_id = component.id)
  • Filter: (active AND (sent_to_client_date IS NULL) AND (status = 'quote-accepted'::order_status))
9. 0.832 0.832 ↑ 1.0 1 1

Index Scan using enquiry_pkey on enquiry (cost=0.43..2.60 rows=1 width=8) (actual time=0.832..0.832 rows=1 loops=1)

  • Index Cond: (id = component.enquiry_id)
  • Filter: active
10. 0.030 0.030 ↑ 1.0 1 1

Index Scan using component_component_id_idx on component_extended (cost=0.43..3.52 rows=1 width=157) (actual time=0.029..0.030 rows=1 loops=1)

  • Index Cond: (component_id = orders.component_id)
  • Filter: active