explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kdeA

Settings
# exclusive inclusive rows x rows loops node
1. 38.485 129,900.489 ↓ 23,827.0 23,827 1

GroupAggregate (cost=63,810.98..63,811.07 rows=1 width=745) (actual time=129,799.823..129,900.489 rows=23,827 loops=1)

  • Group Key: f.idempresa, e.nombreempresa, a.nroarticulo, a.descripcionarticulo, ae.factorconversion, ae.cantidadxembalaje, f.fecharendicion, cla.descripcionclasificacion, m.descripcionmarca, l.descripcionlinea, a.sku
2. 459.693 129,862.004 ↓ 65,423.0 65,423 1

Sort (cost=63,810.98..63,810.99 rows=1 width=679) (actual time=129,799.698..129,862.004 rows=65,423 loops=1)

  • Sort Key: f.idempresa, e.nombreempresa, a.nroarticulo, a.descripcionarticulo, ae.factorconversion, ae.cantidadxembalaje, f.fecharendicion, cla.descripcionclasificacion, m.descripcionmarca, l.descripcionlinea, a.sku
  • Sort Method: external merge Disk: 12520kB
3. 188.695 129,402.311 ↓ 65,423.0 65,423 1

Nested Loop Left Join (cost=2,704.86..63,810.97 rows=1 width=679) (actual time=62.358..129,402.311 rows=65,423 loops=1)

4. 0.000 134.037 ↓ 65,423.0 65,423 1

