explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sTWc

Settings
# exclusive inclusive rows x rows loops node
1. 0.054 26,166.248 ↑ 1.0 10 1

Sort (cost=828,545.16..828,545.18 rows=10 width=44) (actual time=26,166.234..26,166.248 rows=10 loops=1)

  • Sort Key: (sum(po_monthly_flart.nu_low_flart_files)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.028 26,166.194 ↑ 1.0 10 1

Limit (cost=828,544.87..828,544.89 rows=10 width=44) (actual time=26,166.156..26,166.194 rows=10 loops=1)

3. 3.642 26,166.166 ↑ 3,528.8 10 1

Sort (cost=828,544.87..828,633.09 rows=35,288 width=44) (actual time=26,166.152..26,166.166 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. 524.971 26,162.524 ↑ 14.5 2,435 1

HashAggregate (cost=827,076.55..827,782.31 rows=35,288 width=44) (actual time=26,157.563..26,162.524 rows=2,435 loops=1)

  • Group Key: po_project_sub.id_project
5. 835.420 25,637.553 ↓ 1.1 372,302 1

Hash Join (cost=17,523.34..820,911.37 rows=352,296 width=24) (actual time=14,040.955..25,637.553 rows=372,302 loops=1)

  • Hash Cond: (po_proj_sub_infra.id_project_sub = po_project_sub.id_project_sub)
6. 850.349 24,481.440 ↓ 1.1 372,302 1

Hash Join (cost=12,815.10..811,359.05 rows=352,296 width=24) (actual time=13,719.107..24,481.440 rows=372,302 loops=1)

  • Hash Cond: (po_monthly_flart.id_infra_instan = po_proj_sub_infra.id_infra_instan)
7. 766.532 22,633.817 ↓ 1.1 372,299 1

Append (cost=0.00..785,320.00 rows=337,426 width=24) (actual time=12,719.458..22,633.817 rows=372,299 loops=1)

8. 21,867.285 21,867.285 ↓ 1.1 372,299 1

Seq Scan on po_monthly_flart (cost=0.00..785,320.00 rows=337,426 width=24) (actual time=12,719.451..21,867.285 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. 520.904 997.274 ↓ 1.0 443,935 1

Hash (cost=7,266.71..7,266.71 rows=443,871 width=8) (actual time=997.272..997.274 rows=443,935 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 21,438kB
10. 476.370 476.370 ↓ 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.013..476.370 rows=443,935 loops=1)

11. 164.547 320.693 ↑ 1.0 140,168 1

Hash (cost=2,955.33..2,955.33 rows=140,233 width=8) (actual time=320.692..320.693 rows=140,168 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 7,524kB
12. 156.146 156.146 ↑ 1.0 140,168 1

Seq Scan on po_project_sub (cost=0.00..2,955.33 rows=140,233 width=8) (actual time=0.013..156.146 rows=140,168 loops=1)

Planning time : 1.921 ms
Execution time : 26,166.864 ms