explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Nxpu

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 57.749 ↓ 8.0 8 1

Unique (cost=22,324.41..22,324.42 rows=1 width=84) (actual time=57.744..57.749 rows=8 loops=1)

2. 0.020 57.744 ↓ 8.0 8 1

Sort (cost=22,324.41..22,324.41 rows=1 width=84) (actual time=57.743..57.744 rows=8 loops=1)

  • Sort Key: c.cec_descricao DESC, (CASE WHEN (r.rpg_tipo = 1) THEN 'Receita'::text ELSE 'Despesa'::text END), r.rpg_tipo, (round(sum(((((rpcc.rcc_valor / r.rpg_total) * rpb.rpb_vlbaixa))::numeric(15,4) * ((rpf.rpf_perc / '100'::numeric))::numeric(15,4))), 4))
  • Sort Method: quicksort Memory: 25kB
3. 0.055 57.724 ↓ 8.0 8 1

GroupAggregate (cost=22,324.35..22,324.40 rows=1 width=84) (actual time=57.696..57.724 rows=8 loops=1)

  • Group Key: c.cec_descricao, (CASE WHEN (r.rpg_tipo = 1) THEN 'Receita'::text ELSE 'Despesa'::text END), r.rpg_tipo
4. 0.038 57.669 ↓ 31.0 31 1

Sort (cost=22,324.35..22,324.36 rows=1 width=75) (actual time=57.668..57.669 rows=31 loops=1)

  • Sort Key: c.cec_descricao DESC, (CASE WHEN (r.rpg_tipo = 1) THEN 'Receita'::text ELSE 'Despesa'::text END), r.rpg_tipo
  • Sort Method: quicksort Memory: 28kB
5. 0.042 57.631 ↓ 31.0 31 1

Nested Loop (cost=1,002.27..22,324.34 rows=1 width=75) (actual time=39.408..57.631 rows=31 loops=1)

6. 0.031 57.554 ↓ 35.0 35 1

Nested Loop (cost=1,002.00..22,324.01 rows=1 width=51) (actual time=39.388..57.554 rows=35 loops=1)

7. 0.000 57.488 ↓ 35.0 35 1

Nested Loop (cost=1,001.71..22,323.71 rows=1 width=33) (actual time=39.382..57.488 rows=35 loops=1)

  • Join Filter: (rpf.rpg_chave = rpb.rpg_chave)
8. 10.499 60.284 ↓ 25.0 25 1

Gather (cost=1,001.28..22,323.10 rows=1 width=59) (actual time=39.372..60.284 rows=25 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 0.006 49.785 ↓ 8.0 8 3 / 3

Nested Loop (cost=1.28..21,323.00 rows=1 width=59) (actual time=37.814..49.785 rows=8 loops=3)

  • Join Filter: (rpf.rpg_chave = rpcc.rpg_chave)
10. 0.007 49.721 ↑ 2.2 8 3 / 3

Nested Loop (cost=0.85..21,313.17 rows=18 width=45) (actual time=37.793..49.721 rows=8 loops=3)

  • Join Filter: (rpf.rpg_chave = rpprod.rpg_chave)
11. 0.013 49.666 ↑ 1.4 8 3 / 3

Nested Loop (cost=0.43..21,265.22 rows=11 width=29) (actual time=37.771..49.666 rows=8 loops=3)

12. 49.589 49.589 ↑ 62.0 8 3 / 3

Parallel Seq Scan on recpagfazenda rpf (cost=0.00..17,326.25 rows=496 width=13) (actual time=37.732..49.589 rows=8 loops=3)

  • Filter: ((rpg_chave IS NOT NULL) AND (faz_chave = '8940000001'::bigint))
  • Rows Removed by Filter: 417672
13. 0.064 0.064 ↑ 1.0 1 24 / 3

Index Scan using recpag_pkey on recpag r (cost=0.43..7.94 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=24)

  • Index Cond: ((rpg_chave = rpf.rpg_chave) AND (rpg_chave IS NOT NULL))
  • Filter: (cfg_chave = ANY ('{894,895,1123,1248,1361,1368,1417,1515,1525,1741,1777,1791,1908,1922,2363,2491,2492}'::bigint[]))
14. 0.048 0.048 ↑ 3.0 1 24 / 3

Index Only Scan using pk_recpagproduto on recpagproduto rpprod (cost=0.43..4.32 rows=3 width=16) (actual time=0.006..0.006 rows=1 loops=24)

  • Index Cond: (rpg_chave = r.rpg_chave)
  • Heap Fetches: 12
15. 0.058 0.058 ↑ 1.0 1 25 / 3

Index Scan using pk_recpagccusto on recpagccusto rpcc (cost=0.43..0.53 rows=1 width=30) (actual time=0.006..0.007 rows=1 loops=25)

  • Index Cond: ((rpg_chave = rpprod.rpg_chave) AND (pro_chave = rpprod.pro_chave))
  • Filter: (rcc_valor > '0'::numeric)
  • Rows Removed by Filter: 0
16. 0.075 0.075 ↑ 3.0 1 25

Index Scan using pk_recpagbaixa on recpagbaixa rpb (cost=0.43..0.57 rows=3 width=14) (actual time=0.002..0.003 rows=1 loops=25)

  • Index Cond: ((rpg_chave = rpcc.rpg_chave) AND (rpg_chave IS NOT NULL))
17. 0.035 0.035 ↑ 1.0 1 35

Index Scan using centrocusto_pkey on centrocusto c (cost=0.29..0.30 rows=1 width=34) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (cec_chave = rpcc.cec_chave)
18. 0.035 0.035 ↑ 1.0 1 35

Index Scan using cla_chave_idx on classe cla (cost=0.28..0.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (cla_chave = c.cla_chave)
  • Filter: (COALESCE(cla_agrupador, 0) = 0)
  • Rows Removed by Filter: 0
Planning time : 7.046 ms