explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NS0P

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,782.445 ↓ 1.3 10,193 1

Group (cost=367,642.09..368,768.15 rows=7,886 width=23) (actual time=1,469.109..1,782.445 rows=10,193 loops=1)

  • Group Key: sm.cd_empresa, sm.dt_data, sm.nr_hora, sm.nr_pdv, sm.cd_operador
2. 0.000 1,782.801 ↓ 1.3 10,193 1

Gather Merge (cost=367,642.09..368,669.57 rows=7,886 width=23) (actual time=1,469.107..1,782.801 rows=10,193 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 570.870 3,503.056 ↑ 1.5 5,097 2

Group (cost=366,642.08..366,782.39 rows=7,886 width=23) (actual time=1,447.171..1,751.528 rows=5,097 loops=2)

  • Group Key: sm.cd_empresa, sm.dt_data, sm.nr_hora, sm.nr_pdv, sm.cd_operador
4. 770.020 2,932.186 ↓ 46.5 434,856 2

Sort (cost=366,642.08..366,665.46 rows=9,354 width=23) (actual time=1,447.167..1,466.093 rows=434,856 loops=2)

  • Sort Key: sm.cd_empresa, sm.dt_data, sm.nr_hora, sm.nr_pdv, sm.cd_operador
  • Sort Method: quicksort Memory: 46353kB
  • Worker 0: Sort Method: quicksort Memory: 46170kB
5. 122.005 2,162.166 ↓ 46.5 434,856 2

Nested Loop (cost=0.56..366,025.12 rows=9,354 width=23) (actual time=5.691..1,081.083 rows=434,856 loops=2)

6. 32.140 32.140 ↑ 1.1 5,097 2

Parallel Seq Scan on tb_teste sm (cost=0.00..3,769.95 rows=5,746 width=23) (actual time=5.528..16.070 rows=5,097 loops=2)

  • Filter: (dt_data >= '2019-07-01'::date)
  • Rows Removed by Filter: 95404
7. 2,008.021 2,008.021 ↓ 85.0 85 10,193

Index Scan using pdvcup00_pkey on pdvcup00 p0 (cost=0.56..63.03 rows=1 width=19) (actual time=0.083..0.197 rows=85 loops=10,193)

  • 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: 95
Planning time : 0.643 ms
Execution time : 1,791.715 ms