explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SWEZ

Settings
# exclusive inclusive rows x rows loops node
1. 20.989 712.308 ↑ 5.6 2,591 1

HashAggregate (cost=25,934.87..26,151.40 rows=14,435 width=73) (actual time=709.452..712.308 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.338 691.319 ↑ 1.6 8,837 1

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

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

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

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

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

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

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

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

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

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

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

  • Buckets: 65536 Batches: 4 Memory Usage: 3612kB
9. 321.062 321.062 ↓ 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.050..321.062 rows=211,244 loops=1)

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

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

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

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

12. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on t_emp emp_1 (cost=0.00..1.01 rows=1 width=36) (actual time=0.006..0.007 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.122 0.237 ↑ 1.0 119 1

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

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

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

18. 0.266 0.578 ↑ 1.0 288 1

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

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

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

Planning time : 2.464 ms
Execution time : 715.068 ms