explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8VTq

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 21,079.095 ↑ 1.0 10 1

Sort (cost=815,632.05..815,632.07 rows=10 width=44) (actual time=21,079.084..21,079.095 rows=10 loops=1)

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

Limit (cost=815,631.76..815,631.78 rows=10 width=44) (actual time=21,079.027..21,079.056 rows=10 loops=1)

3. 0.480 21,079.035 ↑ 1,000.2 10 1

Sort (cost=815,631.76..815,656.76 rows=10,002 width=44) (actual time=21,079.024..21,079.035 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. 52.887 21,078.555 ↑ 24.2 413 1

GroupAggregate (cost=815,015.54..815,415.62 rows=10,002 width=44) (actual time=20,981.144..21,078.555 rows=413 loops=1)

  • Group Key: po_project_sub.id_project
5. 103.201 21,025.668 ↓ 4.5 44,564 1

Sort (cost=815,015.54..815,040.54 rows=10,002 width=24) (actual time=20,979.209..21,025.668 rows=44,564 loops=1)

  • Sort Key: po_project_sub.id_project
  • Sort Method: quicksort Memory: 5,018kB
6. 194.705 20,922.467 ↓ 4.5 44,564 1

Nested Loop (cost=8,595.53..814,351.00 rows=10,002 width=24) (actual time=10,882.225..20,922.467 rows=44,564 loops=1)

7. 451.410 20,549.506 ↓ 4.5 44,564 1

Hash Join (cost=8,595.11..803,716.13 rows=10,002 width=24) (actual time=10,881.776..20,549.506 rows=44,564 loops=1)

  • Hash Cond: (po_monthly_flart.id_infra_instan = po_proj_sub_infra.id_infra_instan)
8. 742.895 20,033.934 ↓ 1.1 372,299 1

Append (cost=0.00..785,320.00 rows=337,426 width=24) (actual time=10,811.933..20,033.934 rows=372,299 loops=1)

9. 19,291.039 19,291.039 ↓ 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,811.928..19,291.039 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
  • Rows Removed by Filter: 18,928,664
10. 64.162 64.162 ↓ 1.1 14,149 1

Hash (cost=8,437.58..8,437.58 rows=12,602 width=8) (actual time=64.161..64.162 rows=14,149 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 681kB
  • -> Index Scan using index_po_proj_sub_infra_id_project_sub on po_proj_sub_infra (cost=0.42..8437.58 rows=12,602 width=8) (actual time=0.078..48.420 rows=14,149
  • Index Cond: (id_project_sub = ANY ('{184103,264124,162824,77767,165893,59212,264049,162825,54289,265050,57628,198430,264073,39487,57550,61110,62077,16282
11. 178.256 178.256 ↑ 1.0 1 44,564

Index Scan using po_project_sub_id_project_sub_key on po_project_sub (cost=0.42..1.05 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=44,564)

  • Index Cond: (id_project_sub = po_proj_sub_infra.id_project_sub)
Planning time : 16.605 ms
Execution time : 21,079.431 ms