explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t7yT

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 170.285 ↓ 9.1 1,195 1

Finalize GroupAggregate (cost=12,621.90..12,638.65 rows=131 width=599) (actual time=164.886..170.285 rows=1,195 loops=1)

  • Group Key: account.id, assessments.assessment__c_id, question_topic__c.goal__c
2. 18.714 175.663 ↓ 25.5 2,803 1

Gather Merge (cost=12,621.90..12,635.97 rows=110 width=599) (actual time=164.871..175.663 rows=2,803 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.870 156.949 ↓ 17.0 934 3 / 3

Partial GroupAggregate (cost=11,621.87..11,623.25 rows=55 width=599) (actual time=155.815..156.949 rows=934 loops=3)

  • Group Key: account.id, assessments.assessment__c_id, question_topic__c.goal__c
4. 20.557 156.079 ↓ 55.9 3,074 3 / 3

Sort (cost=11,621.87..11,622.01 rows=55 width=585) (actual time=155.802..156.079 rows=3,074 loops=3)

  • Sort Key: account.id, assessments.assessment__c_id, question_topic__c.goal__c
  • Sort Method: quicksort Memory: 548kB
  • Worker 0: Sort Method: quicksort Memory: 510kB
  • Worker 1: Sort Method: quicksort Memory: 492kB
5. 5.896 135.522 ↓ 55.9 3,074 3 / 3

Parallel Hash Join (cost=2,574.86..11,620.28 rows=55 width=585) (actual time=33.396..135.522 rows=3,074 loops=3)

  • Hash Cond: (((question_topic__c.goal__c)::text = (goal_scoring__c.goal__c)::text) AND ((assessments.market)::text = (goal_scoring__c.market_type__c)::text) AND ((assessments.sector)::text = (goal_scoring__c.sector__c)::text) AND (assessments.size = (goal_scoring__c.size__c)::text))
6. 2.025 115.833 ↑ 1.1 3,081 3 / 3

Hash Join (cost=1,001.34..7,963.90 rows=3,414 width=585) (actual time=19.179..115.833 rows=3,081 loops=3)

  • Hash Cond: ((question_instance__c.question__c)::text = (question_topic__c.question__c)::text)
7. 0.813 106.973 ↑ 1.2 2,634 3 / 3

Nested Loop (cost=590.46..7,486.09 rows=3,280 width=604) (actual time=12.250..106.973 rows=2,634 loops=3)

8. 1.085 53.473 ↑ 1.2 2,634 3 / 3

Hash Join (cost=590.18..6,436.25 rows=3,280 width=585) (actual time=12.122..53.473 rows=2,634 loops=3)

  • Hash Cond: (companies.account_id = account.id)
9. 18.687 52.318 ↑ 1.2 2,634 3 / 3

Hash Join (cost=588.86..6,423.73 rows=3,280 width=69) (actual time=12.002..52.318 rows=2,634 loops=3)

  • Hash Cond: ((question_instance__c.sfid)::text = (responses.question_instance__c)::text)
10. 21.817 21.817 ↑ 1.3 80,430 3 / 3

Parallel Seq Scan on question_instance__c (cost=0.00..5,299.38 rows=100,538 width=38) (actual time=0.017..21.817 rows=80,430 loops=3)

  • Filter: ((goal_scoring__c)::text IS NOT NULL)
11. 4.075 11.814 ↓ 1.0 7,903 3 / 3

Hash (cost=490.45..490.45 rows=7,873 width=69) (actual time=11.814..11.814 rows=7,903 loops=3)

  • Buckets: 8,192 Batches: 1 Memory Usage: 647kB
12. 3.310 7.739 ↓ 1.0 7,903 3 / 3

Hash Join (cost=5.15..490.45 rows=7,873 width=69) (actual time=0.487..7.739 rows=7,903 loops=3)

  • Hash Cond: (responses.assessment_id = companies.active_assessment_id)
13. 4.255 4.255 ↑ 1.0 10,296 3 / 3

Seq Scan on responses (cost=0.00..367.96 rows=10,296 width=25) (actual time=0.297..4.255 rows=10,296 loops=3)

14. 0.021 0.174 ↑ 1.0 13 3 / 3

Hash (cost=4.99..4.99 rows=13 width=56) (actual time=0.174..0.174 rows=13 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.019 0.153 ↑ 1.0 13 3 / 3

Hash Join (cost=3.76..4.99 rows=13 width=56) (actual time=0.141..0.153 rows=13 loops=3)

  • Hash Cond: (companies.active_assessment_id = assessment__c.id)
16. 0.019 0.091 ↑ 1.0 13 3 / 3

Hash Join (cost=1.38..2.56 rows=13 width=52) (actual time=0.083..0.091 rows=13 loops=3)

  • Hash Cond: (companies.active_assessment_id = assessments.assessment__c_id)
17. 0.031 0.031 ↑ 1.0 13 3 / 3

Seq Scan on companies (cost=0.00..1.13 rows=13 width=8) (actual time=0.028..0.031 rows=13 loops=3)

18. 0.012 0.041 ↑ 1.0 17 3 / 3

Hash (cost=1.17..1.17 rows=17 width=44) (actual time=0.041..0.041 rows=17 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.029 0.029 ↑ 1.0 17 3 / 3

Seq Scan on assessments (cost=0.00..1.17 rows=17 width=44) (actual time=0.023..0.029 rows=17 loops=3)

20. 0.009 0.043 ↑ 1.0 17 3 / 3

Hash (cost=2.17..2.17 rows=17 width=4) (actual time=0.042..0.043 rows=17 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
21. 0.034 0.034 ↑ 1.0 17 3 / 3

Seq Scan on assessment__c (cost=0.00..2.17 rows=17 width=4) (actual time=0.024..0.034 rows=17 loops=3)

22. 0.011 0.070 ↑ 1.0 14 3 / 3

Hash (cost=1.14..1.14 rows=14 width=520) (actual time=0.070..0.070 rows=14 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
23. 0.059 0.059 ↑ 1.0 14 3 / 3

Seq Scan on account (cost=0.00..1.14 rows=14 width=520) (actual time=0.055..0.059 rows=14 loops=3)

24. 52.687 52.687 ↑ 1.0 1 7,903 / 3

Index Only Scan using question__c_idx_sfid on question__c (cost=0.29..0.32 rows=1 width=19) (actual time=0.020..0.020 rows=1 loops=7,903)

  • Index Cond: (sfid = (question_instance__c.question__c)::text)
  • Heap Fetches: 7,903
25. 3.545 6.835 ↑ 1.0 9,950 3 / 3

Hash (cost=286.50..286.50 rows=9,950 width=38) (actual time=6.835..6.835 rows=9,950 loops=3)

  • Buckets: 16,384 Batches: 1 Memory Usage: 809kB
26. 3.290 3.290 ↑ 1.0 9,950 3 / 3

Seq Scan on question_topic__c (cost=0.00..286.50 rows=9,950 width=38) (actual time=0.089..3.290 rows=9,950 loops=3)

27. 7.267 13.793 ↑ 1.8 9,435 3 / 3

Parallel Hash (cost=1,240.51..1,240.51 rows=16,651 width=53) (actual time=13.792..13.793 rows=9,435 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,752kB
28. 6.526 6.526 ↑ 1.8 9,435 3 / 3

Parallel Seq Scan on goal_scoring__c (cost=0.00..1,240.51 rows=16,651 width=53) (actual time=0.011..6.526 rows=9,435 loops=3)

Planning time : 11.386 ms
Execution time : 177.201 ms