explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cHRS

Settings
# exclusive inclusive rows x rows loops node
1. 1.314 101.114 ↑ 3.0 9,165 1

Limit (cost=57,264.11..57,333.92 rows=27,924 width=58) (actual time=98.724..101.114 rows=9,165 loops=1)

  • Buffers: shared hit=54,500
2. 5.503 99.800 ↑ 3.0 9,165 1

Sort (cost=57,264.11..57,333.92 rows=27,924 width=58) (actual time=98.722..99.800 rows=9,165 loops=1)

  • Sort Key: resource_milestone_events.created_at
  • Sort Method: quicksort Memory: 1,101kB
  • Buffers: shared hit=54,500
3. 11.370 94.297 ↑ 3.0 9,165 1

HashAggregate (cost=54,922.80..55,202.04 rows=27,924 width=58) (actual time=90.359..94.297 rows=9,165 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=54,500
4. 1.493 82.927 ↑ 3.0 9,165 1

Append (cost=4,911.39..54,573.75 rows=27,924 width=58) (actual time=9.296..82.927 rows=9,165 loops=1)

  • Buffers: shared hit=54,500
5. 3.284 35.529 ↑ 1.9 7,367 1

Nested Loop (cost=4,911.39..22,896.75 rows=14,071 width=58) (actual time=9.295..35.529 rows=7,367 loops=1)

  • Buffers: shared hit=22,485
6. 3.177 10.370 ↑ 1.7 3,125 1

HashAggregate (cost=4,910.96..4,965.57 rows=5,461 width=8) (actual time=9.269..10.370 rows=3,125 loops=1)

  • Group Key: resource_milestone_events_1.issue_id
  • Buffers: shared hit=5,744
7. 7.193 7.193 ↓ 1.1 5,764 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_1 (cost=0.43..4,897.28 rows=5,472 width=8) (actual time=0.021..7.193 rows=5,764 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: 90
  • Buffers: shared hit=5,744
8. 21.875 21.875 ↑ 1.0 2 3,125

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

  • 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,741
9. 0.296 22.826 ↑ 8.6 746 1

Subquery Scan on *SELECT* 2 (cost=4,911.39..20,788.12 rows=6,451 width=58) (actual time=8.776..22.826 rows=746 loops=1)

  • Buffers: shared hit=15,889
10. 0.214 22.530 ↑ 8.6 746 1

Nested Loop (cost=4,911.39..20,707.48 rows=6,451 width=52) (actual time=8.773..22.530 rows=746 loops=1)

  • Buffers: shared hit=15,889
11. 3.127 9.816 ↑ 1.7 3,125 1

HashAggregate (cost=4,910.96..4,965.57 rows=5,461 width=8) (actual time=8.714..9.816 rows=3,125 loops=1)

  • Group Key: resource_milestone_events_2.issue_id
  • Buffers: shared hit=5,744
12. 6.689 6.689 ↓ 1.1 5,764 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_2 (cost=0.43..4,897.28 rows=5,472 width=8) (actual time=0.024..6.689 rows=5,764 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: 90
  • Buffers: shared hit=5,744
13. 12.500 12.500 ↓ 0.0 0 3,125

Index Scan using index_resource_state_events_on_issue_id_and_created_at on public.resource_state_events (cost=0.43..2.87 rows=1 width=18) (actual time=0.003..0.004 rows=0 loops=3,125)

  • 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=10,145
14. 0.346 23.079 ↑ 7.0 1,052 1

Subquery Scan on *SELECT* 3 (cost=4,911.38..10,608.55 rows=7,402 width=58) (actual time=12.265..23.079 rows=1,052 loops=1)

  • Buffers: shared hit=16,126
15. 0.278 22.733 ↑ 7.0 1,052 1

Nested Loop (cost=4,911.38..10,516.02 rows=7,402 width=54) (actual time=12.263..22.733 rows=1,052 loops=1)

  • Buffers: shared hit=16,126
16. 3.660 13.080 ↑ 1.7 3,125 1

HashAggregate (cost=4,910.96..4,965.57 rows=5,461 width=8) (actual time=12.214..13.080 rows=3,125 loops=1)

  • Group Key: resource_milestone_events_3.issue_id
  • Buffers: shared hit=5,744
17. 9.420 9.420 ↓ 1.1 5,764 1

Index Scan using index_resource_milestone_events_on_milestone_id on public.resource_milestone_events resource_milestone_events_3 (cost=0.43..4,897.28 rows=5,472 width=8) (actual time=0.041..9.420 rows=5,764 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: 90
  • Buffers: shared hit=5,744
18. 9.375 9.375 ↓ 0.0 0 3,125

Index Scan using index_resource_weight_events_on_issue_id_and_created_at on public.resource_weight_events (cost=0.42..1.01 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=3,125)

  • 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=10,382