explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6rrLS

Settings
# exclusive inclusive rows x rows loops node
1. 0.174 223,582.930 ↓ 0.0 0 1

GroupAggregate (cost=354,973.11..354,973.20 rows=1 width=262) (actual time=223,582.930..223,582.930 rows=0 loops=1)

  • Group Key: f.idempresa, p.codproveedor, f.fecharendicion, v.nrovendedor, (((rtrim((e.nombreempleado)::text) || ' '::text) || rtrim((e.apellidoempleado)::text))), ag.codagencia, ag.descripcionagencia, cu.nrocuenta, cu.razonsocial, a.nroarticulo, a.descripcionarticulo, m.codmarca, m.descripcionmarca, df.preciobrutoconimpuesto, f.nrofactura, ae.id, la.codlistaajuste, df.montototal
2. 0.101 223,582.756 ↓ 0.0 0 1

Sort (cost=354,973.11..354,973.12 rows=1 width=242) (actual time=223,582.756..223,582.756 rows=0 loops=1)

  • Sort Key: f.idempresa, f.fecharendicion, v.nrovendedor, (((rtrim((e.nombreempleado)::text) || ' '::text) || rtrim((e.apellidoempleado)::text))), ag.codagencia, ag.descripcionagencia, cu.nrocuenta, cu.razonsocial, a.nroarticulo, a.descripcionarticulo, m.codmarca, m.descripcionmarca, df.preciobrutoconimpuesto, f.nrofactura, ae.id, la.codlistaajuste, df.montototal
  • Sort Method: quicksort Memory: 25kB
3. 0.009 223,582.655 ↓ 0.0 0 1

Nested Loop (cost=1,004.69..354,973.10 rows=1 width=242) (actual time=223,582.655..223,582.655 rows=0 loops=1)

4. 0.008 223,582.646 ↓ 0.0 0 1

Nested Loop (cost=1,004.41..354,971.62 rows=1 width=267) (actual time=223,582.646..223,582.646 rows=0 loops=1)

5. 0.000 223,582.638 ↓ 0.0 0 1

Nested Loop (cost=1,004.12..354,970.10 rows=1 width=251) (actual time=223,582.638..223,582.638 rows=0 loops=1)

6. 5,312.791 223,667.184 ↓ 0.0 0 1

