explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xmvh

Settings
# exclusive inclusive rows x rows loops node
1. 0.119 11,837.007 ↑ 1.0 50 1

Limit (cost=1,913,317.91..1,913,318.04 rows=50 width=1,678) (actual time=11,836.837..11,837.007 rows=50 loops=1)

2.          

CTE infra_col_data

3. 160.009 2,294.814 ↓ 6.2 82,454 1

Unique (cost=28,049.08..28,115.42 rows=13,267 width=174) (actual time=2,037.015..2,294.814 rows=82,454 loops=1)

4. 238.985 2,134.805 ↓ 6.4 84,268 1

Sort (cost=28,049.08..28,082.25 rows=13,267 width=174) (actual time=2,037.012..2,134.805 rows=84,268 loops=1)

  • Sort Key: po_infra_instan.id_infra_instan
  • Sort Method: external merge Disk: 11520kB
5. 212.326 1,895.820 ↓ 6.4 84,268 1

Hash Join (cost=10,514.34..27,140.59 rows=13,267 width=174) (actual time=982.481..1,895.820 rows=84,268 loops=1)

  • Hash Cond: (po_infra_instan.id_infra_instan = po_proj_sub_infra.id_infra_instan)
6. 345.117 701.986 ↓ 1.5 84,771 1

Hash Join (cost=20.84..15,583.75 rows=57,272 width=162) (actual time=0.296..701.986 rows=84,771 loops=1)

  • Hash Cond: (po_infra_instan.id_connector_details = po_connector_details.id_connector_details)
7. 356.629 356.629 ↑ 1.0 274,442 1

Seq Scan on po_infra_instan (cost=0.00..13,960.92 rows=274,472 width=162) (actual time=0.015..356.629 rows=274,442 loops=1)

  • Filter: (NOT bl_marked_for_deletion)
  • Rows Removed by Filter: 233
8. 0.057 0.240 ↑ 1.0 53 1

Hash (cost=20.18..20.18 rows=53 width=4) (actual time=0.239..0.240 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
9. 0.183 0.183 ↑ 1.0 53 1

Seq Scan on po_connector_details (cost=0.00..20.18 rows=53 width=4) (actual time=0.012..0.183 rows=53 loops=1)

  • Filter: (id_enterprise = 83)
  • Rows Removed by Filter: 202
10. 92.795 981.508 ↓ 1.3 84,697 1

Hash (cost=9,698.11..9,698.11 rows=63,631 width=16) (actual time=981.507..981.508 rows=84,697 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 2 (originally 1) Memory Usage: 3073kB
11. 353.898 888.713 ↓ 1.3 84,697 1

Hash Join (cost=3,538.13..9,698.11 rows=63,631 width=16) (actual time=270.936..888.713 rows=84,697 loops=1)

  • Hash Cond: (po_proj_sub_infra.id_project_sub = po_project_sub.id_project_sub)
12. 264.136 264.136 ↓ 1.0 274,533 1

Seq Scan on po_proj_sub_infra (cost=0.00..4,494.22 rows=274,522 width=8) (actual time=0.012..264.136 rows=274,533 loops=1)

13. 10.005 270.679 ↑ 2.1 9,532 1

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

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

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

  • Hash Cond: (po_project_sub.id_project = po_project.id_project)
15. 83.635 83.635 ↓ 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.012..83.635 rows=85,261 loops=1)

16. 12.729 83.574 ↓ 1.8 12,498 1

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

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

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

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

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

19. 0.075 0.208 ↑ 1.0 70 1

Hash (cost=26.81..26.81 rows=70 width=4) (actual time=0.207..0.208 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
20. 0.133 0.133 ↑ 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.011..0.133 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. 227.179 11,836.888 ↑ 17.6 50 1

Sort (cost=1,885,202.49..1,885,204.70 rows=882 width=1,678) (actual time=11,836.833..11,836.888 rows=50 loops=1)

  • Sort Key: _req.id_import_request DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 50kB
22. 498.240 11,609.709 ↓ 173.9 153,377 1

Hash Join (cost=34,872.00..1,885,173.20 rows=882 width=1,678) (actual time=3,086.736..11,609.709 rows=153,377 loops=1)

  • Hash Cond: (_req.id_infra_instan = infra_col_data.id_infra_instan)
23. 8,108.701 8,525.163 ↓ 20.2 198,759 1

Bitmap Heap Scan on po_import_request _req (cost=31,848.82..1,862,879.48 rows=9,837 width=106) (actual time=425.284..8,525.163 rows=198,759 loops=1)

  • Recheck Cond: ((nu_extraction_status / 1000) = ANY ('{8,4,9,0,7}'::integer[]))
  • Rows Removed by Index Recheck: 16031394
  • Filter: (((ts_status_last_updated_at)::date >= '2019-03-01'::date) AND ((ts_status_last_updated_at)::date <= '2019-04-01'::date))
  • Rows Removed by Filter: 3283225
  • Heap Blocks: exact=36778 lossy=426069
24. 416.462 416.462 ↓ 1.8 3,481,991 1

Bitmap Index Scan on idx_po_import_request_nu_extraction_status (cost=0.00..31,846.36 rows=1,967,496 width=0) (actual time=416.460..416.462 rows=3,481,991 loops=1)

  • Index Cond: ((nu_extraction_status / 1000) = ANY ('{8,4,9,0,7}'::integer[]))
25. 108.203 2,586.306 ↓ 6.2 82,454 1

Hash (cost=265.34..265.34 rows=13,267 width=1,576) (actual time=2,586.304..2,586.306 rows=82,454 loops=1)

  • Buckets: 4096 Batches: 8 Memory Usage: 1604kB
26. 2,478.103 2,478.103 ↓ 6.2 82,454 1

CTE Scan on infra_col_data (cost=0.00..265.34 rows=13,267 width=1,576) (actual time=2,037.021..2,478.103 rows=82,454 loops=1)

Planning time : 1.615 ms
Execution time : 11,842.813 ms