explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Zb1

Settings
# exclusive inclusive rows x rows loops node
1. 0.685 488.128 ↑ 1.0 1 1

Aggregate (cost=51,731.69..51,731.70 rows=1 width=0) (actual time=488.128..488.128 rows=1 loops=1)

2. 69.557 487.443 ↓ 317.4 12,061 1

Nested Loop (cost=2.17..51,731.60 rows=38 width=0) (actual time=402.747..487.443 rows=12,061 loops=1)

  • Join Filter: ((cv.dt_venda_aj >= c.dt_inicio) AND (cv.dt_venda_aj <= c.dt_final) AND (e_lj.t_estab_adq_id = ro.t_estab_adq_id))
  • Rows Removed by Join Filter: 615,111
3. 0.044 0.170 ↓ 13.0 52 1

Nested Loop (cost=0.14..17.09 rows=4 width=20) (actual time=0.022..0.170 rows=52 loops=1)

  • Join Filter: (e_lj.t_contrato_id = c.id)
  • Rows Removed by Join Filter: 156
4. 0.074 0.074 ↑ 1.0 52 1

Index Scan using fk_t_estab_adq_estabel1_idx on t_estab_adq_loja_contrato e_lj (cost=0.14..12.92 rows=52 width=12) (actual time=0.006..0.074 rows=52 loops=1)

5. 0.046 0.052 ↑ 1.0 4 52

Materialize (cost=0.00..1.06 rows=4 width=20) (actual time=0.000..0.001 rows=4 loops=52)

6. 0.006 0.006 ↑ 1.0 4 1

Seq Scan on t_contrato c (cost=0.00..1.04 rows=4 width=20) (actual time=0.004..0.006 rows=4 loops=1)

7. 26.967 417.716 ↓ 2.7 12,061 52

Materialize (cost=2.03..51,369.63 rows=4,450 width=16) (actual time=0.007..8.033 rows=12,061 loops=52)

8. 4.457 390.749 ↓ 2.7 12,061 1

Hash Join (cost=2.03..51,347.38 rows=4,450 width=16) (actual time=0.361..390.749 rows=12,061 loops=1)

  • Hash Cond: (ro.t_estab_adq_id = est.id)
9. 2.218 386.281 ↓ 2.7 12,061 1

Nested Loop (cost=0.71..51,284.88 rows=4,450 width=12) (actual time=0.340..386.281 rows=12,061 loops=1)

10. 12.356 359.941 ↓ 2.7 12,061 1

Nested Loop (cost=0.42..49,736.02 rows=4,450 width=12) (actual time=0.333..359.941 rows=12,061 loops=1)

11. 323.463 323.463 ↓ 2.7 12,061 1

Seq Scan on t_parcelas_adq parc (cost=0.00..29,425.52 rows=4,450 width=8) (actual time=0.317..323.463 rows=12,061 loops=1)

  • Filter: (CASE WHEN ((fl_conc_pagto)::text ~~ 'LIQUIDADO%'::text) THEN dt_pagto WHEN (nova_data IS NOT NULL) THEN nova_data ELSE data_vencimento END = '2020-09-14 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 877,907
12. 24.122 24.122 ↑ 1.0 1 12,061

Index Scan using t_cv_adq_pkey on t_cv_adq cv (cost=0.42..4.55 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=12,061)

  • Index Cond: (id = parc.t_cv_adq_id)
13. 24.122 24.122 ↑ 1.0 1 12,061

Index Scan using t_ro_adq_pkey on t_ro_adq ro (cost=0.29..0.34 rows=1 width=28) (actual time=0.001..0.002 rows=1 loops=12,061)

  • Index Cond: (id = cv.t_ro_adq_id)
14. 0.003 0.011 ↑ 1.0 14 1

Hash (cost=1.14..1.14 rows=14 width=4) (actual time=0.011..0.011 rows=14 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.008 0.008 ↑ 1.0 14 1

Seq Scan on t_estab_adq est (cost=0.00..1.14 rows=14 width=4) (actual time=0.002..0.008 rows=14 loops=1)

Planning time : 2.050 ms
Execution time : 488.372 ms