explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7p7J

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.035 49.164 ↓ 5.0 5 1

GroupAggregate (cost=88,357.80..88,357.84 rows=1 width=55) (actual time=49.147..49.164 rows=5 loops=1)

  • Group Key: sm.cd_empresa, sm.dt_data, sm.nr_hora, sm.nr_pdv, sm.cd_operador
2. 0.000 49.129 ↓ 25.0 25 1

Sort (cost=88,357.80..88,357.81 rows=1 width=26) (actual time=49.127..49.129 rows=25 loops=1)

  • Sort Key: sm.cd_empresa, sm.dt_data, sm.nr_hora, sm.nr_pdv, sm.cd_operador
  • Sort Method: quicksort Memory: 26kB
3. 39.413 52.901 ↓ 25.0 25 1

Gather (cost=1,001.13..88,357.79 rows=1 width=26) (actual time=9.585..52.901 rows=25 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 1.669 13.488 ↓ 13.0 13 2

Nested Loop (cost=1.13..87,357.69 rows=1 width=26) (actual time=4.152..13.488 rows=13 loops=2)

5. 0.068 11.779 ↑ 30.1 42 2

Nested Loop (cost=0.56..78,290.38 rows=1,263 width=43) (actual time=4.132..11.779 rows=42 loops=2)

6. 11.677 11.677 ↑ 258.7 3 2

Parallel Seq Scan on tb_teste sm (cost=0.00..3,769.95 rows=776 width=23) (actual time=4.099..11.677 rows=3 loops=2)

  • Filter: (dt_data >= '2019-08-01'::date)
  • Rows Removed by Filter: 100498
7. 0.034 0.034 ↓ 17.0 17 5

Index Scan using pdvcup00_pkey on pdvcup00 p0 (cost=0.56..96.02 rows=1 width=25) (actual time=0.023..0.034 rows=17 loops=5)

  • Index Cond: ((emp = sm.cd_empresa) AND (dta = sm.dt_data) AND (pdv = sm.nr_pdv) AND (num > '0'::numeric))
  • Filter: (sm.cd_operador = ope)
  • Rows Removed by Filter: 9
8. 0.040 0.040 ↓ 0.0 0 83

Index Scan using pdvcup01_pkey on pdvcup01 p1 (cost=0.57..7.17 rows=1 width=23) (actual time=0.040..0.040 rows=0 loops=83)

  • Index Cond: ((emp = p0.emp) AND (dta = p0.dta) AND (pdv = p0.pdv) AND (num = p0.num) AND (bar > '0'::numeric))
  • Filter: (vad <> '0'::numeric)
  • Rows Removed by Filter: 27
Planning time : 1.841 ms
Execution time : 53.155 ms