explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ihYS

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 9,141.632 ↑ 1.0 1 1

Group (cost=1,733,591.08..1,733,591.09 rows=1 width=745) (actual time=9,141.628..9,141.632 rows=1 loops=1)

  • Group Key: assessment_bank_elements."order", assessment_bank_elements.bank_uuid, assessment_bank_elements.bank_version
2. 0.020 9,141.619 ↓ 2.0 2 1

Sort (cost=1,733,591.08..1,733,591.08 rows=1 width=745) (actual time=9,141.618..9,141.619 rows=2 loops=1)

  • Sort Key: assessment_bank_elements."order
  • Sort Method: quicksort Memory: 25kB
3. 0.202 9,141.599 ↓ 2.0 2 1

Hash Join (cost=1,176,342.99..1,733,591.07 rows=1 width=745) (actual time=8,762.300..9,141.599 rows=2 loops=1)

  • Hash Cond: ((COALESCE("bankAssessmentElements:formsForSearch:directSectionElements".item_uuid, "bankAssessmentElements:formsForSearch:linkedItems".item_uuid, "bankAssessmentElements:formsForSearch:pooledItems".item_uuid) = "bankAssessmentElements:formsForSearch:items".item_uuid) AND (COALESCE("bankAssessmentElements:formsForSearch:directSectionElements".item_version, "bankAssessmentElements:formsForSearch:linkedItems".item_version, "bankAssessmentElements:formsForSearch:pooledItems".item_version) = "bankAssessmentElements:formsForSearch:items".item_version))
4. 0.118 9,140.881 ↑ 92.5 534 1

Hash Left Join (cost=1,130,738.12..1,687,615.84 rows=49,380 width=805) (actual time=8,760.164..9,140.881 rows=534 loops=1)

  • Hash Cond: (("bankAssessmentElements:formsForSearch:directSectionElements".item_pool_uuid = "bankAssessmentElements:formsForSearch:pooledItems".item_pool_uuid) AND ("bankAssessmentElements:formsForSearch:directSectionElements".item_pool_version = "bankAssessmentElements:formsForSearch:pooledItems".item_pool_version))
5. 379.491 9,140.760 ↑ 92.5 534 1

Hash Left Join (cost=1,130,727.12..1,687,234.48 rows=49,380 width=805) (actual time=8,760.136..9,140.760 rows=534 loops=1)

  • Hash Cond: (("bankAssessmentElements:formsForSearch:directSectionElements".subsection_uuid = "bankAssessmentElements:formsForSearch:linkedItems".section_uuid) AND ("bankAssessmentElements:formsForSearch:directSectionElements".subsection_version = "bankAssessmentElements:formsForSearch:linkedItems".section_version))
6. 0.117 1.443 ↑ 92.5 534 1

Nested Loop Left Join (cost=2.27..16,598.17 rows=49,380 width=805) (actual time=0.039..1.443 rows=534 loops=1)

7. 0.030 0.030 ↑ 1.9 48 1

Index Scan using assessment_bank_elements_pkey on assessment_bank_elements (cost=0.43..362.21 rows=89 width=745) (actual time=0.011..0.030 rows=48 loops=1)

  • Index Cond: ((bank_uuid = 'f94e4a6d-ad31-4610-991f-f7e02ed7bfd6'::uuid) AND (bank_version = 1))
  • Filter: (NOT is_deleted)
8. 0.084 1.296 ↑ 42.5 11 48

Nested Loop Left Join (cost=1.84..177.75 rows=468 width=80) (actual time=0.019..0.027 rows=11 loops=48)

9. 0.048 0.672 ↑ 2.0 1 48

Nested Loop Left Join (cost=1.28..11.73 rows=2 width=40) (actual time=0.014..0.014 rows=1 loops=48)

10. 0.000 0.432 ↑ 1.0 1 48

Nested Loop Left Join (cost=0.85..9.74 rows=1 width=40) (actual time=0.009..0.009 rows=1 loops=48)

11. 0.240 0.240 ↑ 1.0 1 48

Index Scan using assessments_pkey on assessments "bankAssessmentElements" (cost=0.42..8.45 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=48)

  • Index Cond: ((assessment_uuid = assessment_bank_elements.assessment_uuid) AND (assessment_version = assessment_bank_elements.assessment_version))
12. 0.192 0.192 ↑ 3.0 1 48

Index Scan using forms_assessment_uuid_assessment_version_idx on forms "bankAssessmentElements:formsForSearch" (cost=0.42..1.26 rows=3 width=40) (actual time=0.004..0.004 rows=1 loops=48)

  • Index Cond: ((assessment_uuid = "bankAssessmentElements".assessment_uuid) AND (assessment_version = "bankAssessmentElements".assessment_version))
13. 0.192 0.192 ↑ 7.0 1 48

Index Scan using form_sections_pkey on form_sections "bankAssessmentElements:formsForSearch:directSectionElements_joi" (cost=0.43..1.93 rows=7 width=40) (actual time=0.004..0.004 rows=1 loops=48)

  • Index Cond: ((form_uuid = "bankAssessmentElements:formsForSearch".form_uuid) AND (form_version = "bankAssessmentElements:formsForSearch".form_version))
14. 0.540 0.540 ↑ 26.1 9 60

Index Scan using section_elements_pkey on section_elements "bankAssessmentElements:formsForSearch:directSectionElements" (cost=0.56..80.66 rows=235 width=80) (actual time=0.005..0.009 rows=9 loops=60)

  • Index Cond: (("bankAssessmentElements:formsForSearch:directSectionElements_joi".section_uuid = section_uuid) AND ("bankAssessmentElements:formsForSearch:directSectionElements_joi".section_version = section_version))
15. 4,814.479 8,759.826 ↓ 1.1 17,755,787 1

Hash (cost=758,983.74..758,983.74 rows=16,295,474 width=40) (actual time=8,759.826..8,759.826 rows=17,755,787 loops=1)

  • Buckets: 65536 Batches: 512 Memory Usage: 2972kB
16. 3,945.347 3,945.347 ↓ 1.1 17,755,787 1

Seq Scan on section_elements "bankAssessmentElements:formsForSearch:linkedItems" (cost=0.00..758,983.74 rows=16,295,474 width=40) (actual time=0.089..3,945.347 rows=17,755,787 loops=1)

17. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=10.40..10.40 rows=40 width=40) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
18. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on item_pool_items "bankAssessmentElements:formsForSearch:pooledItems" (cost=0.00..10.40 rows=40 width=40) (actual time=0.003..0.003 rows=0 loops=1)

19. 0.006 0.516 ↑ 1,343.9 9 1

Hash (cost=45,423.44..45,423.44 rows=12,095 width=22) (actual time=0.516..0.516 rows=9 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 129kB
20. 0.035 0.510 ↑ 1,343.9 9 1

Bitmap Heap Scan on items "bankAssessmentElements:formsForSearch:items" (cost=253.74..45,423.44 rows=12,095 width=22) (actual time=0.494..0.510 rows=9 loops=1)

  • Recheck Cond: ((metadata -> 'courseDisplayTopic'::text) @> ANY ('{83035}'::jsonb[]))
  • Heap Blocks: exact=9
21. 0.475 0.475 ↑ 1,343.9 9 1

Bitmap Index Scan on course_display_topic_index (cost=0.00..250.72 rows=12,095 width=0) (actual time=0.475..0.475 rows=9 loops=1)

  • Index Cond: ((metadata -> 'courseDisplayTopic'::text) @> ANY ('{83035}'::jsonb[]))
Planning time : 1.776 ms