explain.depesz.com

PostgreSQL's explain analyze made readable

Result: THY4

Settings
# exclusive inclusive rows x rows loops node
1. 0.108 82,871.671 ↑ 1.0 50 1

Limit (cost=1,740,718.46..1,740,718.58 rows=50 width=1,680) (actual time=82,871.520..82,871.671 rows=50 loops=1)

2.          

CTE infra_col_data

3. 170.208 2,764.965 ↓ 6.2 82,453 1

Unique (cost=27,175.54..27,241.59 rows=13,211 width=174) (actual time=2,494.613..2,764.965 rows=82,453 loops=1)

4. 219.842 2,594.757 ↓ 6.4 84,267 1

Sort (cost=27,175.54..27,208.57 rows=13,211 width=174) (actual time=2,494.607..2,594.757 rows=84,267 loops=1)

  • Sort Key: po_infra_instan.id_infra_instan
  • Sort Method: quicksort Memory: 20177kB
5. 179.400 2,374.915 ↓ 6.4 84,267 1

Hash Join (cost=19,831.80..26,271.28 rows=13,211 width=174) (actual time=1,486.070..2,374.915 rows=84,267 loops=1)

  • Hash Cond: (po_proj_sub_infra.id_project_sub = po_project_sub.id_project_sub)
6. 426.943 1,789.117 ↓ 1.5 84,267 1

Hash Join (cost=16,293.66..22,387.30 rows=56,997 width=166) (actual time=1,079.625..1,789.117 rows=84,267 loops=1)

  • Hash Cond: (po_proj_sub_infra.id_infra_instan = po_infra_instan.id_infra_instan)
7. 282.902 282.902 ↓ 1.0 274,532 1

Seq Scan on po_proj_sub_infra (cost=0.00..4,494.22 rows=274,522 width=8) (actual time=0.021..282.902 rows=274,532 loops=1)

8. 147.126 1,079.272 ↓ 1.5 84,770 1

Hash (cost=15,580.81..15,580.81 rows=57,028 width=162) (actual time=1,079.271..1,079.272 rows=84,770 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 12693kB
9. 458.959 932.146 ↓ 1.5 84,770 1

Hash Join (cost=20.85..15,580.81 rows=57,028 width=162) (actual time=0.441..932.146 rows=84,770 loops=1)

  • Hash Cond: (po_infra_instan.id_connector_details = po_connector_details.id_connector_details)
10. 472.785 472.785 ↓ 1.0 274,441 1

Seq Scan on po_infra_instan (cost=0.00..13,960.75 rows=274,382 width=162) (actual time=0.019..472.785 rows=274,441 loops=1)

  • Filter: (NOT bl_marked_for_deletion)
  • Rows Removed by Filter: 233
11. 0.084 0.402 ↑ 1.0 53 1

Hash (cost=20.19..20.19 rows=53 width=4) (actual time=0.401..0.402 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.318 0.318 ↑ 1.0 53 1

Seq Scan on po_connector_details (cost=0.00..20.19 rows=53 width=4) (actual time=0.021..0.318 rows=53 loops=1)

  • Filter: (id_enterprise = 83)
  • Rows Removed by Filter: 202
13. 15.278 406.398 ↑ 2.1 9,532 1

Hash (cost=3,291.11..3,291.11 rows=19,762 width=12) (actual time=406.398..406.398 rows=9,532 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 666kB
14. 141.967 391.120 ↑ 2.1 9,532 1

Hash Join (cost=989.16..3,291.11 rows=19,762 width=12) (actual time=123.475..391.120 rows=9,532 loops=1)

  • Hash Cond: (po_project_sub.id_project = po_project.id_project)
15. 125.726 125.726 ↓ 1.0 85,261 1

Seq Scan on po_project_sub (cost=0.00..1,784.60 rows=85,260 width=8) (actual time=0.023..125.726 rows=85,261 loops=1)

16. 18.918 123.427 ↓ 1.8 12,498 1

Hash (cost=904.15..904.15 rows=6,801 width=8) (actual time=123.426..123.427 rows=12,498 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 617kB
17. 60.726 104.509 ↓ 1.8 12,498 1

Hash Join (cost=27.69..904.15 rows=6,801 width=8) (actual time=1.184..104.509 rows=12,498 loops=1)

  • Hash Cond: (po_project.id_organization = org.id_organization)
18. 43.469 43.469 ↓ 1.0 29,343 1

Seq Scan on po_project (cost=0.00..698.42 rows=29,342 width=8) (actual time=0.018..43.469 rows=29,343 loops=1)

19. 0.111 0.314 ↑ 1.0 70 1

Hash (cost=26.81..26.81 rows=70 width=4) (actual time=0.313..0.314 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
20. 0.203 0.203 ↑ 1.0 70 1

Index Only Scan using po_organization_pkey on po_organization org (cost=0.15..26.81 rows=70 width=4) (actual time=0.016..0.203 rows=70 loops=1)

  • Index Cond: (id_organization = ANY ('{126,133,190,191,192,193,194,195,196,197,198,199,203,204,211,272,287,288,289,290,291,292,293,331,333,337,338,339,340,341,342,347,349,350,351,352,353,354,355,356,361,362,363,366,367,368,369,373,374,375,376,377,378,379,380,381,382,383,384,385,386,396,397,398,399,400,401,402,403,424}'::integer[]))
  • Heap Fetches: 70
21. 12,339.631 82,871.563 ↑ 1,223.5 50 1

Sort (cost=1,713,476.86..1,713,629.80 rows=61,176 width=1,680) (actual time=82,871.514..82,871.563 rows=50 loops=1)

  • Sort Key: _req.id_import_request DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 38kB
22. 17,566.726 70,531.932 ↓ 141.5 8,655,854 1

Merge Join (cost=1,709,482.05..1,711,444.64 rows=61,176 width=1,680) (actual time=43,370.910..70,531.932 rows=8,655,854 loops=1)

  • Merge Cond: (infra_col_data.id_infra_instan = _req.id_infra_instan)
23. 148.863 3,094.390 ↓ 2.7 35,521 1

Sort (cost=1,168.48..1,201.50 rows=13,211 width=1,576) (actual time=3,054.344..3,094.390 rows=35,521 loops=1)

  • Sort Key: infra_col_data.id_infra_instan
  • Sort Method: quicksort Memory: 18720kB
24. 2,945.527 2,945.527 ↓ 6.2 82,453 1

CTE Scan on infra_col_data (cost=0.00..264.22 rows=13,211 width=1,576) (actual time=2,494.619..2,945.527 rows=82,453 loops=1)

25. 27,738.993 49,870.816 ↓ 33.7 8,655,918 1

Sort (cost=1,708,313.57..1,708,955.96 rows=256,955 width=108) (actual time=40,316.554..49,870.816 rows=8,655,918 loops=1)

  • Sort Key: _req.id_infra_instan
  • Sort Method: external sort Disk: 1040712kB
26. 22,131.823 22,131.823 ↓ 33.7 8,655,918 1

Seq Scan on po_import_request_83 _req (cost=0.00..1,685,224.68 rows=256,955 width=108) (actual time=483.332..22,131.823 rows=8,655,918 loops=1)

  • Filter: (((ts_status_last_updated_at)::date >= '2018-01-01'::date) AND ((ts_status_last_updated_at)::date <= '2019-01-01'::date) AND ((nu_extraction_status / 1000) = ANY ('{8,4,9,0,7,5}'::integer[])))
  • Rows Removed by Filter: 23658865
Planning time : 2.304 ms
Execution time : 83,117.145 ms