explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DJow

Settings
# exclusive inclusive rows x rows loops node
1. 263.200 6,054.528 ↓ 1.6 64,654 1

Sort (cost=156,066.39..156,166.85 rows=40,186 width=157) (actual time=6,033.552..6,054.528 rows=64,654 loops=1)

  • Sort Key: source.sum DESC
  • Sort Method: external merge Disk: 6,736kB
2. 315.772 5,791.328 ↓ 1.6 64,654 1

Hash Left Join (cost=122,548.13..149,832.78 rows=40,186 width=157) (actual time=4,416.233..5,791.328 rows=64,654 loops=1)

  • Hash Cond: (source.estilo = jerarquia.estilo)
3. 316.036 3,793.036 ↓ 1.6 64,654 1

Hash Right Join (cost=82,889.93..101,383.23 rows=40,186 width=125) (actual time=2,729.980..3,793.036 rows=64,654 loops=1)

  • Hash Cond: (stock.sku = source.sku)
4. 769.187 769.187 ↑ 1.0 550,360 1

Seq Scan on stock (cost=0.00..10,926.60 rows=550,360 width=13) (actual time=0.012..769.187 rows=550,360 loops=1)

5. 87.755 2,707.813 ↓ 1.6 64,654 1

Hash (cost=81,641.60..81,641.60 rows=40,186 width=121) (actual time=2,707.813..2,707.813 rows=64,654 loops=1)

  • Buckets: 32,768 Batches: 2 Memory Usage: 2,879kB
6. 54.787 2,620.058 ↓ 1.6 64,654 1

Subquery Scan on source (cost=67,381.05..81,641.60 rows=40,186 width=121) (actual time=1,999.260..2,620.058 rows=64,654 loops=1)

7. 222.935 2,565.271 ↓ 1.6 64,654 1

Finalize GroupAggregate (cost=67,381.05..81,239.74 rows=40,186 width=153) (actual time=1,999.258..2,565.271 rows=64,654 loops=1)

  • Group Key: ventas.sku
8. 277.611 2,342.336 ↓ 1.3 106,744 1

Gather Merge (cost=67,381.05..79,531.84 rows=80,372 width=121) (actual time=1,999.244..2,342.336 rows=106,744 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 92.456 2,064.725 ↑ 1.1 35,581 3 / 3

Partial GroupAggregate (cost=66,381.02..69,254.89 rows=40,186 width=121) (actual time=1,899.692..2,064.725 rows=35,581 loops=3)

  • Group Key: ventas.sku
10. 1,487.976 1,972.269 ↑ 1.1 103,062 3 / 3

Sort (cost=66,381.02..66,655.69 rows=109,867 width=27) (actual time=1,899.676..1,972.269 rows=103,062 loops=3)

  • Sort Key: ventas.sku
  • Sort Method: external merge Disk: 3,128kB
11. 138.448 484.293 ↑ 1.1 103,062 3 / 3

Hash Semi Join (cost=9,992.85..54,550.19 rows=109,867 width=27) (actual time=244.695..484.293 rows=103,062 loops=3)

  • Hash Cond: (ventas.id_depto = neg_div_depto.id_depto)
12. 260.371 345.596 ↑ 1.1 104,436 3 / 3

Parallel Bitmap Heap Scan on ventas (cost=9,990.36..53,037.03 rows=109,867 width=27) (actual time=243.615..345.596 rows=104,436 loops=3)

  • Recheck Cond: ((fecha >= (concat('2019-05-26 23:30:00', '-04'))::timestamp with time zone) AND (fecha <= (concat('2019-05-29 23:59:59', '-04'))::timestamp with time zone))
  • Filter: (estado ~~ 'paid'::text)
  • Heap Blocks: exact=1,218
13. 85.225 85.225 ↓ 1.2 313,307 1 / 3

Bitmap Index Scan on ventas_estado_fecha_sku_idx (cost=0.00..9,924.44 rows=263,680 width=0) (actual time=255.676..255.676 rows=313,307 loops=1)

  • Index Cond: ((estado = 'paid'::text) AND (fecha >= (concat('2019-05-26 23:30:00', '-04'))::timestamp with time zone) AND (fecha <= (concat('2019-05-29 23:59:59', '-04'))::timestamp with time zone))
14. 0.209 0.249 ↑ 1.0 66 3 / 3

Hash (cost=1.66..1.66 rows=66 width=3) (actual time=0.248..0.249 rows=66 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
15. 0.040 0.040 ↑ 1.0 66 3 / 3

Seq Scan on neg_div_depto (cost=0.00..1.66 rows=66 width=3) (actual time=0.020..0.040 rows=66 loops=3)

  • Filter: (id_depto IS NOT NULL)
16. 369.760 1,682.520 ↑ 1.0 786,409 1

Hash (cost=23,684.09..23,684.09 rows=786,409 width=35) (actual time=1,682.520..1,682.520 rows=786,409 loops=1)

  • Buckets: 65,536 Batches: 16 Memory Usage: 3,841kB
17. 1,312.760 1,312.760 ↑ 1.0 786,409 1

Seq Scan on jerarquia (cost=0.00..23,684.09 rows=786,409 width=35) (actual time=0.027..1,312.760 rows=786,409 loops=1)