explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 05Jm

Settings
# exclusive inclusive rows x rows loops node
1. 20.782 999.082 ↑ 5.6 2,591 1

HashAggregate (cost=25,934.87..26,151.40 rows=14,435 width=73) (actual time=996.424..999.082 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. 18.931 978.300 ↑ 1.6 8,837 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.022 7.889 ↑ 1.0 7 1

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

12. 0.385 0.385 ↑ 1.0 1 1

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

13. 7.482 7.482 ↑ 1.0 7 1

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

14. 0.002 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.002 0.002 ↓ 0.0 0 1

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

16. 0.173 0.356 ↑ 1.0 119 1

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

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

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

18. 0.338 0.708 ↑ 1.0 288 1

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

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

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

Planning time : 44.894 ms
Execution time : 1,001.411 ms