explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sa1G

Settings
# exclusive inclusive rows x rows loops node
1. 5.721 469.242 ↓ 8,465.0 8,465 1

Nested Loop (cost=5.71..609.75 rows=1 width=133) (actual time=1.661..469.242 rows=8,465 loops=1)

2. 5.634 429.661 ↓ 8,465.0 8,465 1

Nested Loop (cost=5.42..601.72 rows=1 width=141) (actual time=1.635..429.661 rows=8,465 loops=1)

  • Join Filter: (re2.start_vertex = re3.start_vertex)
3. 2.903 381.702 ↓ 8,465.0 8,465 1

Nested Loop (cost=5.42..581.07 rows=1 width=149) (actual time=1.622..381.702 rows=8,465 loops=1)

4. 8.655 325.109 ↓ 10,738.0 10,738 1

Nested Loop (cost=5.13..573.05 rows=1 width=157) (actual time=1.591..325.109 rows=10,738 loops=1)

5. 7.525 241.288 ↓ 10,738.0 10,738 1

Nested Loop (cost=5.13..556.80 rows=1 width=24) (actual time=1.518..241.288 rows=10,738 loops=1)

6. 6.417 147.643 ↓ 10,765.0 10,765 1

Nested Loop (cost=5.13..536.16 rows=1 width=8) (actual time=1.494..147.643 rows=10,765 loops=1)

7. 11.005 12.046 ↓ 10,765.0 10,765 1

Bitmap Heap Scan on patient_index sv4_1 (cost=5.13..367.56 rows=1 width=8) (actual time=1.455..12.046 rows=10,765 loops=1)

  • 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=3664
8. 1.041 1.041 ↓ 112.1 10,765 1

Bitmap Index Scan on _indx_patient_index_search_organization_id (cost=0.00..5.13 rows=96 width=0) (actual time=1.041..1.041 rows=10,765 loops=1)

  • Index Cond: (fhir_core_code_search._search_reference_id('organization'::text, search_value) = '5fff161cba4c4f06bc844e2f635a0517'::text)
9. 10.765 129.180 ↑ 3.0 1 10,765

Append (cost=0.00..168.58 rows=3 width=16) (actual time=0.011..0.012 rows=1 loops=10,765)

10. 0.000 0.000 ↓ 0.0 0 10,765

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

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'patient'::text) AND (sv4_1.content_pid = end_vertex))
11. 32.295 32.295 ↓ 0.0 0 10,765

Index Scan using stock_resource_edge_source_type_path_idx on stock_resource_edge re4_1 (cost=0.29..8.31 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=10,765)

  • Index Cond: ((source_type = ANY ('{CarePlan}'::text[])) AND (path = 'patient'::text))
  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (sv4_1.content_pid = end_vertex))
12. 64.590 86.120 ↑ 1.0 1 10,765

Bitmap Heap Scan on careplan_edge re4_2 (cost=4.73..160.26 rows=1 width=16) (actual time=0.007..0.008 rows=1 loops=10,765)

  • Recheck Cond: (end_vertex = sv4_1.content_pid)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'patient'::text))
  • Rows Removed by Filter: 6
  • Heap Blocks: exact=14944
13. 21.530 21.530 ↑ 5.7 7 10,765

Bitmap Index Scan on careplan_edge_end_vertex_idx (cost=0.00..4.72 rows=40 width=0) (actual time=0.002..0.002 rows=7 loops=10,765)

  • Index Cond: (end_vertex = sv4_1.content_pid)
14. 0.000 86.120 ↑ 3.0 1 10,765

Append (cost=0.00..20.61 rows=3 width=16) (actual time=0.008..0.008 rows=1 loops=10,765)

15. 0.000 0.000 ↓ 0.0 0 10,765

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

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text) AND (re4.start_vertex = start_vertex))
16. 10.765 10.765 ↓ 0.0 0 10,765

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re2_1 (cost=0.29..7.74 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=10,765)

  • Index Cond: (start_vertex = re4.start_vertex)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text))
17. 75.355 75.355 ↑ 1.0 1 10,765

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.006..0.007 rows=1 loops=10,765)

  • Index Cond: ((start_vertex = re4.start_vertex) AND (path = 'assessment'::text))
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]))
18. 0.000 75.166 ↑ 3.0 1 10,738

Append (cost=0.00..16.21 rows=3 width=133) (actual time=0.007..0.007 rows=1 loops=10,738)

19. 0.000 0.000 ↓ 0.0 0 10,738

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

  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (re2.start_vertex = content_pid) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'active'::text))
20. 10.738 10.738 ↓ 0.0 0 10,738

Index Scan using _indx_stock_resource_single_content_pid on stock_resource_index sv_1 (cost=0.29..8.02 rows=1 width=129) (actual time=0.001..0.001 rows=0 loops=10,738)

  • Index Cond: (content_pid = re2.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))
21. 64.428 64.428 ↑ 1.0 1 10,738

Index Scan using _indx_careplan_single_content_pid on careplan_index sv_2 (cost=0.29..8.20 rows=1 width=135) (actual time=0.006..0.006 rows=1 loops=10,738)

  • Index Cond: (content_pid = re2.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))
22. 53.690 53.690 ↑ 1.0 1 10,738

Index Scan using _indx_riskassessment_single_content_pid on riskassessment_index sv2_1 (cost=0.29..8.01 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=10,738)

  • 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
23. 0.000 42.325 ↑ 3.0 1 8,465

Append (cost=0.00..20.61 rows=3 width=16) (actual time=0.005..0.005 rows=1 loops=8,465)

24. 0.000 0.000 ↓ 0.0 0 8,465

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

  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text) AND (re4.start_vertex = start_vertex))
25. 8.465 8.465 ↓ 0.0 0 8,465

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re3_1 (cost=0.29..7.74 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=8,465)

  • Index Cond: (start_vertex = re4.start_vertex)
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (path = 'assessment'::text))
26. 33.860 33.860 ↑ 1.0 1 8,465

Index Scan using careplan_edge_start_vertex_end_vertex_path_materialized_pat_idx on careplan_edge re3_2 (cost=0.55..12.87 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=8,465)

  • Index Cond: ((start_vertex = re4.start_vertex) AND (path = 'assessment'::text))
  • Filter: ((source_type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]))
27. 33.860 33.860 ↑ 1.0 1 8,465

Index Scan using _indx_riskassessment_multi_content_pid_ on riskassessment_multivalued_index mv3_1 (cost=0.29..8.02 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=8,465)

  • Index Cond: (content_pid = re3.end_vertex)
  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (param_name = 'risk'::text) AND (param_type = 'token'::text) AND (fhir_core_code_search._search_token_code(search_value) = 'high'::text))
Planning time : 7.419 ms
Execution time : 469.722 ms