explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sYeT : Optimization for: plan #nMza

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 3.997 332.199 ↓ 1,909.0 1,909 1

HashAggregate (cost=187.66..187.94 rows=1 width=39) (actual time=331.364..332.199 rows=1,909 loops=1)

  • Group Key: cm.id_meter, pci.code_integrator_meter_type, pci.min_reading_value, pci.max_reading_value, pci.previous_reading_value, (cvpc.kmaxima)::numeric(7,3), 'load_process_itine'::text, now(), f_pci_get_integrator_meter_sort((pci.code_integrator_meter_type)::integer), (trunc(ped.contracted_power, 0))::bigint
2. 90.888 328.202 ↓ 1,909.0 1,909 1

Nested Loop (cost=50.76..187.64 rows=1 width=39) (actual time=14.633..328.202 rows=1,909 loops=1)

3. 2.276 214.406 ↓ 1,909.0 1,909 1

Nested Loop (cost=50.33..178.90 rows=1 width=41) (actual time=11.429..214.406 rows=1,909 loops=1)

  • Join Filter: ((cvpc.code_meter)::text = (cm.code_meter)::text)
4. 1.169 158.678 ↓ 1,909.0 1,909 1

Nested Loop (cost=49.91..178.45 rows=1 width=69) (actual time=10.634..158.678 rows=1,909 loops=1)

5. 2.323 5.631 ↓ 12.8 102 1

Bitmap Heap Scan on v_m_pci_principal_carga cvpc (cost=40.51..71.08 rows=8 width=43) (actual time=4.198..5.631 rows=102 loops=1)

  • Recheck Cond: ((grupo = 101655) AND (territorio = 'ERZ'::text))
  • Heap Blocks: exact=37
6. 0.008 3.308 ↓ 0.0 0 1

BitmapAnd (cost=40.51..40.51 rows=8 width=0) (actual time=3.308..3.308 rows=0 loops=1)

7. 0.518 0.518 ↑ 1.0 102 1

Bitmap Index Scan on in_v_m_pci_principal_carga_grupo (cost=0.00..5.05 rows=102 width=0) (actual time=0.518..0.518 rows=102 loops=1)

  • Index Cond: (grupo = 101655)
8. 2.782 2.782 ↑ 1.0 1,456 1

Bitmap Index Scan on in_v_m_pci_principal_carga_territorio (cost=0.00..35.21 rows=1,456 width=0) (actual time=2.782..2.782 rows=1,456 loops=1)

  • Index Cond: (territorio = 'ERZ'::text)
9. 67.626 151.878 ↓ 19.0 19 102

Bitmap Heap Scan on pln_cmc_integrator pci (cost=9.40..13.41 rows=1 width=42) (actual time=1.250..1.489 rows=19 loops=102)

  • Recheck Cond: ((id_cmc_meter = cvpc.id_cmc_meter) AND ((code_meter)::text = (cvpc.code_meter)::text))
  • Heap Blocks: exact=261
10. 0.176 84.252 ↓ 0.0 0 102

BitmapAnd (cost=9.40..9.40 rows=1 width=0) (actual time=0.826..0.826 rows=0 loops=102)

11. 14.790 14.790 ↓ 2.1 19 102

Bitmap Index Scan on in_pln_cmc_integrator_id_cmc_meter (cost=0.00..4.50 rows=9 width=0) (actual time=0.145..0.145 rows=19 loops=102)

  • Index Cond: (id_cmc_meter = cvpc.id_cmc_meter)
12. 69.286 69.286 ↓ 1.8 20 98

Bitmap Index Scan on idx_pln_cmc_integrator (cost=0.00..4.64 rows=11 width=0) (actual time=0.707..0.707 rows=20 loops=98)

  • Index Cond: ((code_meter)::text = (cvpc.code_meter)::text)
13. 53.452 53.452 ↑ 1.0 1 1,909

Index Scan using in_cmc_meter_code_meter on cmc_meter cm (cost=0.42..0.44 rows=1 width=26) (actual time=0.027..0.028 rows=1 loops=1,909)

  • Index Cond: ((code_meter)::text = (pci.code_meter)::text)
14. 22.908 22.908 ↑ 1.0 1 1,909

Index Scan using pk_extractor_detail on pln_extractor_detail ped (cost=0.43..8.45 rows=1 width=14) (actual time=0.011..0.012 rows=1 loops=1,909)

  • Index Cond: (id_extractor_detail = cvpc.id_extractor_detail)