explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MosA

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

Nested Loop (cost=4,470.25..4,510.34 rows=1 width=91) (actual time=7.793..7.793 rows=0 loops=1)

2. 0.061 7.792 ↓ 0.0 0 1

Nested Loop (cost=4,418.72..4,450.79 rows=1 width=83) (actual time=7.792..7.792 rows=0 loops=1)

3. 5.142 7.727 ↑ 1.0 1 1

Nested Loop (cost=103.63..127.68 rows=1 width=75) (actual time=7.724..7.727 rows=1 loops=1)

4. 2.536 2.570 ↑ 1.0 1 1

Nested Loop (cost=52.10..68.13 rows=1 width=67) (actual time=2.568..2.570 rows=1 loops=1)

5. 0.018 0.018 ↑ 1.0 1 1

Index Scan using consignment_pkey on consignment (cost=0.57..8.59 rows=1 width=59) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (id = '670611219756876859'::bigint)
6. 0.000 0.016 ↑ 1.0 1 1

Index Scan using consignmentevent_pkey on consignmentevent pickup_awaited_event (cost=51.53..59.55 rows=1 width=16) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: (id = (SubPlan 1))
7.          

SubPlan (for Index Scan)

8. 0.002 2.530 ↑ 1.0 1 1

Limit (cost=0.70..50.96 rows=1 width=16) (actual time=2.528..2.530 rows=1 loops=1)

9. 2.528 2.528 ↑ 1.0 1 1

Index Scan Backward using consignmentevent_type_time_idx on consignmentevent (cost=0.70..50.96 rows=1 width=16) (actual time=2.527..2.528 rows=1 loops=1)

  • Index Cond: (type = 'pickup_awaited'::text)
  • Filter: ((consignment_id = consignment.id) AND (organisation_id = '1'::text))
  • Rows Removed by Filter: 2571
10. 0.000 0.015 ↑ 1.0 1 1

Index Scan using consignmentevent_pkey on consignmentevent pickup_scheduled_event (cost=51.53..59.55 rows=1 width=16) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (id = (SubPlan 2))
11.          

SubPlan (for Index Scan)

12. 0.003 5.128 ↑ 1.0 1 1

Limit (cost=0.70..50.96 rows=1 width=16) (actual time=5.127..5.128 rows=1 loops=1)

13. 5.125 5.125 ↑ 1.0 1 1

Index Scan Backward using consignmentevent_type_time_idx on consignmentevent consignmentevent_1 (cost=0.70..50.96 rows=1 width=16) (actual time=5.125..5.125 rows=1 loops=1)

  • Index Cond: (type = 'pickup_scheduled'::text)
  • Filter: ((consignment_id = consignment.id) AND (organisation_id = '1'::text))
  • Rows Removed by Filter: 8537
14. 0.000 0.004 ↓ 0.0 0 1

Index Scan using consignmentevent_pkey on consignmentevent pickup_completed_event (cost=4,315.09..4,323.11 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (id = (SubPlan 3))
15.          

SubPlan (for Index Scan)

16. 0.002 0.056 ↓ 0.0 0 1

Limit (cost=4,314.51..4,314.52 rows=1 width=16) (actual time=0.055..0.056 rows=0 loops=1)

17. 0.017 0.054 ↓ 0.0 0 1

Sort (cost=4,314.51..4,314.57 rows=24 width=16) (actual time=0.054..0.054 rows=0 loops=1)

  • Sort Key: consignmentevent_2.event_time DESC
  • Sort Method: quicksort Memory: 25kB
18. 0.037 0.037 ↓ 0.0 0 1

Index Scan using consignmentid_consignmentevent_index on consignmentevent consignmentevent_2 (cost=0.57..4,314.39 rows=24 width=16) (actual time=0.037..0.037 rows=0 loops=1)

  • Index Cond: (consignment_id = consignment.id)
  • Filter: ((type = 'pickup_completed'::text) AND (organisation_id = '1'::text))
  • Rows Removed by Filter: 21
19. 0.000 0.000 ↓ 0.0 0

Index Scan using consignmentevent_pkey on consignmentevent pickup_cancelled_event (cost=51.53..59.55 rows=1 width=16) (never executed)

  • Index Cond: (id = (SubPlan 4))
20.          

SubPlan (for Index Scan)

21. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.70..50.96 rows=1 width=16) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using consignmentevent_type_time_idx on consignmentevent consignmentevent_3 (cost=0.70..50.96 rows=1 width=16) (never executed)

  • Index Cond: (type = 'cancelled'::text)
  • Filter: ((consignment_id = consignment.id) AND (organisation_id = '1'::text))