explain.depesz.com

PostgreSQL's explain analyze made readable

Result: helD

Settings
# exclusive inclusive rows x rows loops node
1. 850.613 10,530.233 ↑ 17.2 350,033 1

GroupAggregate (cost=3,927,274.99..4,452,670.79 rows=6,004,524 width=209) (actual time=9,149.517..10,530.233 rows=350,033 loops=1)

  • Group Key: gf.id_grupo, hacf.idproduto, hacf.data_solicitacao
2. 2,241.512 9,679.620 ↑ 17.1 875,840 1

Sort (cost=3,927,274.99..3,964,803.26 rows=15,011,308 width=35) (actual time=9,149.496..9,679.620 rows=875,840 loops=1)

  • Sort Key: gf.id_grupo, hacf.idproduto, hacf.data_solicitacao
  • Sort Method: external merge Disk: 42608kB
3. 207.666 7,438.108 ↑ 17.1 875,840 1

Hash Join (cost=308.69..1,727,495.13 rows=15,011,308 width=35) (actual time=220.094..7,438.108 rows=875,840 loops=1)

  • Hash Cond: (hacf.filial = gf.filial)
4. 3,183.944 7,230.433 ↑ 17.1 875,840 1

Hash Join (cost=307.58..1,521,088.53 rows=15,011,308 width=35) (actual time=220.079..7,230.433 rows=875,840 loops=1)

  • Hash Cond: (hacf.data_solicitacao = (last_day((day.day)::date)))
5. 4,046.309 4,046.309 ↓ 1.0 30,118,660 1

Seq Scan on hist_analise_compras_filial hacf (cost=0.00..734,370.16 rows=30,022,616 width=35) (actual time=0.006..4,046.309 rows=30,118,660 loops=1)

6. 0.003 0.180 ↑ 77.0 13 1

Hash (cost=295.07..295.07 rows=1,001 width=4) (actual time=0.180..0.180 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.010 0.177 ↑ 77.0 13 1

HashAggregate (cost=275.05..285.06 rows=1,001 width=4) (actual time=0.175..0.177 rows=13 loops=1)

  • Group Key: (last_day((day.day)::date))
8. 0.000 0.167 ↑ 77.0 13 1

Append (cost=0.02..272.55 rows=1,001 width=4) (actual time=0.089..0.167 rows=13 loops=1)

9. 0.165 0.165 ↑ 83.3 12 1

Function Scan on generate_series day (cost=0.02..262.52 rows=1,000 width=4) (actual time=0.089..0.165 rows=12 loops=1)

10. 0.002 0.002 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1)

11. 0.001 0.009 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=16) (actual time=0.009..0.009 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.008 0.008 ↑ 1.0 5 1

Seq Scan on grupo_filial gf (cost=0.00..1.05 rows=5 width=16) (actual time=0.005..0.008 rows=5 loops=1)

Planning time : 0.354 ms
Execution time : 10,553.268 ms