explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z5qj

Settings
# exclusive inclusive rows x rows loops node
1. 0.106 5,389.827 ↑ 1.0 50 1

Limit (cost=122,475.47..122,475.60 rows=50 width=1,678) (actual time=5,389.658..5,389.827 rows=50 loops=1)

  • Buffers: shared hit=40,175 read=77,887 written=1, temp read=9,429 written=11,348
2.          

CTE infra_col_data

3. 162.774 2,381.325 ↓ 6.2 82,454 1

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

  • Buffers: shared hit=92 read=14,309, temp read=2,297 written=2,295
4. 247.779 2,218.551 ↓ 6.4 84,268 1

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

  • Sort Key: po_infra_instan.id_infra_instan
  • Sort Method: external merge Disk: 11,520kB
  • Buffers: shared hit=92 read=14,309, temp read=2,297 written=2,295
5. 244.772 1,970.772 ↓ 6.4 84,268 1

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

  • Hash Cond: (po_infra_instan.id_infra_instan = po_proj_sub_infra.id_infra_instan)
  • Buffers: shared hit=92 read=14,309, temp read=854 written=852
6. 356.973 728.955 ↓ 1.5 84,771 1

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

  • Hash Cond: (po_infra_instan.id_connector_details = po_connector_details.id_connector_details)
  • Buffers: shared hit=4 read=11,227
7. 371.718 371.718 ↑ 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.016..371.718 rows=274,442 loops=1)

  • Filter: (NOT bl_marked_for_deletion)
  • Rows Removed by Filter: 233
  • Buffers: shared hit=3 read=11,211
8. 0.062 0.264 ↑ 1.0 53 1

Hash (cost=20.18..20.18 rows=53 width=4) (actual time=0.263..0.264 rows=53 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1 read=16
9. 0.202 0.202 ↑ 1.0 53 1

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

  • Filter: (id_enterprise = 83)
  • Rows Removed by Filter: 202
  • Buffers: shared hit=1 read=16
10. 96.256 997.045 ↓ 1.3 84,697 1

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

  • Buckets: 131,072 (originally 65536) Batches: 2 (originally 1) Memory Usage: 3,073kB
  • Buffers: shared hit=88 read=3,082, temp written=185
11. 358.341 900.789 ↓ 1.3 84,697 1

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

  • Hash Cond: (po_proj_sub_infra.id_project_sub = po_project_sub.id_project_sub)
  • Buffers: shared hit=88 read=3,082
12. 267.228 267.228 ↓ 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.013..267.228 rows=274,533 loops=1)

  • Buffers: shared hit=3 read=1,746
13. 10.289 275.220 ↑ 2.1 9,532 1

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

  • Buckets: 32,768 Batches: 1 Memory Usage: 666kB
  • Buffers: shared hit=85 read=1,336
14. 94.933 264.931 ↑ 2.1 9,532 1

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

  • Hash Cond: (po_project_sub.id_project = po_project.id_project)
  • Buffers: shared hit=85 read=1,336
15. 85.216 85.216 ↓ 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.014..85.216 rows=85,261 loops=1)

  • Buffers: shared hit=1 read=931
16. 13.037 84.782 ↓ 1.8 12,498 1

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

  • Buckets: 16,384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 617kB
  • Buffers: shared hit=84 read=405
17. 41.453 71.745 ↓ 1.8 12,498 1

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

  • Hash Cond: (po_project.id_organization = org.id_organization)
  • Buffers: shared hit=84 read=405
18. 30.062 30.062 ↓ 1.0 29,343 1

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

  • Buffers: shared hit=2 read=403
19. 0.078 0.230 ↑ 1.0 70 1

Hash (cost=26.81..26.81 rows=70 width=4) (actual time=0.229..0.230 rows=70 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=82 read=2
20. 0.152 0.152 ↑ 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.152 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
  • Buffers: shared hit=82 read=2
21. 215.727 5,389.721 ↑ 17.6 50 1

Sort (cost=94,360.06..94,362.26 rows=882 width=1,678) (actual time=5,389.655..5,389.721 rows=50 loops=1)

  • Sort Key: _req.id_import_request DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 50kB
  • Buffers: shared hit=40,175 read=77,887 written=1, temp read=9,429 written=11,348
22. 396.117 5,173.994 ↓ 173.9 153,377 1

Merge Join (cost=94,206.42..94,330.76 rows=882 width=1,678) (actual time=4,517.665..5,173.994 rows=153,377 loops=1)

  • Merge Cond: (infra_col_data.id_infra_instan = _req.id_infra_instan)
  • Buffers: shared hit=40,175 read=77,887 written=1, temp read=9,429 written=11,348
23. 208.263 2,777.438 ↓ 3.8 50,025 1

Sort (cost=10,245.83..10,279.00 rows=13,267 width=1,576) (actual time=2,721.297..2,777.438 rows=50,025 loops=1)

  • Sort Key: infra_col_data.id_infra_instan
  • Sort Method: external sort Disk: 10,880kB
  • Buffers: shared hit=92 read=14,309, temp read=3,148 written=5,067
24. 2,569.175 2,569.175 ↓ 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,118.656..2,569.175 rows=82,454 loops=1)

  • Buffers: shared hit=92 read=14,309, temp read=2,297 written=3,707
25. 604.336 2,000.439 ↓ 20.2 198,759 1

Sort (cost=83,960.58..83,985.17 rows=9,837 width=106) (actual time=1,787.218..2,000.439 rows=198,759 loops=1)

  • Sort Key: _req.id_infra_instan
  • Sort Method: external sort Disk: 25,104kB
  • Buffers: shared hit=40,083 read=63,578 written=1, temp read=6,281 written=6,281
26. 483.083 1,396.103 ↓ 20.2 198,759 1

Bitmap Heap Scan on po_import_request _req (cost=46,030.98..83,308.19 rows=9,837 width=106) (actual time=920.800..1,396.103 rows=198,759 loops=1)

  • Recheck Cond: (((ts_status_last_updated_at)::date >= '2019-03-01'::date) AND ((ts_status_last_updated_at)::date <= '2019-04-01'::date) AND ((nu_extraction_status / 1000) = ANY ('{8,4,9,0,7}'::integer[])))
  • Heap Blocks: exact=36,159
  • Buffers: shared hit=40,083 read=63,578 written=1
27. 913.020 913.020 ↓ 20.2 198,759 1

Bitmap Index Scan on idx_po_import_request_ts_status_last_updated_at_extraction (cost=0.00..46,028.53 rows=9,837 width=0) (actual time=913.018..913.020 rows=198,759 loops=1)

  • Index Cond: (((ts_status_last_updated_at)::date >= '2019-03-01'::date) AND ((ts_status_last_updated_at)::date <= '2019-04-01'::date) AND ((nu_extraction_status / 1000) = ANY ('{8,4,9,0,7}'::integer[])))
  • Buffers: shared hit=40,083 read=27,419 written=1
Planning time : 1.649 ms
Execution time : 5,406.972 ms