explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NQe4

Settings
# exclusive inclusive rows x rows loops node
1. 0.026 1,996.103 ↓ 5.0 10 1

Sort (cost=34.57..34.58 rows=2 width=44) (actual time=1,996.103..1,996.103 rows=10 loops=1)

  • Sort Key: (sum(po_monthly_flart.nu_low_flart_files)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.002 1,996.077 ↓ 5.0 10 1

Limit (cost=34.54..34.54 rows=2 width=44) (actual time=1,996.074..1,996.077 rows=10 loops=1)

3. 0.340 1,996.075 ↓ 5.0 10 1

Sort (cost=34.54..34.54 rows=2 width=44) (actual time=1,996.071..1,996.075 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. 76.227 1,995.735 ↓ 1,217.5 2,435 1

GroupAggregate (cost=34.45..34.53 rows=2 width=44) (actual time=1,887.866..1,995.735 rows=2,435 loops=1)

  • Group Key: po_project_sub.id_project
5. 115.897 1,919.508 ↓ 186,147.0 372,294 1

Sort (cost=34.45..34.45 rows=2 width=24) (actual time=1,887.826..1,919.508 rows=372,294 loops=1)

  • Sort Key: po_project_sub.id_project
  • Sort Method: quicksort Memory: 41,374kB
6. 216.849 1,803.611 ↓ 186,147.0 372,294 1

Nested Loop (cost=4.99..34.44 rows=2 width=24) (actual time=77.882..1,803.611 rows=372,294 loops=1)

7. 240.016 1,214.468 ↓ 186,147.0 372,294 1

Nested Loop (cost=4.57..33.51 rows=2 width=24) (actual time=77.858..1,214.468 rows=372,294 loops=1)

8. 33.416 602.161 ↓ 186,145.5 372,291 1

Append (cost=4.15..16.61 rows=2 width=24) (actual time=77.821..602.161 rows=372,291 loops=1)

9. 0.002 0.033 ↓ 0.0 0 1

Bitmap Heap Scan on po_monthly_flart (cost=4.15..8.18 rows=1 width=24) (actual time=0.033..0.033 rows=0 loops=1)

  • Recheck Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))
  • Filter: (id_enterprise = 83)
10. 0.031 0.031 ↓ 0.0 0 1

Bitmap Index Scan on index_monthly_to_id_tseries (cost=0.00..4.15 rows=1 width=0) (actual time=0.031..0.031 rows=0 loops=1)

  • Index Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))
11. 505.000 568.712 ↓ 372,291.0 372,291 1

Bitmap Heap Scan on po_monthly_flart_83 (cost=4.40..8.43 rows=1 width=24) (actual time=77.787..568.712 rows=372,291 loops=1)

  • Recheck Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))
  • Filter: (id_enterprise = 83)
  • Heap Blocks: exact=76,532
12. 63.712 63.712 ↓ 372,291.0 372,291 1

Bitmap Index Scan on po_monthly_flart_83_id_tseries_idx (cost=0.00..4.40 rows=1 width=0) (actual time=63.712..63.712 rows=372,291 loops=1)

  • Index Cond: (id_tseries = ((date_trunc('month'::text, (('now'::cstring)::date)::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))
13. 372.291 372.291 ↑ 1.0 1 372,291

Index Scan using index_po_proj_sub_infra_id_infra_instan on po_proj_sub_infra (cost=0.42..8.44 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=372,291)

  • Index Cond: (id_infra_instan = po_monthly_flart.id_infra_instan)
14. 372.294 372.294 ↑ 1.0 1 372,294

Index Scan using po_project_sub_id_project_sub_key on po_project_sub (cost=0.42..0.45 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=372,294)

  • Index Cond: (id_project_sub = po_proj_sub_infra.id_project_sub)
Planning time : 3.101 ms
Execution time : 1,999.321 ms