explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KNWD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=38,098.77..38,478.03 rows=1 width=132) (actual rows= loops=)

2.          

CTE t_maiorlancamento

3. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=38,095.46..38,098.35 rows=23 width=34) (actual rows= loops=)

  • Group Key: t_lancamento_1.id_externo, t_lancamento_1.tipo
4. 0.000 0.000 ↓ 0.0

Gather Merge (cost=38,095.46..38,097.97 rows=20 width=34) (actual rows= loops=)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=37,095.44..37,095.64 rows=10 width=34) (actual rows= loops=)

  • Group Key: t_lancamento_1.id_externo, t_lancamento_1.tipo
6. 0.000 0.000 ↓ 0.0

Sort (cost=37,095.44..37,095.46 rows=10 width=34) (actual rows= loops=)

  • Sort Key: t_lancamento_1.id_externo, t_lancamento_1.tipo
7. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on t_lancamento t_lancamento_1 (cost=0.00..37,095.27 rows=10 width=34) (actual rows= loops=)

  • Filter: (((tipo)::text = ANY ('{AJUSTE_ROTATIVO_PRINCIPAL,AJUSTE_ROTATIVO_JUROS}'::text[])) AND (id_pessoa = ANY ('{156364,156433,156594,156447,156370,156360}'::bigint[])) AND (date(data_evento) <= to_date('20210101'::text, 'YYYYMMDD'::text)))
8. 0.000 0.000 ↓ 0.0

CTE Scan on t_maiorlancamento (cost=0.00..0.46 rows=23 width=234) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using idx_id_externo_lancamento on t_lancamento (cost=0.42..16.48 rows=1 width=132) (actual rows= loops=)

  • Index Cond: (id_externo = t_maiorlancamento.id_externo)
  • Filter: ((NOT incidir_fatura_ativa) AND ((t_maiorlancamento.tipo)::text = (tipo)::text) AND (t_maiorlancamento.data_evento = data_evento) AND ((status)::text = ANY ('{A_FATURAR,FATURADO,VENCIDO}'::text[])))