explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H1tN

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 269.526 ↓ 0.0 0 1

Nested Loop (cost=0.57..9,522.53 rows=1 width=123) (actual time=269.526..269.526 rows=0 loops=1)

2. 0.000 269.526 ↓ 0.0 0 1

Nested Loop (cost=0.29..9,514.50 rows=1 width=131) (actual time=269.526..269.526 rows=0 loops=1)

  • Join Filter: (re2.start_vertex = re3.start_vertex)
3. 0.001 269.526 ↓ 0.0 0 1

Nested Loop (cost=0.29..9,493.85 rows=1 width=139) (actual time=269.526..269.526 rows=0 loops=1)

4. 0.000 269.525 ↓ 0.0 0 1

Nested Loop (cost=0.00..9,485.82 rows=1 width=147) (actual time=269.525..269.525 rows=0 loops=1)

  • Join Filter: (sv.content_pid = re2.start_vertex)
5. 2.419 269.525 ↓ 0.0 0 1

Nested Loop (cost=0.00..9,465.17 rows=1 width=131) (actual time=269.525..269.525 rows=0 loops=1)

6. 3.004 234.811 ↓ 10,765.0 10,765 1

Nested Loop (cost=0.00..9,452.84 rows=1 width=8) (actual time=0.212..234.811 rows=10,765 loops=1)

7. 59.567 59.567 ↓ 10,765.0 10,765 1

Seq Scan on patient_index sv4_1 (cost=0.00..9,284.24 rows=1 width=8) (actual time=0.124..59.567 rows=10,765 loops=1)

  • Filter: ((materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (fhir_core_code_search._search_reference_id('organization'::text, search_value) = '5fff161cba4c4f06bc844e2f635a0517'::text))
  • Rows Removed by Filter: 8534
8. 10.765 172.240 ↑ 3.0 1 10,765

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

9. 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))
10. 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))
11. 96.885 129.180 ↑ 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.011..0.012 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
12. 32.295 32.295 ↑ 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.003..0.003 rows=7 loops=10,765)

  • Index Cond: (end_vertex = sv4_1.content_pid)
13. 10.765 32.295 ↓ 0.0 0 10,765

Append (cost=0.00..12.30 rows=3 width=123) (actual time=0.003..0.003 rows=0 loops=10,765)

14. 0.000 0.000 ↓ 0.0 0 10,765

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,765)

  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (re4.start_vertex = content_pid) AND (fhir_core_code_search._search_token_code('status'::text, search_value) = 'preliminary'::text))
15. 10.765 10.765 ↓ 0.0 0 10,765

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

  • Index Cond: (content_pid = re4.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) = 'preliminary'::text))
16. 10.765 10.765 ↓ 0.0 0 10,765

Index Scan using _indx_careplan_index_search_status_code on careplan_index sv_2 (cost=0.29..4.31 rows=1 width=135) (actual time=0.001..0.001 rows=0 loops=10,765)

  • Index Cond: (fhir_core_code_search._search_token_code('status'::text, search_value) = 'preliminary'::text)
  • Filter: ((type = ANY ('{CarePlan}'::text[])) AND (materialized_path ? '{org.common.*,org.2267490707683935235.unpartitioned.*,org.2267490707683935235.*}'::lquery[]) AND (re4.start_vertex = content_pid))
17. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..20.61 rows=3 width=16) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Seq Scan on resource_edge re2 (cost=0.00..0.00 rows=1 width=16) (never executed)

  • 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))
19. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re2_1 (cost=0.29..7.74 rows=1 width=16) (never executed)

  • 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))
20. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • 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[]))
21. 0.000 0.000 ↓ 0.0 0

Index Scan using _indx_riskassessment_single_content_pid on riskassessment_index sv2_1 (cost=0.29..8.01 rows=1 width=8) (never executed)

  • 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))
22. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..20.61 rows=3 width=16) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Seq Scan on resource_edge re3 (cost=0.00..0.00 rows=1 width=16) (never executed)

  • 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))
24. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_resource_edge_start_vertex_idx on stock_resource_edge re3_1 (cost=0.29..7.74 rows=1 width=16) (never executed)

  • 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))
25. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • 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[]))
26. 0.000 0.000 ↓ 0.0 0

Index Scan using _indx_riskassessment_multi_content_pid_ on riskassessment_multivalued_index mv3_1 (cost=0.29..8.02 rows=1 width=8) (never executed)

  • 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 : 19.112 ms
Execution time : 269.800 ms