explain.depesz.com

PostgreSQL's explain analyze made readable

Result: amAp : Optimization for: plan #qevN

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.960 225.471 ↓ 19.7 3,937 1

Unique (cost=17,161.97..17,629.01 rows=200 width=29) (actual time=210.913..225.471 rows=3,937 loops=1)

2. 119.158 219.511 ↑ 1.0 91,559 1

Sort (cost=17,161.97..17,395.49 rows=93,407 width=29) (actual time=210.911..219.511 rows=91,559 loops=1)

  • Sort Key: prevendas.codcliente, pf.datahora DESC
  • Sort Method: quicksort Memory: 10226kB
3. 4.434 100.353 ↑ 1.0 91,559 1

Append (cost=2,644.03..9,450.64 rows=93,407 width=29) (actual time=23.336..100.353 rows=91,559 loops=1)

4. 63.171 92.133 ↑ 1.0 91,557 1

Hash Join (cost=2,644.03..7,198.55 rows=91,557 width=21) (actual time=23.336..92.133 rows=91,557 loops=1)

  • Hash Cond: (prevendas.codigo = pf.codprevenda)
5. 6.230 6.230 ↑ 1.0 91,560 1

Seq Scan on prevendas (cost=0.00..3,295.60 rows=91,560 width=13) (actual time=0.002..6.230 rows=91,560 loops=1)

6. 14.194 22.732 ↑ 1.0 91,557 1

Hash (cost=1,499.57..1,499.57 rows=91,557 width=12) (actual time=22.732..22.732 rows=91,557 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4959kB
7. 8.538 8.538 ↑ 1.0 91,557 1

Seq Scan on prevendas_faturamento pf (cost=0.00..1,499.57 rows=91,557 width=12) (actual time=0.002..8.538 rows=91,557 loops=1)

8. 2.352 3.786 ↑ 925.0 2 1

Hash Join (cost=51.63..1,318.02 rows=1,850 width=22) (actual time=0.139..3.786 rows=2 loops=1)

  • Hash Cond: (saidasnf.codigo = sf.codsaidasnf)
9. 1.424 1.424 ↑ 1.0 22,247 1

Seq Scan on saidasnf (cost=0.00..1,164.47 rows=22,247 width=14) (actual time=0.001..1.424 rows=22,247 loops=1)

10. 0.007 0.010 ↑ 925.0 2 1

Hash (cost=28.50..28.50 rows=1,850 width=12) (actual time=0.010..0.010 rows=2 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
11. 0.003 0.003 ↑ 925.0 2 1

Seq Scan on saidasnf_faturamento sf (cost=0.00..28.50 rows=1,850 width=12) (actual time=0.003..0.003 rows=2 loops=1)