explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pPTm

Settings
# exclusive inclusive rows x rows loops node
1. 20.721 778.858 ↑ 5.6 2,591 1

HashAggregate (cost=25,940.04..26,156.73 rows=14,446 width=73) (actual time=776.119..778.858 rows=2,591 loops=1)

  • Group Key: adq_1.id, emp_1.id, erp.t_band_id, CASE WHEN ((parc.fl_conc_pagto)::text = 'LIQUIDADO'::text) THEN parc.dt_pagto WHEN (((parc.fl_conc_pagto)::text <> 'LIQUIDADO'::text) AND (parc.nova_data IS NOT NULL)) THEN parc.nova_data ELSE parc.data_vencimento END, erp.t_tp_band_id, CASE WHEN (parc.t_estab_pagto_id IS NOT NULL) THEN parc.t_estab_pagto_id ELSE e.id END
2. 19.254 758.137 ↑ 1.6 8,837 1

Hash Left Join (cost=18,744.74..25,289.97 rows=14,446 width=73) (actual time=579.543..758.137 rows=8,837 loops=1)

  • Hash Cond: (CASE WHEN (erp.t_pos_id IS NOT NULL) THEN p.t_estab_adq_id ELSE v.t_estab_adq_id END = e.id)
3. 16.982 738.345 ↑ 1.6 8,837 1

Hash Left Join (cost=18,735.26..25,009.63 rows=14,446 width=81) (actual time=578.985..738.345 rows=8,837 loops=1)

  • Hash Cond: (erp.t_pdv_id = v.id)
4. 16.160 721.160 ↑ 1.6 8,837 1

Hash Left Join (cost=18,731.59..24,807.32 rows=14,446 width=81) (actual time=578.767..721.160 rows=8,837 loops=1)

  • Hash Cond: (erp.t_pos_id = p.id)
5. 19.026 704.997 ↑ 1.6 8,837 1

Hash Join (cost=18,715.74..24,737.29 rows=14,446 width=77) (actual time=578.742..704.997 rows=8,837 loops=1)

  • Hash Cond: (((erp.origem)::text = (adq_1.nm_fantasia)::text) AND (erp.cod_emp = emp_1.cod_emp))
6. 89.588 685.906 ↑ 1.6 8,837 1

Hash Join (cost=18,713.48..24,482.23 rows=14,446 width=80) (actual time=578.619..685.906 rows=8,837 loops=1)

  • Hash Cond: (parc.t_cv_erp_id = erp.id)
7. 23.032 23.032 ↓ 1.0 14,847 1

Index Scan using t_parc_erp_fl_conc_banco_idx on t_parcelas_erp parc (cost=0.42..3,809.57 rows=14,703 width=57) (actual time=0.033..23.032 rows=14,847 loops=1)

  • Index Cond: ((fl_conc_banco)::text = ANY ('{N,INCONSISTENCIA}'::text[]))
8. 257.523 573.286 ↓ 1.0 211,244 1

Hash (cost=14,629.54..14,629.54 rows=211,162 width=31) (actual time=573.286..573.286 rows=211,244 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 3612kB
9. 315.763 315.763 ↓ 1.0 211,244 1

Seq Scan on t_cv_erp erp (cost=0.00..14,629.54 rows=211,162 width=31) (actual time=0.013..315.763 rows=211,244 loops=1)

  • Filter: ((fl_conc_venda)::text ~~ 'CONC%'::text)
  • Rows Removed by Filter: 3679
10. 0.029 0.065 ↑ 1.0 7 1

Hash (cost=2.15..2.15 rows=7 width=148) (actual time=0.065..0.065 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.023 0.036 ↑ 1.0 7 1

Nested Loop (cost=0.00..2.15 rows=7 width=148) (actual time=0.014..0.036 rows=7 loops=1)

12. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on t_emp emp_1 (cost=0.00..1.01 rows=1 width=36) (actual time=0.005..0.006 rows=1 loops=1)

13. 0.007 0.007 ↑ 1.0 7 1

Seq Scan on t_adq adq_1 (cost=0.00..1.07 rows=7 width=112) (actual time=0.002..0.007 rows=7 loops=1)

14. 0.002 0.003 ↓ 0.0 0 1

Hash (cost=12.60..12.60 rows=260 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
15. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on t_pos p (cost=0.00..12.60 rows=260 width=8) (actual time=0.001..0.001 rows=0 loops=1)

16. 0.104 0.203 ↑ 1.0 119 1

Hash (cost=2.19..2.19 rows=119 width=8) (actual time=0.203..0.203 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
17. 0.099 0.099 ↑ 1.0 119 1

Seq Scan on t_pdv v (cost=0.00..2.19 rows=119 width=8) (actual time=0.007..0.099 rows=119 loops=1)

18. 0.270 0.538 ↑ 1.0 288 1

Hash (cost=5.88..5.88 rows=288 width=4) (actual time=0.538..0.538 rows=288 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
19. 0.268 0.268 ↑ 1.0 288 1

Seq Scan on t_estab_adq e (cost=0.00..5.88 rows=288 width=4) (actual time=0.006..0.268 rows=288 loops=1)

Planning time : 2.482 ms
Execution time : 781.378 ms