explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yFyj

Settings
# exclusive inclusive rows x rows loops node
1. 0.811 434.621 ↑ 1.0 1 1

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

2. 84.293 433.810 ↓ 317.4 12,061 1

Nested Loop (cost=0.85..51,669.09 rows=38 width=4) (actual time=338.466..433.810 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.053 0.181 ↓ 13.0 52 1

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

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

7. 30.757 349.336 ↓ 2.7 12,061 52

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

8. 12.029 318.579 ↓ 2.7 12,061 1

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

9. 8.377 294.489 ↓ 2.7 12,061 1

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

10. 261.990 261.990 ↓ 2.7 12,061 1

Seq Scan on t_parcelas_adq parc (cost=0.00..29,425.52 rows=4,450 width=12) (actual time=0.199..261.990 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.191 ms
Execution time : 434.875 ms