Gather (cost=1,003.83..354,968.59 rows=1 width=251) (actual time=223,582.629..223,667.184 rows=0 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
7. 0.004 218,354.393 ↓ 0.0 0 2

Nested Loop (cost=3.83..353,968.49 rows=1 width=251) (actual time=218,354.393..218,354.393 rows=0 loops=2)

8. 0.005 218,354.389 ↓ 0.0 0 2

Nested Loop (cost=3.55..353,967.05 rows=1 width=228) (actual time=218,354.389..218,354.389 rows=0 loops=2)

9. 0.003 218,354.384 ↓ 0.0 0 2

Nested Loop (cost=3.27..353,965.73 rows=1 width=240) (actual time=218,354.384..218,354.384 rows=0 loops=2)

10. 0.006 218,354.381 ↓ 0.0 0 2

Nested Loop (cost=2.99..353,964.35 rows=1 width=195) (actual time=218,354.380..218,354.381 rows=0 loops=2)

11. 0.004 218,354.375 ↓ 0.0 0 2

Nested Loop (cost=2.56..353,601.53 rows=215 width=195) (actual time=218,354.375..218,354.375 rows=0 loops=2)

12. 0.004 218,354.371 ↓ 0.0 0 2

Nested Loop (cost=2.42..353,334.43 rows=215 width=174) (actual time=218,354.371..218,354.371 rows=0 loops=2)

13. 0.006 218,354.367 ↓ 0.0 0 2

Nested Loop (cost=2.28..353,064.09 rows=215 width=174) (actual time=218,354.367..218,354.367 rows=0 loops=2)

14. 93,829.206 218,354.361 ↓ 0.0 0 2

Nested Loop (cost=1.86..352,703.54 rows=215 width=159) (actual time=218,354.361..218,354.361 rows=0 loops=2)

15. 124,328.048 124,525.149 ↓ 302.7 15,276,794 2

Nested Loop (cost=1.42..264,611.42 rows=50,471 width=119) (actual time=2.880..124,525.149 rows=15,276,794 loops=2)

16. 57.545 164.538 ↓ 117.0 3,627 2

Nested Loop (cost=0.86..34,891.93 rows=31 width=73) (actual time=2.149..164.538 rows=3,627 loops=2)

17. 39.935 106.980 ↓ 120.0 3,840 2

Nested Loop (cost=0.57..34,842.84 rows=32 width=57) (actual time=1.722..106.980 rows=3,840 loops=2)

18. 67.043 67.043 ↑ 1.2 15,310 2

Parallel Index Scan using "articulo_IX_IDMarca" on articulo a (cost=0.29..7,722.14 rows=18,029 width=57) (actual time=0.047..67.043 rows=15,310 loops=2)

19. 0.002 0.002 ↓ 0.0 0 30,619

Index Scan using "PK_dbo.proveedor" on proveedor p (cost=0.29..1.50 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=30,619)

  • Index Cond: (id = a.idproveedor)
  • Filter: (codproveedor = 2)
  • Rows Removed by Filter: 1
20. 0.013 0.013 ↑ 1.0 1 7,680

Index Scan using "articuloembalaje_UQ_ArticuloEmbalaje_LegacyPK" on articuloembalaje ae (cost=0.29..1.52 rows=1 width=32) (actual time=0.012..0.013 rows=1 loops=7,680)

  • Index Cond: (idarticulo = a.id)
21. 32.563 32.563 ↑ 2.7 4,212 7,254

Index Scan using "detallefactura_IX_IdArticuloEmbalaje" on detallefactura df (cost=0.56..7,295.37 rows=11,494 width=46) (actual time=0.089..32.563 rows=4,212 loops=7,254)

  • Index Cond: (idarticuloembalaje = ae.id)
22. 0.006 0.006 ↓ 0.0 0 30,553,589

Index Scan using "PK_dbo.factura" on factura f (cost=0.43..1.75 rows=1 width=56) (actual time=0.006..0.006 rows=0 loops=30,553,589)

  • Index Cond: (id = df.idfactura)
  • Filter: ((estado <> 2) AND ((fecharendicion)::date >= ((date_trunc('day'::text, (CURRENT_DATE)::timestamp with time zone) - '1 day'::interval))::date) AND ((fecharendicion)::date <= ((date_trunc('MONTH'::text, (CURRENT_DATE)::timestamp with time zone) + '1 mon -1 days'::interval))::date) 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: 1
23. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.cuenta" on cuenta cu (cost=0.42..1.68 rows=1 width=31) (never executed)

  • Index Cond: (id = f.idcuenta)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.deposito" on deposito d (cost=0.14..1.26 rows=1 width=16) (never executed)

  • Index Cond: (id = f.iddeposito)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.agencia" on agencia ag (cost=0.14..1.26 rows=1 width=37) (never executed)

  • Index Cond: (id = d.idagencia)
26. 0.000 0.000 ↓ 0.0 0

Index Scan using "detallefacturaescala_UQ_DetalleFacturaEscala_LegacyPK" on detallefacturaescala dfe (cost=0.43..1.68 rows=1 width=32) (never executed)

  • Index Cond: ((iddetallefactura = df.id) AND (idarticuloembalaje = df.idarticuloembalaje))
27. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.empleado" on empleado e (cost=0.28..1.38 rows=1 width=45) (never executed)

  • Index Cond: (id = f.idvendedor)
28. 0.000 0.000 ↓ 0.0 0

Index Scan using "vendedor_IX_ID" on vendedor v (cost=0.28..1.32 rows=1 width=12) (never executed)

  • Index Cond: (id = f.idvendedor)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.marca" on marca m (cost=0.28..1.44 rows=1 width=39) (never executed)

  • Index Cond: (id = a.idmarca)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.escalasublistaajuste" on escalasublistaajuste esa (cost=0.29..1.51 rows=1 width=16) (never executed)

  • Index Cond: (id = dfe.idescalasublistaajuste)
31. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.sublistaajuste" on sublistaajuste sla (cost=0.29..1.52 rows=1 width=32) (never executed)

  • Index Cond: (id = esa.idsublistaajuste)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_dbo.listaajuste" on listaajuste la (cost=0.28..1.46 rows=1 width=28) (never executed)

  • Index Cond: (id = sla.idlistaajuste)
  • Filter: ((sla.finvigencialistaajuste = finvigencia) AND (sla.idempresa = idempresa))
Planning time : 24.881 ms
Execution time : 223,669.502 ms