explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NcSu

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 23,358.825 ↑ 1.0 10 1

Sort (cost=812,146.31..812,146.33 rows=10 width=44) (actual time=23,358.813..23,358.825 rows=10 loops=1)

  • Sort Key: (sum(po_monthly_flart.nu_low_flart_files)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.021 23,358.793 ↑ 1.0 10 1

Limit (cost=812,146.02..812,146.04 rows=10 width=44) (actual time=23,358.765..23,358.793 rows=10 loops=1)

3. 2.602 23,358.772 ↑ 3,528.8 10 1

Sort (cost=812,146.02..812,234.24 rows=35,288 width=44) (actual time=23,358.762..23,358.772 rows=10 loops=1)

  • Sort Key: po_project_sub.id_project, (sum(po_monthly_flart.nu_low_flart_files)) DESC
  • Sort Method: top-N heapsort Memory: 25kB
4. 425.586 23,356.170 ↑ 14.5 2,435 1

GroupAggregate (cost=809,751.68..811,383.46 rows=35,288 width=44) (actual time=22,561.776..23,356.170 rows=2,435 loops=1)

  • Group Key: po_project_sub.id_project
5. 801.065 22,930.584 ↓ 8.0 372,302 1

Sort (cost=809,751.68..809,867.43 rows=46,301 width=24) (actual time=22,561.745..22,930.584 rows=372,302 loops=1)

  • Sort Key: po_project_sub.id_project
  • Sort Method: quicksort Memory: 41,375kB
6. 785.911 22,129.519 ↓ 8.0 372,302 1

Hash Join (cost=18,271.72..806,163.64 rows=46,301 width=24) (actual time=12,178.330..22,129.519 rows=372,302 loops=1)

  • Hash Cond: (po_monthly_flart.id_infra_instan = po_proj_sub_infra.id_infra_instan)
7. 708.411 19,947.250 ↓ 1.1 372,299 1

Append (cost=0.00..785,320.00 rows=337,426 width=24) (actual time=10,781.880..19,947.250 rows=372,299 loops=1)

8. 19,238.839 19,238.839 ↓ 1.1 372,299 1

Seq Scan on po_monthly_flart (cost=0.00..785,320.00 rows=337,426 width=24) (actual time=10,781.874..19,238.839 rows=372,299 loops=1)

  • Filter: ((id_enterprise = 83) AND (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day':
  • Rows Removed by Filter: 18,928,664
9. 113.738 1,396.358 ↓ 1.8 102,827 1

Hash (cost=17,542.50..17,542.50 rows=58,337 width=8) (actual time=1,396.357..1,396.358 rows=102,827 loops=1)

  • Buckets: 131,072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 5,041kB
10. 539.013 1,282.620 ↓ 1.8 102,827 1

Hash Join (cost=8,027.93..17,542.50 rows=58,337 width=8) (actual time=320.747..1,282.620 rows=102,827 loops=1)

  • Hash Cond: (po_proj_sub_infra.id_project_sub = po_project_sub.id_project_sub)
11. 423.749 423.749 ↓ 1.0 443,935 1

Seq Scan on po_proj_sub_infra (cost=0.00..7,266.71 rows=443,871 width=8) (actual time=0.011..423.749 rows=443,935 loops=1)

12. 9.695 319.858 ↑ 2.1 8,963 1

Hash (cost=7,797.55..7,797.55 rows=18,430 width=8) (actual time=319.857..319.858 rows=8,963 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 607kB
13. 147.005 310.163 ↑ 2.1 8,963 1

Hash Join (cost=4,132.05..7,797.55 rows=18,430 width=8) (actual time=28.463..310.163 rows=8,963 loops=1)

  • Hash Cond: (po_project_sub.id_project = po_project.id_project)
14. 134.745 134.745 ↑ 1.0 140,169 1

Seq Scan on po_project_sub (cost=0.00..2,955.33 rows=140,233 width=8) (actual time=0.008..134.745 rows=140,169 loops=1)

15. 4.805 28.413 ↑ 1.0 4,738 1

Hash (cost=4,070.96..4,070.96 rows=4,887 width=4) (actual time=28.412..28.413 rows=4,738 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 231kB
16. 23.608 23.608 ↑ 1.0 4,738 1

Seq Scan on po_project (cost=0.00..4,070.96 rows=4,887 width=4) (actual time=0.183..23.608 rows=4,738 loops=1)

  • Filter: (id_organization = ANY ('{349,193,195,203,191,204,196,197,198,199,133,331,350,126,190,272,292,339,290,287,342,333,340,347,337,3
  • Rows Removed by Filter: 32,396
Planning time : 2.483 ms
Execution time : 23,362.854 ms