explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RX6b

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 3.851 ↓ 0.0 0 1

GroupAggregate (cost=4,330.45..4,334.60 rows=1 width=440) (actual time=3.851..3.851 rows=0 loops=1)

  • Group Key: consignment_data.organisation_id, consignment_data.event_date, consignment_data.hub_id, consignment_data.customer_id
2.          

CTE consignment_data

3. 0.001 3.842 ↓ 0.0 0 1

GroupAggregate (cost=4,330.18..4,330.42 rows=1 width=112) (actual time=3.842..3.842 rows=0 loops=1)

  • Group Key: (COALESCE(consignment.booking_hub_id, consignment.hub_id)), consignment.id
4. 0.002 3.841 ↓ 0.0 0 1

Sort (cost=4,330.18..4,330.19 rows=4 width=42) (actual time=3.841..3.841 rows=0 loops=1)

  • Sort Key: (COALESCE(consignment.booking_hub_id, consignment.hub_id)), consignment.id
  • Sort Method: quicksort Memory: 25kB
5. 0.001 3.839 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.14..4,330.14 rows=4 width=42) (actual time=3.839..3.839 rows=0 loops=1)

6. 3.838 3.838 ↓ 0.0 0 1

Index Scan using consignment_type_organisation_id_idx on consignment (cost=0.57..6.34 rows=1 width=32) (actual time=3.838..3.838 rows=0 loops=1)

  • Index Cond: ((organisation_id = '1'::text) AND (consignment_type = 'reverse'::text))
  • Filter: ((created_at >= '2019-01-10 00:00:00+00'::timestamp with time zone) AND (created_at < '2019-01-11 00:00:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 3,051
7. 0.000 0.000 ↓ 0.0 0

Index Scan using consignmentid_consignmentevent_index on consignmentevent (cost=0.57..4,312.66 rows=1,114 width=26) (never executed)

  • Index Cond: (consignment.id = consignment_id)
8. 0.007 3.850 ↓ 0.0 0 1

Sort (cost=0.03..0.04 rows=1 width=112) (actual time=3.850..3.850 rows=0 loops=1)

  • Sort Key: consignment_data.organisation_id, consignment_data.event_date, consignment_data.hub_id, consignment_data.customer_id
  • Sort Method: quicksort Memory: 25kB
9. 3.843 3.843 ↓ 0.0 0 1

CTE Scan on consignment_data (cost=0.00..0.02 rows=1 width=112) (actual time=3.843..3.843 rows=0 loops=1)