explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ktEO

Settings
# exclusive inclusive rows x rows loops node
1. 15.294 119,534.719 ↓ 8,465.0 8,465 1

Nested Loop (cost=332.55..6,674.55 rows=1 width=133) (actual time=13,905.748..119,534.719 rows=8,465 loops=1)

2. 22.997 119,252.422 ↓ 9,889.0 9,889 1

Nested Loop (cost=332.26..6,666.58 rows=1 width=141) (actual time=15.496..119,252.422 rows=9,889 loops=1)

3. 31,918.505 118,962.422 ↓ 9,889.0 9,889 1

Nested Loop (cost=332.26..6,645.96 rows=1 width=149) (actual time=15.456..118,962.422 rows=9,889 loops=1)

  • Join Filter: (re4.end_vertex = sv4_1.content_pid)
  • Rows Removed by Join Filter: 97960434
4. 20.820 999.728 ↓ 9,889.0 9,889 1

Nested Loop (cost=0.29..212.52 rows=1 width=157) (actual time=0.145..999.728 rows=9,889 loops=1)

5. 23.695 771.239 ↓ 9,889.0 9,889 1

Nested Loop (cost=0.29..191.91 rows=1 width=141) (actual time=0.122..771.239 rows=9,889 loops=1)

6. 26.292 411.318 ↓ 9,889.0 9,889 1

Nested Loop (cost=0.29..175.36 rows=1 width=8) (actual time=0.055..411.318 rows=9,889 loops=1)

7. 58.689 58.689 ↓ 9,889.0 9,889 1

Index Scan using _indx_riskassessment_multivalued_index_search_risk_code on riskassessment_multivalued_index mv3_1 (cost=0.29..14.51 rows=1 width=8) (actual time=0.024..58.689 rows=9,889 loops=1)

  • Index Cond: (fhir_core_code_search._search_token_code(search_value) = 'high'::text)
  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (param_type = 'token'::text))
  • Rows Removed by Filter: 8522
8. 108.779 326.337 ↑ 3.0 1 9,889

Append (cost=0.00..160.81 rows=3 width=16) (actual time=0.032..0.033 rows=1 loops=9,889)

9. 0.000 0.000 ↓ 0.0 0 9,889

Seq Scan on resource_edge re3 (cost=0.00..0.00 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=9,889)

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text) AND (mv3_1.content_pid = end_vertex))
10. 89.001 89.001 ↓ 0.0 0 9,889

Index Scan using stock_resource_edge_source_type_path_idx on stock_resource_edge re3_1 (cost=0.29..8.31 rows=1 width=16) (actual time=0.009..0.009 rows=0 loops=9,889)

  • Index Cond: ((source_type = ANY ('{CarePlan}'::text[])) AND (path = 'assessment'::text))
  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (mv3_1.content_pid = end_vertex))
11. 69.223 128.557 ↑ 1.0 1 9,889

Bitmap Heap Scan on careplan_edge re3_2 (cost=4.71..152.50 rows=1 width=16) (actual time=0.012..0.013 rows=1 loops=9,889)

  • Recheck Cond: (end_vertex = mv3_1.content_pid)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text))
  • Heap Blocks: exact=9889
12. 59.334 59.334 ↑ 38.0 1 9,889

Bitmap Index Scan on careplan_edge_end_vertex_idx (cost=0.00..4.71 rows=38 width=0) (actual time=0.006..0.006 rows=1 loops=9,889)

  • Index Cond: (end_vertex = mv3_1.content_pid)
13. 39.556 336.226 ↑ 3.0 1 9,889

Append (cost=0.00..16.52 rows=3 width=133) (actual time=0.033..0.034 rows=1 loops=9,889)

14. 0.000 0.000 ↓ 0.0 0 9,889

Seq Scan on resource_index sv (cost=0.00..0.00 rows=1 width=104) (actual time=0.000..0.000 rows=0 loops=9,889)

  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (re3.start_vertex = content_pid) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'active'::text))
15. 39.556 39.556 ↓ 0.0 0 9,889

