explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1sBj

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,518.981 ↑ 1.0 10 1

Limit (cost=1.25..1,178,099.15 rows=10 width=359) (actual time=779.737..1,518.981 rows=10 loops=1)

  • Output: documentma0_.id, documentma0_.created_by, documentma0_.created_date, documentma0_.last_modified_by, documentma0_.last_modified_date, documentma0_.created_date_from_bundle, documentma0_.department_id, documentma0_.description, documentma0_.document_id, documentma0_.master_identifier_system, documentma0_.medical_case_id, documentma0_.medical_organization_id, documentma0_.patient_id, documentma0_.source, documentma0_.status, documentma0_.subject, documentma0_.document_type_id, document1_.id
  • Buffers: shared hit=1,107,617
2. 0.000 1,518.976 ↑ 14.5 10 1

Nested Loop (cost=1.25..17,082,420.68 rows=145 width=359) (actual time=779.735..1,518.976 rows=10 loops=1)

  • Output: documentma0_.id, documentma0_.created_by, documentma0_.created_date, documentma0_.last_modified_by, documentma0_.last_modified_date, documentma0_.created_date_from_bundle, documentma0_.department_id, documentma0_.description, documentma0_.document_id, documentma0_.master_identifier_system, documentma0_.medical_case_id, documentma0_.medical_organization_id, documentma0_.patient_id, documentma0_.source, documentma0_.status, documentma0_.subject, documentma0_.document_type_id, document1_.id
  • Inner Unique: true
  • Join Filter: (((document1_.created_by)::text = '1286'::text) OR ((medicalorg8_.oid)::text = '1.2.643.5.1.13.13.12.2.38.3646'::text))
  • Rows Removed by Join Filter: 118,262
  • Buffers: shared hit=1,107,617
3. 0.000 1,165.168 ↑ 1.8 118,272 1

Nested Loop (cost=0.84..16,979,152.09 rows=216,025 width=363) (actual time=526.375..1,165.168 rows=118,272 loops=1)

  • Output: documentma0_.id, documentma0_.created_by, documentma0_.created_date, documentma0_.last_modified_by, documentma0_.last_modified_date, documentma0_.created_date_from_bundle, documentma0_.department_id, documentma0_.description, documentma0_.document_id, documentma0_.master_identifier_system, documentma0_.medical_case_id, documentma0_.medical_organization_id, documentma0_.patient_id, documentma0_.source, documentma0_.status, documentma0_.subject, documentma0_.document_type_id, document1_.id, document1_.created_by
  • Inner Unique: true
  • Buffers: shared hit=634,529
4. 603.211 928.716 ↑ 1.8 118,638 1

Index Scan Backward using document_manifest_document_id_idx on public.document_manifest documentma0_ (cost=0.42..16,810,631.09 rows=217,220 width=351) (actual time=526.337..928.716 rows=118,638 loops=1)

  • Output: documentma0_.id, documentma0_.created_by, documentma0_.created_date, documentma0_.last_modified_by, documentma0_.last_modified_date, documentma0_.created_date_from_bundle, documentma0_.department_id, documentma0_.description, documentma0_.document_id, documentma0_.master_identifier_system, documentma0_.medical_case_id, documentma0_.medical_organization_id, documentma0_.patient_id, documentma0_.source, documentma0_.status, documentma0_.subject, documentma0_.document_type_id
  • Filter: (((alternatives: SubPlan 1 or hashed SubPlan 2) AND (alternatives: SubPlan 3 or hashed SubPlan 4)) OR ((alternatives: SubPlan 5 or hashed SubPlan 6) AND (NOT (alternatives: SubPlan 7 or hashed SubPlan 8))))
  • Rows Removed by Filter: 34,158
  • Buffers: shared hit=159,753
5.          

SubPlan (for Index Scan Backward)

6. 0.000 0.000 ↓ 0.0 0

