explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xsV2

Settings
# exclusive inclusive rows x rows loops node
1. 0.677 420.008 ↑ 1.0 1 1

Aggregate (cost=51,669.19..51,669.20 rows=1 width=0) (actual time=420.008..420.008 rows=1 loops=1)

2. 72.424 419.331 ↓ 317.4 12,061 1

Nested Loop (cost=0.85..51,669.09 rows=38 width=0) (actual time=330.232..419.331 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.171 ↓ 13.0 52 1

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

  • Join Filter: (e_lj.t_contrato_id = c.id)
  • Rows Removed by Join Filter: 156
4. 0.075 0.075 ↑ 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.005..0.075 rows=52 loops=1)

5. 0.047 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.005 0.005 ↑ 1.0 4 1

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

7. 27.799 346.736 ↓ 2.7 12,061 52

Materialize (cost=0.71..51,307.13 rows=4,450 width=12) (actual time=0.004..6.668 rows=12,061 loops=52)

8. 11.974 318.937 ↓ 2.7 12,061 1

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

9. 7.954 294.902 ↓ 2.7 12,061 1

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

10. 262.826 262.826 ↓ 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.192..262.826 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
11. 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)
12. 12.061 12.061 ↑ 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.001 rows=1 loops=12,061)

  • Index Cond: (id = cv.t_ro_adq_id)
Planning time : 1.308 ms
Execution time : 420.195 ms