explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nlh2

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

Sort (cost=1,975,577.85..1,975,577.85 rows=1 width=765) (actual rows= loops=)

  • Sort Key: tbcarne.crevencimentocarne, tbcarne.creidcarne
2. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=1,421,362.72..1,975,577.84 rows=1 width=765) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,421,362.29..1,975,573.18 rows=1 width=765) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,421,361.87..1,975,570.54 rows=1 width=417) (actual rows= loops=)

  • Filter: ((tbcarne.grgtipo = 23) OR ((tbgrupogeracao.grgdatahoraregistro)::date < (now())::date) OR (((tbgrupogeracao.grgdatahoraregistro)::date = (now())::date) AND (tbcarne.creocorrenciaregistro IS NOT NULL)))
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,421,361.44..1,975,567.86 rows=1 width=319) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,421,361.00..1,424,519.22 rows=315,822 width=8) (actual rows= loops=)

  • Group Key: tbcarneparcela.creidcarne
7. 0.000 0.000 ↓ 0.0

Merge Join (cost=15,051.38..1,389,109.48 rows=12,900,607 width=8) (actual rows= loops=)

  • Merge Cond: ((tbcarneparcela.lctano = tblancamento.lctano) AND (tbcarneparcela.lctnumero = tblancamento.lctnumero))
8. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcarneparcela_chavelcto on tbcarneparcela (cost=0.56..476,186.10 rows=16,348,963 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using pk_tblancamento on tblancamento (cost=0.56..625,741.36 rows=15,286,227 width=10) (actual rows= loops=)

  • Filter: (lcttipocalculo = 1)
10. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbcarne on tbcarne (cost=0.44..1.74 rows=1 width=319) (actual rows= loops=)

  • Index Cond: (creidcarne = tbcarneparcela.creidcarne)
  • Filter: ((crevencimentocarne >= '2019-06-30'::date) AND (cresituacao = 1) AND (bcocodigo = '104'::smallint) AND (cnbnumero = 82494) AND ((cresitregistro = 2) OR (cresitregistro = 10)) AND (((((((date_part('year'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text || lpad(((date_part('month'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text, 2, '0'::text)) || lpad(((date_part('day'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text, 2, '0'::text)) || (creidcarne)::text))::bigint >= '2019063025786424'::bigint) AND (((((((date_part('year'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text || lpad(((date_part('month'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text, 2, '0'::text)) || lpad(((date_part('day'::text, (crevencimentocarne)::timestamp without time zone))::character varying)::text, 2, '0'::text)) || (creidcarne)::text))::bigint <= '2019070225786449'::bigint))
11. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbgrupogeracao on tbgrupogeracao (cost=0.43..2.65 rows=1 width=108) (actual rows= loops=)

  • Index Cond: ((grgtipo = tbcarne.grgtipo) AND (grgcodigo = tbcarne.grgcodigo))
12. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbunico on tbunico (cost=0.42..2.64 rows=1 width=356) (actual rows= loops=)

  • Index Cond: (unicodigo = tbcarne.unicodigo)
13. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbgerregcarne_creidcarne on tbgerregistrobancariocarne (cost=0.43..2.66 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (creidcarne = tbcarne.creidcarne)
  • Filter: ((grctipo = 1) AND (grcsituacao = 1))