explain.depesz.com

PostgreSQL's explain analyze made readable

Result: is3W

Settings
# exclusive inclusive rows x rows loops node
1. 22.329 761.829 ↑ 5.6 2,591 1

HashAggregate (cost=25,934.87..26,151.40 rows=14,435 width=73) (actual time=758.801..761.829 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. 21.102 739.500 ↑ 1.6 8,837 1

Hash Left Join (cost=18,741.77..25,285.30 rows=14,435 width=73) (actual time=591.792..739.500 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. 18.720 717.806 ↑ 1.6 8,837 1

Hash Left Join (cost=18,732.29..25,005.16 rows=14,435 width=81) (actual time=591.180..717.806 rows=8,837 loops=1)

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

Hash Left Join (cost=18,728.61..24,803.00 rows=14,435 width=81) (actual time=590.906..698.833 rows=8,837 loops=1)

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

Hash Join (cost=18,712.76..24,733.01 rows=14,435 width=77) (actual time=590.878..681.180 rows=8,837 loops=1)

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

Hash Join (cost=18,710.51..24,478.14 rows=14,435 width=80) (actual time=590.792..660.135 rows=8,837 loops=1)

  • Hash Cond: (parc.t_cv_erp_id = erp.id)
7. 22.945 22.945 ↓ 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.022..22.945 rows=14,847 loops=1)

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

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

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

Seq Scan on t_cv_erp erp (cost=0.00..14,629.54 rows=211,004 width=31) (actual time=0.053..346.075 rows=211,244 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.020 0.038 ↑ 1.0 7 1

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

12. 0.008 0.008 ↑ 1.0 1 1

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

13. 0.010 0.010 ↑ 1.0 7 1

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

14. 0.003 0.004 ↓ 0.0 0 1

Hash (cost=12.60..12.60 rows=260 width=8) (actual time=0.004..0.004 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.134 0.253 ↑ 1.0 119 1

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

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

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

18. 0.305 0.592 ↑ 1.0 288 1

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

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

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

Planning time : 2.425 ms
Execution time : 764.487 ms