explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4CHM

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 2,317,081.960 ↓ 0.0 0 1

Sort (cost=181,389,323.47..181,389,323.77 rows=121 width=229) (actual time=2,317,081.960..2,317,081.960 rows=0 loops=1)

  • Sort Key: ns_assessment.pcaassess_date NULLS FIRST, ns_assessment.pcaassess_time NULLS FIRST, ns_assessment.pcaassess_amendold_dt NULLS FIRST, ns_assessment.pcaassess_amendold_tm NULLS FI
  • Sort Method: quicksort Memory: 25kB
2. 0.002 2,317,081.952 ↓ 0.0 0 1

HashAggregate (cost=181,389,316.86..181,389,318.07 rows=121 width=229) (actual time=2,317,081.952..2,317,081.952 rows=0 loops=1)

  • Group Key: ns_assessment.pcaassess_date, ns_assessment.pcaassess_time, ns_assessment.pcaassess_nurse, ns_assessment.pcaassess_ques, (ns_assessment.pcaassess_ans[1]), (''::character
3. 0.003 2,317,081.950 ↓ 0.0 0 1

Append (cost=0.00..181,389,312.93 rows=121 width=229) (actual time=2,317,081.950..2,317,081.950 rows=0 loops=1)

4. 354.065 1,937,621.165 ↓ 0.0 0 1

Seq Scan on ns_assessment (cost=0.00..151,748,811.08 rows=101 width=199) (actual time=1,937,621.165..1,937,621.165 rows=0 loops=1)

  • Filter: ((pcaassess_arid = '1'::numeric) AND ((SubPlan 4) = 143661))
  • Rows Removed by Filter: 20306
5.          

SubPlan (forSeq Scan)

6. 0.000 0.000 ↓ 0.0 0

Limit (cost=7,436.05..7,436.06 rows=1 width=16) (never executed)

7. 0.000 0.000 ↓ 0.0 0

Sort (cost=7,436.05..7,436.06 rows=1 width=16) (never executed)

  • Sort Key: ns_administration_2.pcaadmin_date DESC NULLS LAST, ns_administration_2.pcaadmin_time DESC NULLS LAST
8. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on ns_administration ns_administration_2 (cost=947.58..7,436.04 rows=1 width=16) (never executed)

  • Recheck Cond: (pcaadmin_arid = ns_assessment.pcaassess_arid)
  • Filter: ((pcaadmin_sqlseq_parent = ns_assessment.pcaassess_sqlseq_parent) AND ((pcaadmin_date + pcaadmin_time) <= (ns_assessment.pcaassess_date + ns_
9. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pcaadmin_pkey (cost=0.00..947.57 rows=34,554 width=0) (never executed)

  • Index Cond: (pcaadmin_arid = ns_assessment.pcaassess_arid)
10. 181.053 1,937,267.100 ↑ 1.0 1 20,117

Limit (cost=7,436.05..7,436.06 rows=1 width=16) (actual time=96.297..96.300 rows=1 loops=20,117)

11. 1,991.583 1,937,086.047 ↑ 1.0 1 20,117

Sort (cost=7,436.05..7,436.06 rows=1 width=16) (actual time=96.291..96.291 rows=1 loops=20,117)

  • Sort Key: ns_administration_3.pcaadmin_date DESC NULLS LAST, ns_administration_3.pcaadmin_time DESC NULLS LAST
  • Sort Method: quicksort Memory: 25kB
12. 1,560,254.403 1,935,094.464 ↓ 2.0 2 20,117

Bitmap Heap Scan on ns_administration ns_administration_3 (cost=947.58..7,436.04 rows=1 width=16) (actual time=60.839..96.192 rows=2 loops=20,117)

  • Recheck Cond: (pcaadmin_arid = ns_assessment.pcaassess_arid)
  • Filter: ((pcaadmin_sqlseq_parent = ns_assessment.pcaassess_sqlseq_parent) AND ((pcaadmin_date + pcaadmin_time) <= (ns_assessment.pcaassess_date + ns_
  • Rows Removed by Filter: 131041
  • Heap Blocks: exact=85436899
13. 374,840.061 374,840.061 ↓ 3.8 131,043 20,117

Bitmap Index Scan on pcaadmin_pkey (cost=0.00..947.57 rows=34,554 width=0) (actual time=18.633..18.633 rows=131,043 loops=20,117)

  • Index Cond: (pcaadmin_arid = ns_assessment.pcaassess_arid)
14. 97.018 379,460.782 ↓ 0.0 0 1

Index Scan using pcavit_pkey on ns_vital (cost=0.28..29,640,500.64 rows=20 width=55) (actual time=379,460.782..379,460.782 rows=0 loops=1)

  • Index Cond: (pcavit_arid = '1'::numeric)
  • Filter: ((SubPlan 2) = 143661)
  • Rows Removed by Filter: 3966
15.          

SubPlan (forIndex Scan)

16. 0.000 0.000 ↓ 0.0 0

Limit (cost=7,436.05..7,436.06 rows=1 width=16) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Sort (cost=7,436.05..7,436.06 rows=1 width=16) (never executed)

  • Sort Key: ns_administration.pcaadmin_date DESC NULLS LAST, ns_administration.pcaadmin_time DESC NULLS LAST
18. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on ns_administration (cost=947.58..7,436.04 rows=1 width=16) (never executed)

  • Recheck Cond: (pcaadmin_arid = ns_vital.pcavit_arid)
  • Filter: ((pcaadmin_sqlseq_parent = ns_vital.pcavit_sqlseq_parent) AND ((pcaadmin_date + pcaadmin_time) <= (ns_vital.pcavit_date + ns_vital.pcavit_tim
19. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pcaadmin_pkey (cost=0.00..947.57 rows=34,554 width=0) (never executed)

  • Index Cond: (pcaadmin_arid = ns_vital.pcavit_arid)
20. 35.694 379,363.764 ↑ 1.0 1 3,966

Limit (cost=7,436.05..7,436.06 rows=1 width=16) (actual time=95.651..95.654 rows=1 loops=3,966)

21. 424.362 379,328.070 ↑ 1.0 1 3,966

Sort (cost=7,436.05..7,436.06 rows=1 width=16) (actual time=95.645..95.645 rows=1 loops=3,966)

  • Sort Key: ns_administration_1.pcaadmin_date DESC NULLS LAST, ns_administration_1.pcaadmin_time DESC NULLS LAST
  • Sort Method: quicksort Memory: 25kB
22. 306,393.330 378,903.708 ↓ 2.0 2 3,966

Bitmap Heap Scan on ns_administration ns_administration_1 (cost=947.58..7,436.04 rows=1 width=16) (actual time=64.001..95.538 rows=2 loops=3,966)

  • Recheck Cond: (pcaadmin_arid = ns_vital.pcavit_arid)
  • Filter: ((pcaadmin_sqlseq_parent = ns_vital.pcavit_sqlseq_parent) AND ((pcaadmin_date + pcaadmin_time) <= (ns_vital.pcavit_date + ns_vital.pcavit_tim
  • Rows Removed by Filter: 131041
  • Heap Blocks: exact=16843602
23. 72,510.378 72,510.378 ↓ 3.8 131,043 3,966

Bitmap Index Scan on pcaadmin_pkey (cost=0.00..947.57 rows=34,554 width=0) (actual time=18.283..18.283 rows=131,043 loops=3,966)

  • Index Cond: (pcaadmin_arid = ns_vital.pcavit_arid)
Planning time : 0.651 ms
Execution time : 2,317,082.158 ms