Index Only Scan using organization_signature_document_id_idx on public.organization_signature organizati3_ (cost=0.42..8.44 rows=1 width=0) (never executed)

  • Index Cond: (organizati3_.document_id = documentma0_.document_id)
  • Heap Fetches: 0
7. 63.246 63.246 ↓ 1.0 362,773 1

Seq Scan on public.organization_signature organizati3__1 (cost=0.00..9,461.61 rows=362,761 width=8) (actual time=0.015..63.246 rows=362,773 loops=1)

  • Output: organizati3__1.document_id
  • Buffers: shared hit=5,834
8. 0.000 0.000 ↓ 0.0 0

Index Only Scan using personal_signature_document_id_idx on public.personal_signature personalsi4_ (cost=0.42..8.44 rows=1 width=0) (never executed)

  • Index Cond: (personalsi4_.document_id = documentma0_.document_id)
  • Heap Fetches: 0
9. 88.279 88.279 ↑ 1.0 437,618 1

Seq Scan on public.personal_signature personalsi4__1 (cost=0.00..20,018.68 rows=437,668 width=8) (actual time=0.013..88.279 rows=437,618 loops=1)

  • Output: personalsi4__1.document_id
  • Buffers: shared hit=15,642
10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using personal_signature_document_id_idx on public.personal_signature personalsi5_ (cost=0.42..8.44 rows=1 width=0) (never executed)

  • Index Cond: (personalsi5_.document_id = documentma0_.document_id)
  • Heap Fetches: 0
11. 129.360 129.360 ↑ 1.0 437,618 1

Seq Scan on public.personal_signature personalsi5__1 (cost=0.00..20,018.68 rows=437,668 width=8) (actual time=0.015..129.360 rows=437,618 loops=1)

  • Output: personalsi5__1.document_id
  • Buffers: shared hit=15,642
12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using organization_signature_document_id_idx on public.organization_signature organizati6_ (cost=0.42..8.44 rows=1 width=0) (never executed)

  • Index Cond: (organizati6_.document_id = documentma0_.document_id)
  • Heap Fetches: 0
13. 44.620 44.620 ↓ 1.0 362,773 1

Seq Scan on public.organization_signature organizati6__1 (cost=0.00..9,461.61 rows=362,761 width=8) (actual time=0.012..44.620 rows=362,773 loops=1)

  • Output: organizati6__1.document_id
  • Buffers: shared hit=5,834
14. 237.276 237.276 ↑ 1.0 1 118,638

Index Scan using document_pkey on public.document document1_ (cost=0.42..0.78 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=118,638)

  • Output: document1_.id, document1_.created_by
  • Index Cond: (document1_.id = documentma0_.document_id)
  • Filter: ((document1_.status)::text = ANY ('{FIRST_CHECK_FAILED,NEW_WITHOUT_DS,FIRST_CHECK_SUCCEED,IN_PROGRESS,REGISTRATION_FAILED,NEW_WITH_DS,REGISTRATION_SUCCEED,READY}'::text[]))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=474,776
15. 354.816 354.816 ↑ 1.0 1 118,272

Index Scan using rb_medical_organization_pkey on public.rb_medical_organization medicalorg8_ (cost=0.41..0.46 rows=1 width=66) (actual time=0.003..0.003 rows=1 loops=118,272)

  • Output: medicalorg8_.id, medicalorg8_.oid, medicalorg8_.full_name, medicalorg8_.abbreviated_name, medicalorg8_.region_code, medicalorg8_.region_name, medicalorg8_.system, medicalorg8_.created_date, medicalorg8_.last_modified_date, medicalorg8_.created_by, medicalorg8_.last_modified_by, medicalorg8_.delete_date, medicalorg8_.delete_reason
  • Index Cond: ((medicalorg8_.id)::text = (documentma0_.medical_organization_id)::text)
  • Buffers: shared hit=473,088
Planning time : 1.483 ms
Execution time : 1,526.616 ms