explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DanZ

Settings
# exclusive inclusive rows x rows loops node
1. 20.355 28,409.113 ↑ 132.2 37 1

GroupAggregate (cost=1,343,550.69..1,343,711.90 rows=4,892 width=112) (actual time=28,388.806..28,409.113 rows=37 loops=1)

  • Group Key: gswaflat."CollarId", gswaflat."FromDepth", gswaflat."CompanySampleId", gswaflat."ToDepth", gswaflat."CompanyHoleID", gswaflat."Anumber
2.          

CTE gswaflat

3. 4,247.167 24,281.991 ↓ 10.0 10,006,790 1

Finalize GroupAggregate (cost=920,451.13..1,320,728.60 rows=1,000,653 width=47) (actual time=8,825.059..24,281.991 rows=10,006,790 loops=1)

  • Group Key: gswa_dh_assay."CompanySampleId", gswa_dh_assay."hValue", gswa_dh_assay."hAnalyte", gswa_dh_assay."FromDepth", gswa_dh_assay."ToDepth", gswa_dh_assay."CompanyHoleID", gswa_dh_assay."Anumber", gswa_dh_assay."CollarId
4. 8,382.850 20,034.824 ↓ 5.0 10,006,790 1

Gather Merge (cost=920,451.13..1,265,692.68 rows=2,001,306 width=47) (actual time=8,825.046..20,034.824 rows=10,006,790 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 1,472.625 11,651.974 ↓ 3.3 3,335,597 3 / 3

Partial GroupAggregate (cost=919,451.11..1,033,692.29 rows=1,000,653 width=47) (actual time=8,773.879..11,651.974 rows=3,335,597 loops=3)

  • Group Key: gswa_dh_assay."CompanySampleId", gswa_dh_assay."hValue", gswa_dh_assay."hAnalyte", gswa_dh_assay."FromDepth", gswa_dh_assay."ToDepth", gswa_dh_assay."CompanyHoleID", gswa_dh_assay."Anumber", gswa_dh_assay."CollarId
6. 9,354.452 10,179.349 ↑ 1.2 3,335,597 3 / 3

Sort (cost=919,451.11..929,874.57 rows=4,169,386 width=43) (actual time=8,773.867..10,179.349 rows=3,335,597 loops=3)

  • Sort Key: gswa_dh_assay."CompanySampleId", gswa_dh_assay."hValue", gswa_dh_assay."hAnalyte", gswa_dh_assay."FromDepth", gswa_dh_assay."ToDepth", gswa_dh_assay."CompanyHoleID", gswa_dh_assay."Anumber", gswa_dh_assay."CollarId
  • Sort Method: external merge Disk: 186,408kB
7. 824.897 824.897 ↑ 1.2 3,335,597 3 / 3

Parallel Seq Scan on gswa_dh_assay (cost=0.00..204,482.86 rows=4,169,386 width=43) (actual time=0.038..824.897 rows=3,335,597 loops=3)

8. 0.030 28,388.758 ↑ 135.2 37 1

Sort (cost=22,822.09..22,834.60 rows=5,003 width=116) (actual time=28,388.755..28,388.758 rows=37 loops=1)

  • Sort Key: gswaflat."FromDepth", gswaflat."CompanySampleId", gswaflat."ToDepth", gswaflat."CompanyHoleID", gswaflat."Anumber
  • Sort Method: quicksort Memory: 27kB
9. 28,388.728 28,388.728 ↑ 135.2 37 1

CTE Scan on gswaflat (cost=0.00..22,514.69 rows=5,003 width=116) (actual time=16,580.226..28,388.728 rows=37 loops=1)

  • Filter: ("CollarId" = 4,510,547)
  • Rows Removed by Filter: 10,006,753
Planning time : 0.228 ms