explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l1Of

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.191 ↓ 0.0 0 1

GroupAggregate (cost=6,428.47..6,428.61 rows=1 width=54) (actual time=0.191..0.191 rows=0 loops=1)

  • Group Key: patbemloc.cd_filial, pes.no_reduzido
2. 0.010 0.189 ↓ 0.0 0 1

Sort (cost=6,428.47..6,428.47 rows=1 width=54) (actual time=0.189..0.189 rows=0 loops=1)

  • Sort Key: patbemloc.cd_filial, pes.no_reduzido
  • Sort Method: quicksort Memory: 25kB
3. 0.001 0.179 ↓ 0.0 0 1

Nested Loop Anti Join (cost=6,375.07..6,428.46 rows=1 width=54) (actual time=0.179..0.179 rows=0 loops=1)

4. 0.001 0.178 ↓ 0.0 0 1

Nested Loop (cost=6,374.66..6,428.00 rows=1 width=78) (actual time=0.178..0.178 rows=0 loops=1)

5. 0.000 0.177 ↓ 0.0 0 1

Nested Loop (cost=6,374.52..6,427.84 rows=1 width=74) (actual time=0.177..0.177 rows=0 loops=1)

  • Join Filter: ((pesfil.cd_pessoa = pesati.cd_pessoa) AND ((pesfil.id_atividade)::text = (pesati.id_atividade)::text))
6. 0.000 0.177 ↓ 0.0 0 1

Nested Loop (cost=6,374.11..6,427.35 rows=1 width=97) (actual time=0.177..0.177 rows=0 loops=1)

7. 0.003 0.177 ↓ 0.0 0 1

Nested Loop (cost=6,373.81..6,419.40 rows=1 width=68) (actual time=0.177..0.177 rows=0 loops=1)

  • Join Filter: (patbemloc.cd_filial = pesfil.cd_filial)
8. 0.110 0.110 ↑ 1.0 64 1

Index Scan using pessoa_filial_idx1 on pessoa_filial pesfil (cost=0.14..29.47 rows=64 width=31) (actual time=0.051..0.110 rows=64 loops=1)

  • Filter: (cd_empresa = 1)
  • Rows Removed by Filter: 1
9. 0.015 0.064 ↓ 0.0 0 64

Materialize (cost=6,373.67..6,388.98 rows=1 width=61) (actual time=0.001..0.001 rows=0 loops=64)

10. 0.000 0.049 ↓ 0.0 0 1

Nested Loop (cost=6,373.67..6,388.97 rows=1 width=61) (actual time=0.049..0.049 rows=0 loops=1)

11. 0.000 0.049 ↓ 0.0 0 1

Nested Loop (cost=6,373.67..6,385.82 rows=1 width=73) (actual time=0.049..0.049 rows=0 loops=1)

  • Join Filter: (patbem.cd_bem = patbemmov.cd_bem)
12. 0.000 0.049 ↓ 0.0 0 1

Nested Loop (cost=6,373.24..6,382.66 rows=1 width=52) (actual time=0.049..0.049 rows=0 loops=1)

  • Join Filter: ((max((to_char((_loc.dt_alt_local)::timestamp with time zone, 'YYYYMMDD'::text) || (_loc.hr_alt_local)::text))) = (to_char((patbemloc.dt_alt_local)::timestamp with time zone, 'YYYYMMDD'::text) || (patbemloc.hr_alt_local)::text))
13. 0.001 0.049 ↓ 0.0 0 1

Nested Loop (cost=6,372.82..6,380.88 rows=1 width=60) (actual time=0.049..0.049 rows=0 loops=1)

14. 0.001 0.048 ↓ 0.0 0 1

HashAggregate (cost=6,372.53..6,372.54 rows=1 width=27) (actual time=0.048..0.048 rows=0 loops=1)

  • Group Key: _loc.cd_empresa, _loc.cd_bem
15. 0.013 0.047 ↓ 0.0 0 1

Hash Join (cost=6.20..6,372.52 rows=1 width=27) (actual time=0.047..0.047 rows=0 loops=1)

  • Hash Cond: ((_loc.cd_base = _canc.cd_base) AND (_loc.seq_processo = _canc.seq_processo))
16. 0.032 0.032 ↑ 151,015.0 1 1

Seq Scan on pat_bem_local _loc (cost=0.00..5,233.69 rows=151,015 width=43) (actual time=0.032..0.032 rows=1 loops=1)

  • Filter: ((cd_empresa = 1) AND (dt_alt_local <= to_date('2019-01-31'::text, 'yyyy-MM-dd'::text)))
17. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=6.19..6.19 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
18. 0.002 0.002 ↓ 0.0 0 1

Index Only Scan using processo_canc_pk on processo_canc _canc (cost=0.42..6.19 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: ((cd_empresa IS NULL) AND (cd_empresa = 1))
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_bem_pk on pat_bem patbem (cost=0.29..8.32 rows=1 width=20) (never executed)

  • Index Cond: ((cd_empresa = 1) AND (cd_bem = _loc.cd_bem))
  • Filter: (((cd_pat_grupo)::text = '003'::text) AND ((dt_baixa > to_date('2019-01-31'::text, 'yyyy-MM-dd'::text)) OR (id_situacao <> ALL ('{B,L,C}'::bpchar[]))))
20. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_bem_local_pk on pat_bem_local patbemloc (cost=0.42..1.67 rows=5 width=35) (never executed)

  • Index Cond: ((cd_empresa = 1) AND (cd_bem = patbem.cd_bem))
21. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_bem_mov_idx2 on pat_bem_mov patbemmov (cost=0.43..2.50 rows=53 width=53) (never executed)

  • Index Cond: ((cd_empresa = 1) AND (cd_bem = patbemloc.cd_bem))
  • Filter: (dt_movimento <= to_date('2019-01-31'::text, 'yyyy-MM-dd'::text))
22. 0.000 0.000 ↓ 0.0 0

Seq Scan on pat_grupo patgru (cost=0.00..3.14 rows=1 width=12) (never executed)

  • Filter: ((cd_empresa = 1) AND ((cd_pat_grupo)::text = '003'::text))
23. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_pk on pessoa pes (cost=0.29..7.94 rows=1 width=29) (never executed)

  • Index Cond: (cd_pessoa = pesfil.cd_pessoa)
24. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_atividade_pk on pessoa_atividade pesati (cost=0.41..0.47 rows=1 width=15) (never executed)

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0

Index Scan using operacao_patrimonio_pk on operacao_patrimonio opepat (cost=0.14..0.16 rows=1 width=20) (never executed)

  • Index Cond: (cd_operacao = patbemmov.cd_operacao)
26. 0.000 0.000 ↓ 0.0 0

Index Only Scan using processo_canc_pk on processo_canc procan (cost=0.42..0.45 rows=1 width=24) (never executed)

  • Index Cond: ((cd_empresa = patbemmov.cd_empresa) AND (cd_empresa = 1) AND (cd_base = patbemmov.cd_base) AND (seq_processo = patbemmov.seq_processo))
  • Heap Fetches: 0