explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wz8

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 143.383 ↓ 0.0 0 1

GroupAggregate (cost=107,604.88..107,604.98 rows=1 width=54) (actual time=143.382..143.383 rows=0 loops=1)

  • Group Key: bcc.claim_id
2. 0.000 143.380 ↓ 0.0 0 1

Sort (cost=107,604.88..107,604.89 rows=1 width=47) (actual time=143.380..143.380 rows=0 loops=1)

  • Sort Key: bcc.claim_id DESC
  • Sort Method: quicksort Memory: 25kB
3. 2.650 143.568 ↓ 0.0 0 1

Gather (cost=106,593.78..107,604.87 rows=1 width=47) (actual time=143.373..143.568 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
4. 0.002 140.918 ↓ 0.0 0 1

Nested Loop (cost=105,593.78..106,604.77 rows=1 width=47) (actual time=140.918..140.918 rows=0 loops=1)

5. 0.006 140.902 ↑ 38.0 1 1

Nested Loop (cost=105,593.22..106,442.58 rows=38 width=18) (actual time=139.769..140.902 rows=1 loops=1)

  • Join Filter: ((bcc.charge_id)::text = (bc.charge_id)::text)
6. 7.849 140.869 ↑ 50.0 1 1

Merge Join (cost=105,592.65..106,403.65 rows=50 width=38) (actual time=139.736..140.869 rows=1 loops=1)

  • Merge Cond: ((bac.activity_id)::text = ((sd.prescription_id)::text))
7. 0.852 9.289 ↑ 22.4 499 1

Sort (cost=97,210.56..97,238.56 rows=11,198 width=42) (actual time=9.253..9.289 rows=499 loops=1)

  • Sort Key: bac.activity_id
  • Sort Method: quicksort Memory: 63kB
8. 0.250 8.437 ↑ 22.4 499 1

Nested Loop (cost=940.48..96,457.45 rows=11,198 width=42) (actual time=2.002..8.437 rows=499 loops=1)

9. 1.423 3.282 ↑ 19.4 545 1

Parallel Bitmap Heap Scan on bill_charge_claim bcc (cost=939.91..49,036.63 rows=10,551 width=24) (actual time=1.978..3.282 rows=545 loops=1)

  • Recheck Cond: ((claim_id)::text = ANY ('{C1320000051784,C1320000062506,C1320000062508,C1320000062629,C1320000061414,C1320000061535,C1320000060568,C1320000062505,C1320000062609,C1320000050889,C1320000059452,C1320000062851,C1320000057393,C1320000058122,C1320000059695,C1320000061522,C1320000061643,C1320000058362,C1320000059572,C1320000061521,C1320000062610,C1320000062731,C1320000058005,C1320000061880,C1320000061769,C1320000062739,C1320000058481,C1320000060677,C1320000061644,C1320000062612,C1320000062854,C1320000061889,C1320000062615,C1320000060437,C1320000061646,C1320000061888,C1320000062614,C1320000062735,C1320000053803,C1320000062642,C1320000058254,C1320000059222,C1320000062641,C1320000059582,C1320000061555,C1320000062402,C1320000062886,C1320000037038,C1320000062401,C1320000062522,C1320000058258,C1320000061790,C1320000058376,C1320000062761,C1320000062882,C1320000062760,C1320000062881,C1320000062407,C1320000062528,C1320000062649,C1320000035094,C1320000039690,C1320000060467,C1320000060588,C1320000062404,C1320000062646,C1320000061798,C1320000062403,C1320000062645,C1320000061438,C1320000062406,C1320000062527,C1320000062769,C1320000060349,C1320000061558,C1320000061679,C1320000047498,C1320000059119,C1320000059353,C1320000061300,C1320000062510,C1320000059112,C1320000061783,C1320000058141,C1320000061544,C1320000062512,C1320000062754,C1320000059352,C1320000062632,C1320000059237,C1320000060691,C1320000058387,C1320000058146,C1320000058388,C1320000059477,C1320000061308,C1320000062517,C1320000062638,C1320000060456,C1320000061667,C1320000061788,C1320000062756,C1320000061545,C1320000062634,C1320000062876,C1320000060458,C1320000062637,C1320000058380,C1320000062636,C1320000062878,C1320000060485,C1320000062664,C1320000062785,C1320000062663,C1320000040999,C1320000060481,C1320000062781,C1320000062420,C1320000062541,C1320000062662,C1320000061693,C1320000060126,C1320000060247,C1320000061337,C1320000062426,C1320000062668,C1320000062789,C1320000058030,C1320000062304,C1320000062425,C1320000062788,C1320000062307,C1320000062427,C1320000062669,C1320000052742,C1320000048480,C1320000059018,C1320000057196,C1320000062774,C1320000059255,C1320000060354,C1320000061321,C1320000062655,C1320000060356,C1320000060477,C1320000062412,C1320000062654,C1320000060593,C1320000062771,C1320000062419,C1320000061568,C1320000062415,C1320000062657,C1320000062778,C1320000061204,C1320000062414,C1320000062656,C1320000057194,C1320000062538,C1320000062659,C1320000062416,C1320000062537,C1320000062779}'::text[]))
  • Heap Blocks: exact=721
10. 1.859 1.859 ↑ 16.0 1,586 1

Bitmap Index Scan on bill_charge_claim_claim_idx (cost=0.00..933.58 rows=25,322 width=0) (actual time=1.859..1.859 rows=1,586 loops=1)

  • Index Cond: ((claim_id)::text = ANY ('{C1320000051784,C1320000062506,C1320000062508,C1320000062629,C1320000061414,C1320000061535,C1320000060568,C1320000062505,C1320000062609,C1320000050889,C1320000059452,C1320000062851,C1320000057393,C1320000058122,C1320000059695,C1320000061522,C1320000061643,C1320000058362,C1320000059572,C1320000061521,C1320000062610,C1320000062731,C1320000058005,C1320000061880,C1320000061769,C1320000062739,C1320000058481,C1320000060677,C1320000061644,C1320000062612,C1320000062854,C1320000061889,C1320000062615,C1320000060437,C1320000061646,C1320000061888,C1320000062614,C1320000062735,C1320000053803,C1320000062642,C1320000058254,C1320000059222,C1320000062641,C1320000059582,C1320000061555,C1320000062402,C1320000062886,C1320000037038,C1320000062401,C1320000062522,C1320000058258,C1320000061790,C1320000058376,C1320000062761,C1320000062882,C1320000062760,C1320000062881,C1320000062407,C1320000062528,C1320000062649,C1320000035094,C1320000039690,C1320000060467,C1320000060588,C1320000062404,C1320000062646,C1320000061798,C1320000062403,C1320000062645,C1320000061438,C1320000062406,C1320000062527,C1320000062769,C1320000060349,C1320000061558,C1320000061679,C1320000047498,C1320000059119,C1320000059353,C1320000061300,C1320000062510,C1320000059112,C1320000061783,C1320000058141,C1320000061544,C1320000062512,C1320000062754,C1320000059352,C1320000062632,C1320000059237,C1320000060691,C1320000058387,C1320000058146,C1320000058388,C1320000059477,C1320000061308,C1320000062517,C1320000062638,C1320000060456,C1320000061667,C1320000061788,C1320000062756,C1320000061545,C1320000062634,C1320000062876,C1320000060458,C1320000062637,C1320000058380,C1320000062636,C1320000062878,C1320000060485,C1320000062664,C1320000062785,C1320000062663,C1320000040999,C1320000060481,C1320000062781,C1320000062420,C1320000062541,C1320000062662,C1320000061693,C1320000060126,C1320000060247,C1320000061337,C1320000062426,C1320000062668,C1320000062789,C1320000058030,C1320000062304,C1320000062425,C1320000062788,C1320000062307,C1320000062427,C1320000062669,C1320000052742,C1320000048480,C1320000059018,C1320000057196,C1320000062774,C1320000059255,C1320000060354,C1320000061321,C1320000062655,C1320000060356,C1320000060477,C1320000062412,C1320000062654,C1320000060593,C1320000062771,C1320000062419,C1320000061568,C1320000062415,C1320000062657,C1320000062778,C1320000061204,C1320000062414,C1320000062656,C1320000057194,C1320000062538,C1320000062659,C1320000062416,C1320000062537,C1320000062779}'::text[]))
11. 4.905 4.905 ↑ 1.0 1 545

Index Scan using bac_charge_id_index on bill_activity_charge bac (cost=0.56..4.46 rows=1 width=18) (actual time=0.009..0.009 rows=1 loops=545)

  • Index Cond: ((charge_id)::text = (bcc.charge_id)::text)
12. 111.919 123.731 ↑ 1.1 66,363 1

Sort (cost=8,382.09..8,556.47 rows=69,752 width=8) (actual time=120.372..123.731 rows=66,363 loops=1)

  • Sort Key: ((sd.prescription_id)::text)
  • Sort Method: quicksort Memory: 6321kB
13. 11.812 11.812 ↑ 1.0 69,307 1

Seq Scan on service_documents sd (cost=0.00..2,770.56 rows=69,752 width=8) (actual time=0.011..11.812 rows=69,307 loops=1)

14. 0.027 0.027 ↑ 1.0 1 1

Index Scan using bill_charge_pkey on bill_charge bc (cost=0.56..0.75 rows=1 width=10) (actual time=0.027..0.027 rows=1 loops=1)

  • Index Cond: ((charge_id)::text = (bac.charge_id)::text)
  • Filter: (status <> 'X'::bpchar)
15. 0.014 0.014 ↓ 0.0 0 1

Index Scan using patient_documents_docid_pkey on patient_documents pd (cost=0.56..4.17 rows=1 width=37) (actual time=0.014..0.014 rows=0 loops=1)

  • Index Cond: (doc_id = sd.doc_id)
  • Filter: ((doc_format)::text = 'DOC_FILEUPLOAD'::text)
  • Rows Removed by Filter: 1