explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LxDp

Settings
# exclusive inclusive rows x rows loops node
1. 0.077 4,478.310 ↓ 25.0 25 1

Sort (cost=73,905.00..73,905.00 rows=1 width=24) (actual time=4,478.308..4,478.310 rows=25 loops=1)

  • Sort Key: selo.id_selo DESC, (CASE selo_compensado.pode_recorrer WHEN CASE_TEST_EXPR THEN 0 WHEN (NOT CASE_TEST_EXPR) THEN 1 ELSE NULL::integer END), selo_compensado.dt_recurso, selo.dt_selo
  • Sort Method: quicksort Memory: 26kB
2. 0.120 4,478.233 ↓ 25.0 25 1

Nested Loop Left Join (cost=478.83..73,904.99 rows=1 width=24) (actual time=297.063..4,478.233 rows=25 loops=1)

  • Filter: ((selo_analisado.cs_situacao_isento <> 2) OR (selo_analisado.cs_situacao_isento IS NULL))
3. 108.209 4,477.613 ↓ 25.0 25 1

Nested Loop (cost=478.41..73,904.09 rows=1 width=25) (actual time=297.034..4,477.613 rows=25 loops=1)

  • Join Filter: (selo.id_selo_compensado = selo_compensado.id_selo_compensado)
  • Rows Removed by Join Filter: 1,038,481
4. 0.564 0.564 ↓ 49.0 49 1

Index Scan using selo_compensado_categoria_idx on selo_compensado (cost=0.42..332.31 rows=1 width=13) (actual time=0.032..0.564 rows=49 loops=1)

  • Index Cond: (categoria = 8)
  • Filter: ((cs_situacao_compensado IS NOT NULL) AND (dt_recurso >= '2020-07-01 00:00:00'::timestamp without time zone) AND (dt_recurso <= '2020-07-31 23:59:59'::timestamp without time zone) AND (cs_situacao_compensado = 1))
  • Rows Removed by Filter: 161
5. 4,240.901 4,368.840 ↑ 1.2 21,194 49

Bitmap Heap Scan on selo (cost=477.99..73,261.79 rows=24,799 width=20) (actual time=5.854..89.160 rows=21,194 loops=49)

  • Recheck Cond: (id_cartorio = 137)
  • Filter: (cs_situacao_selo = 0)
  • Rows Removed by Filter: 46
  • Heap Blocks: exact=907,284
6. 127.939 127.939 ↓ 1.1 26,476 49

Bitmap Index Scan on selo_id_cartorio_idx (cost=0.00..471.80 rows=24,982 width=0) (actual time=2.611..2.611 rows=26,476 loops=49)

  • Index Cond: (id_cartorio = 137)
7. 0.500 0.500 ↑ 1.0 1 25

Index Scan using selo_analisado_pkey on selo_analisado (cost=0.42..0.89 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=25)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)