explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CvvM

Settings
# exclusive inclusive rows x rows loops node
1. 6.413 99.485 ↑ 2.4 8,593 1

Sort (cost=51,265.93..51,318.56 rows=21,051 width=58) (actual time=98.283..99.485 rows=8,593 loops=1)

  • Sort Key: resource_milestone_events.created_at
  • Sort Method: quicksort Memory: 1,056kB
  • Buffers: shared hit=44,034
2. 12.167 93.072 ↑ 2.4 8,593 1

HashAggregate (cost=49,543.79..49,754.30 rows=21,051 width=58) (actual time=88.646..93.072 rows=8,593 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=44,034
3. 1.706 80.905 ↑ 2.4 8,593 1

Append (cost=4,424.61..49,280.65 rows=21,051 width=58) (actual time=8.830..80.905 rows=8,593 loops=1)

  • Buffers: shared hit=44,034
4. 2.239 39.041 ↑ 1.2 7,087 1

Nested Loop (cost=4,424.61..21,100.46 rows=8,525 width=58) (actual time=8.828..39.041 rows=7,087 loops=1)

  • Buffers: shared hit=18,909
5. 3.409 10.063 ↑ 1.7 2,971 1

HashAggregate (cost=4,424.19..4,474.05 rows=4,986 width=8) (actual time=8.805..10.063 rows=2,971 loops=1)

  • Group Key: resource_milestone_events_1.issue_id
  • Buffers: shared hit=2,907
6. 6.654 6.654 ↓ 1.0 5,031 1

Index Scan using add_events on public.resource_milestone_events resource_milestone_events_1 (cost=0.43..4,411.70 rows=4,995 width=8) (actual time=0.028..6.654 rows=5,031 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)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=2,907
7. 26.739 26.739 ↑ 1.0 2 2,971

Index Scan using index_resource_milestone_events_on_issue_id on public.resource_milestone_events (cost=0.43..3.30 rows=2 width=26) (actual time=0.006..0.009 rows=2 loops=2,971)

  • 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=16,002
8. 0.188 16.816 ↑ 11.8 488 1

Subquery Scan on *SELECT* 2 (cost=4,424.61..18,239.78 rows=5,782 width=58) (actual time=6.293..16.816 rows=488 loops=1)

  • Buffers: shared hit=12,328
9. 0.695 16.628 ↑ 11.8 488 1

Nested Loop (cost=4,424.61..18,167.50 rows=5,782 width=52) (actual time=6.291..16.628 rows=488 loops=1)

  • Buffers: shared hit=12,328
10. 2.524 7.020 ↑ 1.7 2,971 1

HashAggregate (cost=4,424.19..4,474.05 rows=4,986 width=8) (actual time=6.261..7.020 rows=2,971 loops=1)

  • Group Key: resource_milestone_events_2.issue_id
  • Buffers: shared hit=2,907
11. 4.496 4.496 ↓ 1.0 5,031 1

Index Scan using add_events on public.resource_milestone_events resource_milestone_events_2 (cost=0.43..4,411.70 rows=4,995 width=8) (actual time=0.018..4.496 rows=5,031 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)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=2,907
12. 8.913 8.913 ↓ 0.0 0 2,971

Index Scan using index_resource_state_events_on_issue_id_and_created_at on public.resource_state_events (cost=0.43..2.73 rows=1 width=18) (actual time=0.003..0.003 rows=0 loops=2,971)

  • 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=9,421
13. 0.459 23.342 ↑ 6.6 1,018 1

Subquery Scan on *SELECT* 3 (cost=4,424.61..9,749.91 rows=6,744 width=58) (actual time=8.432..23.342 rows=1,018 loops=1)

  • Buffers: shared hit=12,797
14. 1.411 22.883 ↑ 6.6 1,018 1

Nested Loop (cost=4,424.61..9,665.61 rows=6,744 width=54) (actual time=8.429..22.883 rows=1,018 loops=1)

  • Buffers: shared hit=12,797
15. 3.476 9.588 ↑ 1.7 2,971 1

HashAggregate (cost=4,424.19..4,474.05 rows=4,986 width=8) (actual time=8.404..9.588 rows=2,971 loops=1)

  • Group Key: resource_milestone_events_3.issue_id
  • Buffers: shared hit=2,907
16. 6.112 6.112 ↓ 1.0 5,031 1

Index Scan using add_events on public.resource_milestone_events resource_milestone_events_3 (cost=0.43..4,411.70 rows=4,995 width=8) (actual time=0.024..6.112 rows=5,031 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)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=2,907
17. 11.884 11.884 ↓ 0.0 0 2,971

Index Scan using index_resource_weight_events_on_issue_id_and_created_at on public.resource_weight_events (cost=0.42..1.02 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=2,971)

  • 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,890