explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Z2Rl

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.050 ↓ 0.0 0 1

GroupAggregate (cost=5.42..5.49 rows=1 width=204) (actual time=0.049..0.050 rows=0 loops=1)

  • Group Key: fat.tx_produto, fat.tx_classificacao, fat.tx_unidade, fat.tx_nivel, fat.fk_tempo, fat.tx_rg, fat.tx_moeda, fat.fk_unidade, fat.fk_classificacao
2.          

CTE media_uf

3. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=2.67..2.71 rows=1 width=54) (never executed)

  • Group Key: fat_1.fk_tempo, fat_1.fk_classificacao, fat_1.fk_nivel, fat_1.fk_unidade, fat_1.fk_rg, fat_1.fk_uf
4. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.67..2.68 rows=1 width=54) (never executed)

  • Sort Key: fat_1.fk_tempo, fat_1.fk_unidade, fat_1.fk_rg, fat_1.fk_uf
5. 0.000 0.000 ↓ 0.0 0

Index Scan using fat_siagro_sem_idx_035 on fat_siagro_sem fat_1 (cost=0.43..2.66 rows=1 width=54) (never executed)

  • Index Cond: (((fk_tempo)::text >= '198201'::text) AND ((fk_tempo)::text <= '198912'::text))
  • Filter: ((fk_nivel = 5) AND (fk_produto = 29) AND (fk_classificacao = 4,744) AND ((fk_rg)::text = ANY ('{CO,N,NE,S,SE}'::text[])))
6. 0.028 0.046 ↓ 0.0 0 1

Sort (cost=2.72..2.72 rows=1 width=136) (actual time=0.045..0.046 rows=0 loops=1)

  • Sort Key: fat.tx_produto, fat.tx_classificacao, fat.tx_unidade, fat.tx_nivel, fat.fk_tempo, fat.tx_rg, fat.tx_moeda, fat.fk_unidade
  • Sort Method: quicksort Memory: 25kB
7. 0.003 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.43..2.71 rows=1 width=136) (actual time=0.017..0.018 rows=0 loops=1)

  • Join Filter: (((fat.fk_rg)::text = (m.rg)::text) AND ((fat.fk_tempo)::text = (m.tempo)::text) AND (fat.fk_unidade = m.unidade))
8. 0.015 0.015 ↓ 0.0 0 1

Index Scan using fat_siagro_sem_idx_035 on fat_siagro_sem fat (cost=0.43..2.66 rows=1 width=138) (actual time=0.015..0.015 rows=0 loops=1)

  • Index Cond: (((fk_tempo)::text >= '198201'::text) AND ((fk_tempo)::text <= '198912'::text))
  • Filter: ((fk_classificacao = 4,744) AND (fk_nivel = 5) AND (fk_produto = 29) AND ((fk_rg)::text = ANY ('{CO,N,NE,S,SE}'::text[])))
9. 0.000 0.000 ↓ 0.0 0

CTE Scan on media_uf m (cost=0.00..0.03 rows=1 width=58) (never executed)

  • Filter: ((classificacao = 4,744) AND (nivel = 5))
Planning time : 296.445 ms
Execution time : 0.199 ms