explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Dy0P

Settings
# exclusive inclusive rows x rows loops node
1. 4.762 81.557 ↑ 2.3 8,247 1

Sort (cost=47,748.37..47,796.72 rows=19,340 width=58) (actual time=80.193..81.557 rows=8,247 loops=1)

  • Sort Key: resource_milestone_events.created_at
  • Sort Method: quicksort Memory: 1,029kB
  • Buffers: shared hit=47,898
2. 9.551 76.795 ↑ 2.3 8,247 1

HashAggregate (cost=46,178.03..46,371.43 rows=19,340 width=58) (actual time=73.427..76.795 rows=8,247 loops=1)

  • Group Key: ('milestone'::text), resource_milestone_events.created_at, resource_milestone_events.milestone_id, resource_milestone_events.action, resource_milestone_events.issue_id
  • Buffers: shared hit=47,898
3. 1.208 67.244 ↑ 2.3 8,247 1

Append (cost=4,278.50..45,936.28 rows=19,340 width=58) (actual time=6.743..67.244 rows=8,247 loops=1)

  • Buffers: shared hit=47,898
4. 3.045 30.694 ↑ 1.1 6,913 1

Nested Loop (cost=4,278.50..19,773.35 rows=7,841 width=58) (actual time=6.741..30.694 rows=6,913 loops=1)

  • Buffers: shared hit=20,137
5. 2.598 7.650 ↑ 1.6 2,857 1

HashAggregate (cost=4,278.07..4,323.90 rows=4,583 width=8) (actual time=6.696..7.650 rows=2,857 loops=1)

  • Group Key: resource_milestone_events_1.issue_id
  • Buffers: shared hit=4,652
6. 5.052 5.052 ↓ 1.0 4,651 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_1 (cost=0.43..4,266.60 rows=4,591 width=8) (actual time=0.023..5.052 rows=4,651 loops=1)

  • Index Cond: (resource_milestone_events_1.milestone_id = 1,233,752)
  • Filter: ((resource_milestone_events_1.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone) AND (resource_milestone_events_1.action = 1))
  • Rows Removed by Filter: 70
  • Buffers: shared hit=4,652
7. 19.999 19.999 ↑ 1.0 2 2,857

Index Scan using index_resource_milestone_events_on_issue_id on public.resource_milestone_events (cost=0.43..3.34 rows=2 width=26) (actual time=0.005..0.007 rows=2 loops=2,857)

  • Index Cond: (resource_milestone_events.issue_id = resource_milestone_events_1.issue_id)
  • Filter: (resource_milestone_events.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=15,485
8. 0.116 17.094 ↑ 14.9 356 1

Subquery Scan on *SELECT* 2 (cost=4,278.50..16,640.24 rows=5,299 width=58) (actual time=6.886..17.094 rows=356 loops=1)

  • Buffers: shared hit=13,599
9. 0.759 16.978 ↑ 14.9 356 1

Nested Loop (cost=4,278.50..16,574.00 rows=5,299 width=52) (actual time=6.883..16.978 rows=356 loops=1)

  • Buffers: shared hit=13,599
10. 2.498 7.648 ↑ 1.6 2,857 1

HashAggregate (cost=4,278.07..4,323.90 rows=4,583 width=8) (actual time=6.761..7.648 rows=2,857 loops=1)

  • Group Key: resource_milestone_events_2.issue_id
  • Buffers: shared hit=4,652
11. 5.150 5.150 ↓ 1.0 4,651 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_2 (cost=0.43..4,266.60 rows=4,591 width=8) (actual time=0.035..5.150 rows=4,651 loops=1)

  • Index Cond: (resource_milestone_events_2.milestone_id = 1,233,752)
  • Filter: ((resource_milestone_events_2.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone) AND (resource_milestone_events_2.action = 1))
  • Rows Removed by Filter: 70
  • Buffers: shared hit=4,652
12. 8.571 8.571 ↓ 0.0 0 2,857

Index Scan using index_resource_state_events_on_issue_id_and_created_at on public.resource_state_events (cost=0.42..2.65 rows=1 width=18) (actual time=0.003..0.003 rows=0 loops=2,857)

  • Index Cond: ((resource_state_events.issue_id = resource_milestone_events_2.issue_id) AND (resource_state_events.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone))
  • Buffers: shared hit=8,947
13. 0.568 18.248 ↑ 6.3 978 1

Subquery Scan on *SELECT* 3 (cost=4,278.49..9,347.58 rows=6,200 width=58) (actual time=6.817..18.248 rows=978 loops=1)

  • Buffers: shared hit=14,162
14. 1.430 17.680 ↑ 6.3 978 1

Nested Loop (cost=4,278.49..9,270.08 rows=6,200 width=54) (actual time=6.815..17.680 rows=978 loops=1)

  • Buffers: shared hit=14,162
15. 2.585 7.679 ↑ 1.6 2,857 1

HashAggregate (cost=4,278.07..4,323.90 rows=4,583 width=8) (actual time=6.782..7.679 rows=2,857 loops=1)

  • Group Key: resource_milestone_events_3.issue_id
  • Buffers: shared hit=4,652
16. 5.094 5.094 ↓ 1.0 4,651 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_3 (cost=0.43..4,266.60 rows=4,591 width=8) (actual time=0.040..5.094 rows=4,651 loops=1)

  • Index Cond: (resource_milestone_events_3.milestone_id = 1,233,752)
  • Filter: ((resource_milestone_events_3.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone) AND (resource_milestone_events_3.action = 1))
  • Rows Removed by Filter: 70
  • Buffers: shared hit=4,652
17. 8.571 8.571 ↓ 0.0 0 2,857

Index Scan using index_resource_weight_events_on_issue_id_and_created_at on public.resource_weight_events (cost=0.42..1.06 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=2,857)

  • Index Cond: ((resource_weight_events.issue_id = resource_milestone_events_3.issue_id) AND (resource_weight_events.created_at <= '2020-08-17 23:59:59.999999+00'::timestamp with time zone))
  • Buffers: shared hit=9,510