explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 63mt

Settings
# exclusive inclusive rows x rows loops node
1. 336.457 13,825.943 ↑ 1.0 40 1

Limit (cost=3,565,046.38..3,565,051.55 rows=40 width=44) (actual time=13,489.429..13,825.943 rows=40 loops=1)

2. 0.000 13,489.486 ↑ 112,201.5 40 1

Finalize GroupAggregate (cost=3,565,046.38..4,145,407.92 rows=4,488,059 width=44) (actual time=13,489.426..13,489.486 rows=40 loops=1)

  • Group Key: ((_patient_hcaps_hcap1.visit_start)::date), _pat_mi_hospital_reference_info1.__id__
3. 389.324 13,825.856 ↑ 91,220.7 41 1

Gather Merge (cost=3,565,046.38..4,038,816.51 rows=3,740,050 width=20) (actual time=13,489.396..13,825.856 rows=41 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.176 13,436.532 ↑ 3,747.5 499 3 / 3

Partial GroupAggregate (cost=3,564,046.35..3,606,121.92 rows=1,870,025 width=20) (actual time=13,436.159..13,436.532 rows=499 loops=3)

  • Group Key: ((_patient_hcaps_hcap1.visit_start)::date), _pat_mi_hospital_reference_info1.__id__
5. 944.069 13,436.356 ↑ 3,740.1 500 3 / 3

Sort (cost=3,564,046.35..3,568,721.42 rows=1,870,025 width=20) (actual time=13,436.126..13,436.356 rows=500 loops=3)

  • Sort Key: ((_patient_hcaps_hcap1.visit_start)::date), _pat_mi_hospital_reference_info1.__id__
  • Sort Method: quicksort Memory: 152,572kB
  • Worker 0: Sort Method: quicksort Memory: 143,999kB
  • Worker 1: Sort Method: quicksort Memory: 155,766kB
6. 861.169 12,492.287 ↑ 1.4 1,300,823 3 / 3

Parallel Hash Join (cost=1,716,394.39..3,369,239.99 rows=1,870,025 width=20) (actual time=7,594.416..12,492.287 rows=1,300,823 loops=3)

  • Hash Cond: (_patient_hcaps1.__parent_id__ = _patient1.__id__)
7. 777.996 10,524.168 ↑ 1.4 1,300,823 3 / 3

Parallel Hash Join (cost=1,525,734.41..3,168,996.13 rows=1,870,025 width=32) (actual time=6,470.443..10,524.168 rows=1,300,823 loops=3)

  • Hash Cond: (_patient_hcaps_hcap1.__parent_id__ = _patient_hcaps1.__id__)
8. 1,920.982 9,015.466 ↑ 1.4 1,300,823 3 / 3

Parallel Hash Join (cost=1,463,687.33..3,102,040.22 rows=1,870,025 width=32) (actual time=5,725.480..9,015.466 rows=1,300,823 loops=3)

  • Hash Cond: (_pat_mi_hospital_reference_info1.__parent_id__ = _patient_hcap_medical_institution1.__id__)
9. 1,398.653 1,398.653 ↑ 1.2 4,500,461 3 / 3

Parallel Seq Scan on _pat_mi_hospital_reference_info _pat_mi_hospital_reference_info1 (cost=0.00..1,602,510.75 rows=5,610,075 width=16) (actual time=0.031..1,398.653 rows=4,500,461 loops=3)

10. 617.181 5,695.831 ↑ 1.4 1,301,015 3 / 3

Parallel Hash (cost=1,440,218.44..1,440,218.44 rows=1,877,511 width=32) (actual time=5,695.831..5,695.831 rows=1,301,015 loops=3)

  • Buckets: 8,388,608 Batches: 1 Memory Usage: 310,016kB
11. 1,784.628 5,078.650 ↑ 1.4 1,301,015 3 / 3

Parallel Hash Join (cost=1,228,805.71..1,440,218.44 rows=1,877,511 width=32) (actual time=2,711.465..5,078.650 rows=1,301,015 loops=3)

  • Hash Cond: (_patient_hcap_medical_institution1.__parent_id__ = _patient_hcaps_hcap1.__id__)
12. 595.318 595.318 ↑ 1.3 4,500,622 3 / 3

Parallel Seq Scan on _patient_hcap_medical_institution _patient_hcap_medical_institution1 (cost=0.00..196,627.33 rows=5,632,533 width=16) (actual time=0.033..595.318 rows=4,500,622 loops=3)

13. 456.813 2,698.704 ↑ 1.4 1,120,778 3 / 3

Parallel Hash (cost=1,209,212.31..1,209,212.31 rows=1,567,472 width=24) (actual time=2,698.704..2,698.704 rows=1,120,778 loops=3)

  • Buckets: 4,194,304 Batches: 1 Memory Usage: 217,024kB
14. 2,241.891 2,241.891 ↑ 1.4 1,120,778 3 / 3

Parallel Seq Scan on _patient_hcaps_hcap _patient_hcaps_hcap1 (cost=0.00..1,209,212.31 rows=1,567,472 width=24) (actual time=0.123..2,241.891 rows=1,120,778 loops=3)

  • Filter: ((visit_start)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text))
  • Rows Removed by Filter: 2,630,414
15. 533.441 730.706 ↑ 1.2 1,108,892 3 / 3

Parallel Hash (cost=44,721.48..44,721.48 rows=1,386,048 width=16) (actual time=730.705..730.706 rows=1,108,892 loops=3)

  • Buckets: 4,194,304 Batches: 1 Memory Usage: 188,928kB
16. 197.265 197.265 ↑ 1.2 1,108,892 3 / 3

Parallel Seq Scan on _patient_hcaps _patient_hcaps1 (cost=0.00..44,721.48 rows=1,386,048 width=16) (actual time=0.047..197.265 rows=1,108,892 loops=3)

17. 675.164 1,106.950 ↑ 1.2 1,196,345 3 / 3

Parallel Hash (cost=171,967.77..171,967.77 rows=1,495,377 width=8) (actual time=1,106.950..1,106.950 rows=1,196,345 loops=3)

  • Buckets: 4,194,304 Batches: 1 Memory Usage: 173,216kB
18. 431.786 431.786 ↑ 1.2 1,196,345 3 / 3

Parallel Seq Scan on _patient _patient1 (cost=0.00..171,967.77 rows=1,495,377 width=8) (actual time=0.027..431.786 rows=1,196,345 loops=3)

Planning time : 2.962 ms
Execution time : 13,842.667 ms