explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qyzx

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 0.816 ↑ 1.0 1 1

Aggregate (cost=9,180.82..9,180.83 rows=1 width=32) (actual time=0.816..0.816 rows=1 loops=1)

2. 0.010 0.809 ↑ 11.0 1 1

Sort (cost=9,180.65..9,180.68 rows=11 width=16) (actual time=0.808..0.809 rows=1 loops=1)

  • Sort Key: (row_number() OVER (?))
  • Sort Method: quicksort Memory: 25kB
3. 0.001 0.799 ↑ 11.0 1 1

Unique (cost=9,179.83..9,180.35 rows=11 width=16) (actual time=0.799..0.799 rows=1 loops=1)

4. 0.006 0.798 ↑ 104.0 1 1

Sort (cost=9,179.83..9,180.09 rows=104 width=16) (actual time=0.798..0.798 rows=1 loops=1)

  • Sort Key: mv1.content_pid
  • Sort Method: quicksort Memory: 25kB
5. 0.006 0.792 ↑ 104.0 1 1

WindowAgg (cost=0.00..9,175.31 rows=104 width=16) (actual time=0.686..0.792 rows=1 loops=1)

6. 0.003 0.786 ↑ 104.0 1 1

Nested Loop (cost=0.00..9,174.01 rows=104 width=8) (actual time=0.681..0.786 rows=1 loops=1)

7. 0.002 0.054 ↑ 11.0 1 1

Append (cost=0.00..44.50 rows=11 width=8) (actual time=0.053..0.054 rows=1 loops=1)

8. 0.011 0.011 ↓ 0.0 0 1

Seq Scan on resource_index sv (cost=0.00..0.00 rows=1 width=8) (actual time=0.011..0.011 rows=0 loops=1)

  • Filter: ((type = ANY ('{Observation}'::text[])) AND ('org.2043549545819800579'::ltree @> materialized_path) AND (fhir_core_code_search._search_reference_id('patient'::text, search_value) = 'W6pp51'::text))
9. 0.041 0.041 ↑ 10.0 1 1

Index Scan using _indx_observation_index_search_patient_id on observation_index sv_1 (cost=0.29..44.50 rows=10 width=8) (actual time=0.041..0.041 rows=1 loops=1)

  • Index Cond: (fhir_core_code_search._search_reference_id('patient'::text, search_value) = 'W6pp51'::text)
  • Filter: ((type = ANY ('{Observation}'::text[])) AND ('org.2043549545819800579'::ltree @> materialized_path))
10. 0.002 0.729 ↑ 2.0 1 1

Append (cost=0.00..829.94 rows=2 width=8) (actual time=0.626..0.729 rows=1 loops=1)

11. 0.479 0.479 ↓ 0.0 0 1

Seq Scan on resource_multivalued_index mv1 (cost=0.00..751.07 rows=1 width=8) (actual time=0.478..0.479 rows=0 loops=1)

  • Filter: ((type = ANY ('{Observation}'::text[])) AND ('org.2043549545819800579'::ltree @> materialized_path) AND (param_name = 'component-code'::text) AND (param_type = 'token'::text) AND (sv.content_pid = content_pid) AND ((fhir_core_code_search._search_token_code(search_value) = '289259007'::text) OR (fhir_core_code_search._search_token_code(search_value) = '726624001'::text)))
  • Rows Removed by Filter: 1374
12. 0.248 0.248 ↑ 1.0 1 1

Index Scan using _indx_observation_multi_content_pid_token on observation_multivalued_index_token mv1_1 (cost=0.43..78.87 rows=1 width=8) (actual time=0.145..0.248 rows=1 loops=1)

  • Index Cond: (content_pid = sv.content_pid)
  • Filter: ((type = ANY ('{Observation}'::text[])) AND ('org.2043549545819800579'::ltree @> materialized_path) AND (param_name = 'component-code'::text) AND (param_type = 'token'::text) AND ((fhir_core_code_search._search_token_code(search_value) = '289259007'::text) OR (fhir_core_code_search._search_token_code(search_value) = '726624001'::text)))
  • Rows Removed by Filter: 9
Planning time : 41.891 ms
Execution time : 0.958 ms