Gather (cost=2,704.29..63,717.35 rows=1 width=662) (actual time=57.188..134.037 rows=65,423 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 111.368 1,039.409 ↓ 32,712.0 32,712 2

Nested Loop (cost=1,704.29..62,717.25 rows=1 width=662) (actual time=46.175..1,039.409 rows=32,712 loops=2)

6. 109.294 928.039 ↓ 6,608.8 33,044 2

Nested Loop (cost=1,704.01..62,710.50 rows=5 width=670) (actual time=46.139..928.039 rows=33,044 loops=2)

7. 26.490 818.743 ↓ 6,608.8 33,044 2

Hash Join (cost=1,703.74..62,703.55 rows=5 width=651) (actual time=46.104..818.743 rows=33,044 loops=2)

  • Hash Cond: (f.idempresa = e.id)
8. 133.417 792.208 ↓ 6,608.8 33,044 2

Nested Loop (cost=1,702.09..62,701.88 rows=5 width=135) (actual time=45.927..792.208 rows=33,044 loops=2)

9. 78.509 658.788 ↓ 6,608.8 33,044 2

Hash Join (cost=1,701.81..62,694.70 rows=5 width=116) (actual time=45.880..658.788 rows=33,044 loops=2)

  • Hash Cond: (df.idarticuloembalaje = ae.id)
10. 430.327 537.426 ↓ 31.3 82,272 2

Nested Loop (cost=17.52..61,000.51 rows=2,626 width=38) (actual time=2.960..537.426 rows=82,272 loops=2)

11. 102.055 107.083 ↓ 37.5 22,270 2

Parallel Bitmap Heap Scan on factura f (cost=16.95..1,356.77 rows=594 width=24) (actual time=2.800..107.083 rows=22,270 loops=2)

  • Recheck Cond: ((fecharendicion >= ((date_trunc('month'::text, (CURRENT_DATE)::timestamp with time zone) - '1 mon'::interval))::date) AND (fecharendicion <= ((date_trunc('MONTH'::text, (CURRENT_DATE)::timestamp with time zone) + '1 mon -1 days'::interval))::date))
  • Filter: ((estado <> 2) AND (idempresa = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,26,27}'::bigint[])))
  • Rows Removed by Filter: 3454
  • Heap Blocks: exact=1
12. 5.028 5.028 ↓ 43.5 51,526 1

Bitmap Index Scan on "factura_IX_FechaRendicion" (cost=0.00..16.70 rows=1,184 width=0) (actual time=5.028..5.028 rows=51,526 loops=1)

  • Index Cond: ((fecharendicion >= ((date_trunc('month'::text, (CURRENT_DATE)::timestamp with time zone) - '1 mon'::interval))::date) AND (fecharendicion <= ((date_trunc('MONTH'::text, (CURRENT_DATE)::timestamp with time zone) + '1 mon -1 days'::interval))::date))
13. 0.016 0.016 ↑ 24.8 4 44,541

Index Scan using "detallefactura_IX_IDFactura" on detallefactura df (cost=0.56..99.42 rows=99 width=30) (actual time=0.010..0.016 rows=4 loops=44,541)

  • Index Cond: (idfactura = f.id)
14. 4.617 42.853 ↓ 164.7 9,224 2

Hash (cost=1,683.59..1,683.59 rows=56 width=94) (actual time=42.853..42.853 rows=9,224 loops=2)

  • Buckets: 16384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1280kB
15. 19.039 38.236 ↓ 164.7 9,224 2

Nested Loop (cost=194.93..1,683.59 rows=56 width=94) (actual time=1.775..38.236 rows=9,224 loops=2)

16. 2.646 19.195 ↓ 167.8 9,734 2

Hash Join (cost=194.64..1,595.61 rows=58 width=70) (actual time=1.694..19.195 rows=9,734 loops=2)

  • Hash Cond: (a.idproveedor = p.id)
17. 14.910 14.910 ↑ 1.0 30,619 2

Seq Scan on articulo a (cost=0.00..1,320.49 rows=30,649 width=78) (actual time=0.021..14.910 rows=30,619 loops=2)

18. 0.015 1.639 ↑ 1.0 28 2

Hash (cost=194.29..194.29 rows=28 width=8) (actual time=1.634..1.639 rows=28 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 1.624 1.624 ↑ 1.0 28 2

Index Scan using "proveedor_UQ_Proveedor_LegacyPK" on proveedor p (cost=0.29..194.29 rows=28 width=8) (actual time=0.053..1.624 rows=28 loops=2)

  • Index Cond: (codproveedor = 1)
20. 0.002 0.002 ↑ 1.0 1 19,468

Index Scan using "articuloembalaje_UQ_ArticuloEmbalaje_LegacyPK" on articuloembalaje ae (cost=0.29..1.51 rows=1 width=32) (actual time=0.001..0.002 rows=1 loops=19,468)

  • Index Cond: (idarticulo = a.id)
21. 0.003 0.003 ↑ 1.0 1 66,087

Index Scan using "PK_dbo.marca" on marca m (cost=0.28..1.44 rows=1 width=35) (actual time=0.003..0.003 rows=1 loops=66,087)

  • Index Cond: (id = a.idmarca)
22. 0.019 0.045 ↑ 1.0 29 2

Hash (cost=1.29..1.29 rows=29 width=524) (actual time=0.043..0.045 rows=29 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
23. 0.026 0.026 ↑ 1.0 29 2

Seq Scan on empresa e (cost=0.00..1.29 rows=29 width=524) (actual time=0.022..0.026 rows=29 loops=2)

24. 0.002 0.002 ↑ 1.0 1 66,087

Index Scan using "PK_dbo.linea" on linea l (cost=0.27..1.39 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=66,087)

  • Index Cond: (id = a.idlinea)
25. 0.002 0.002 ↑ 1.0 1 66,087

Index Scan using "PK_dbo.tipoarticulo" on tipoarticulo tp (cost=0.28..1.33 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=66,087)

  • Index Cond: (id = a.idtipoarticulo)
  • Filter: (codtipoarticulo = 1)
  • Rows Removed by Filter: 0
26. 0.000 129,079.579 ↑ 1.0 1 65,423

Nested Loop (cost=0.57..93.61 rows=1 width=33) (actual time=0.788..1.973 rows=1 loops=65,423)

27. 9,944.296 47,693.367 ↓ 44.9 1,483 65,423

Nested Loop (cost=0.28..41.62 rows=33 width=33) (actual time=0.004..0.729 rows=1,483 loops=65,423)

28. 327.115 327.115 ↓ 22.0 22 65,423

Seq Scan on tipoclasificacionarticulo tca (cost=0.00..1.60 rows=1 width=8) (actual time=0.001..0.005 rows=22 loops=65,423)

  • Filter: (codtipoclasificacion = 1)
  • Rows Removed by Filter: 27
29. 37,421.956 37,421.956 ↓ 2.0 67 1,439,306

Index Scan using "clasificacionarticulo_UQ_ClasificacionArticulo_LegacyPK" on clasificacionarticulo cla (cost=0.28..39.68 rows=34 width=41) (actual time=0.010..0.026 rows=67 loops=1,439,306)

  • Index Cond: (idtipoclasificacion = tca.id)
30. 97,022.309 97,022.309 ↓ 0.0 0 97,022,309

Index Scan using "articuloclasificacionarticulo_UQ_ArticuloClasificacionArticulo_" on articuloclasificacionarticulo acla (cost=0.29..1.57 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=97,022,309)

  • Index Cond: ((idclasificacion = cla.id) AND (a.id = idarticulo))
  • Filter: activo
Planning time : 8.711 ms
Execution time : 129,909.251 ms