explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HR4G

Settings
# exclusive inclusive rows x rows loops node
1. 0.055 2,642.311 ↑ 1.0 10 1

Sort (cost=270,777.34..270,777.36 rows=10 width=44) (actual time=2,642.300..2,642.311 rows=10 loops=1)

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

Limit (cost=270,777.05..270,777.07 rows=10 width=44) (actual time=2,642.227..2,642.256 rows=10 loops=1)

3. 0.086 2,642.233 ↑ 2.5 10 1

Sort (cost=270,777.05..270,777.11 rows=25 width=44) (actual time=2,642.223..2,642.233 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. 3.782 2,642.147 ↓ 2.0 49 1

GroupAggregate (cost=270,775.51..270,776.51 rows=25 width=44) (actual time=2,635.192..2,642.147 rows=49 loops=1)

  • Group Key: po_project_sub.id_project
5. 7.421 2,638.365 ↓ 124.3 3,107 1

Sort (cost=270,775.51..270,775.57 rows=25 width=24) (actual time=2,635.160..2,638.365 rows=3,107 loops=1)

  • Sort Key: po_project_sub.id_project
  • Sort Method: quicksort Memory: 339kB
6. 11.763 2,630.944 ↓ 124.3 3,107 1

Nested Loop (cost=15,527.97..270,774.93 rows=25 width=24) (actual time=235.489..2,630.944 rows=3,107 loops=1)

7. 91.514 2,606.753 ↓ 16.2 3,107 1

Nested Loop (cost=15,527.68..270,527.12 rows=192 width=24) (actual time=235.457..2,606.753 rows=3,107 loops=1)

8. 441.259 2,158.727 ↓ 4.5 44,564 1

Hash Join (cost=15,527.26..247,589.78 rows=10,002 width=24) (actual time=128.550..2,158.727 rows=44,564 loops=1)

  • Hash Cond: (po_monthly_flart.id_infra_instan = po_proj_sub_infra.id_infra_instan)
9. 728.028 1,676.581 ↓ 1.1 372,299 1

Append (cost=6,932.15..229,193.71 rows=337,424 width=24) (actual time=86.451..1,676.581 rows=372,299 loops=1)

10. 879.086 948.553 ↓ 1.1 372,299 1

Bitmap Heap Scan on po_monthly_flart (cost=6,932.15..229,193.71 rows=337,424 width=24) (actual time=86.447..948.553 rows=372,299 loops=1)

  • Recheck Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::interva
  • Filter: (id_enterprise = 83)
  • Heap Blocks: exact=81,274
11. 69.467 69.467 ↓ 1.0 372,299 1

Bitmap Index Scan on index_monthly_to_id_tseries (cost=0.00..6,847.80 rows=370,579 width=0) (actual time=69.466..69.467 rows=372,299 loops=1)

  • Index Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::int
12. 40.887 40.887 ↓ 1.1 14,149 1

Hash (cost=8,437.58..8,437.58 rows=12,602 width=8) (actual time=40.886..40.887 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.041..25.286 rows
  • Index Cond: (id_project_sub = ANY ('{184103,264124,162824,77767,165893,59212,264049,162825,54289,265050,57628,198430,264073,39487,57550,61110,62077
13. 356.512 356.512 ↓ 0.0 0 44,564

Index Scan using po_project_sub_id_project_sub_key on po_project_sub (cost=0.42..2.28 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=44,564)

  • Index Cond: (id_project_sub = po_proj_sub_infra.id_project_sub)
  • Filter: (id_project = ANY ('{15905,9194,2719,2720,10187,10189,9695,9694,10470,10472,10498,10543,15829,15831,15832,15833,15835,15836,15837,15838,15839,15842,159
  • Rows Removed by Filter: 1
14. 12.428 12.428 ↑ 1.0 1 3,107

Index Scan using po_project_pkey on po_project (cost=0.29..1.28 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=3,107)

  • Index Cond: (id_project = po_project_sub.id_project)
  • 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,341,351,356,355,354,353,192,194
Planning time : 33.023 ms
Execution time : 2,643.639 ms