explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9K7V

Settings
# exclusive inclusive rows x rows loops node
1. 0.658 397.010 ↑ 1.0 1 1

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

2. 70.324 396.352 ↓ 317.4 12,061 1

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

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

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

5. 0.000 0.000 ↑ 1.0 4 52

Materialize (cost=0.00..1.06 rows=4 width=20) (actual time=0.000..0.000 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. 26.816 325.884 ↓ 2.7 12,061 52

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

8. 10.035 299.068 ↓ 2.7 12,061 1

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

9. 5.963 276.972 ↓ 2.7 12,061 1

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

10. 246.887 246.887 ↓ 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.162..246.887 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.161 ms
Execution time : 397.190 ms