Index Scan using _indx_stock_resource_single_content_pid on stock_resource_index sv_1 (cost=0.29..8.16 rows=1 width=130) (actual time=0.004..0.004 rows=0 loops=9,889)

  • Index Cond: (content_pid = re3.start_vertex)
  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'active'::text))
16. 257.114 257.114 ↑ 1.0 1 9,889

Index Scan using _indx_careplan_single_content_pid on careplan_index sv_2 (cost=0.29..8.36 rows=1 width=135) (actual time=0.025..0.026 rows=1 loops=9,889)

  • Index Cond: (content_pid = re3.start_vertex)
  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'active'::text))
17. 29.667 207.669 ↑ 3.0 1 9,889

Append (cost=0.00..20.59 rows=3 width=16) (actual time=0.018..0.021 rows=1 loops=9,889)

18. 0.000 0.000 ↓ 0.0 0 9,889

Seq Scan on resource_edge re4 (cost=0.00..0.00 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=9,889)

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'patient'::text) AND (sv.content_pid = start_vertex))
19. 29.667 29.667 ↓ 0.0 0 9,889

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re4_1 (cost=0.29..7.71 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=9,889)

  • Index Cond: (start_vertex = sv.content_pid)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'patient'::text))
20. 148.335 148.335 ↑ 1.0 1 9,889

Index Scan using careplan_edge_start_vertex_end_vertex_path_materialized_pat_idx on careplan_edge re4_2 (cost=0.55..12.87 rows=1 width=16) (actual time=0.013..0.015 rows=1 loops=9,889)

  • Index Cond: ((start_vertex = sv.content_pid) AND (path = 'patient'::text))
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]))
21. 76,550.749 86,044.189 ↓ 1,238.4 9,907 9,889

Bitmap Heap Scan on patient_index sv4_1 (cost=331.97..6,433.34 rows=8 width=8) (actual time=1.343..8.701 rows=9,907 loops=9,889)

  • Recheck Cond: (fhir_core_code_search._search_reference_id('organization'::text, search_value) = '5fff161cba4c4f06bc844e2f635a0517'::text)
  • Filter: (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[])
  • Heap Blocks: exact=34453276
22. 9,493.440 9,493.440 ↓ 1.2 9,907 9,889

Bitmap Index Scan on _indx_patient_index_search_organization_id (cost=0.00..331.97 rows=7,958 width=0) (actual time=0.960..0.960 rows=9,907 loops=9,889)

  • Index Cond: (fhir_core_code_search._search_reference_id('organization'::text, search_value) = '5fff161cba4c4f06bc844e2f635a0517'::text)
23. 79.112 267.003 ↑ 3.0 1 9,889

Append (cost=0.00..20.59 rows=3 width=16) (actual time=0.026..0.027 rows=1 loops=9,889)

24. 0.000 0.000 ↓ 0.0 0 9,889

Seq Scan on resource_edge re2 (cost=0.00..0.00 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=9,889)

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text) AND (sv.content_pid = start_vertex))
25. 49.445 49.445 ↓ 0.0 0 9,889

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re2_1 (cost=0.29..7.71 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=9,889)

  • Index Cond: (start_vertex = sv.content_pid)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text))
26. 138.446 138.446 ↑ 1.0 1 9,889

Index Scan using careplan_edge_start_vertex_end_vertex_path_materialized_pat_idx on careplan_edge re2_2 (cost=0.55..12.87 rows=1 width=16) (actual time=0.014..0.014 rows=1 loops=9,889)

  • Index Cond: ((start_vertex = sv.content_pid) AND (path = 'assessment'::text))
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]))
27. 267.003 267.003 ↑ 1.0 1 9,889

Index Scan using _indx_riskassessment_single_content_pid on riskassessment_index sv2_1 (cost=0.29..7.96 rows=1 width=8) (actual time=0.026..0.027 rows=1 loops=9,889)

  • Index Cond: (content_pid = re2.end_vertex)
  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'final'::text))
  • Rows Removed by Filter: 0
Planning time : 7.398 ms
Execution time : 119,537.143 ms