explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KIIG

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 96,824.476 ↓ 0.0 0 1

GroupAggregate (cost=1,860.48..1,860.57 rows=1 width=267) (actual time=96,824.476..96,824.476 rows=0 loops=1)

  • Group Key: f.idempresa, f.fecharendicion, v.nrovendedor, ag.codagencia, ag.descripcionagencia, cu.nrocuenta, cu.razonsocial, a.nroarticulo, a.descripcionarticulo, m.codmarca, m.descripcionmarca, df.preciobrutoconimpuesto, f.nrofactura, la.codlistaajuste, df.montototal, e.nombreempleado, e.apellidoempleado
2. 0.144 96,824.454 ↓ 0.0 0 1

Sort (cost=1,860.48..1,860.49 rows=1 width=215) (actual time=96,824.454..96,824.454 rows=0 loops=1)

  • Sort Key: f.idempresa, f.fecharendicion, v.nrovendedor, ag.codagencia, ag.descripcionagencia, cu.nrocuenta, cu.razonsocial, a.nroarticulo, a.descripcionarticulo, m.codmarca, m.descripcionmarca, df.preciobrutoconimpuesto, f.nrofactura, la.codlistaajuste, df.montototal, e.nombreempleado, e.apellidoempleado
  • Sort Method: quicksort Memory: 25kB
3. 0.004 96,824.310 ↓ 0.0 0 1

Nested Loop (cost=4.40..1,860.47 rows=1 width=215) (actual time=96,824.310..96,824.310 rows=0 loops=1)

4. 0.004 96,824.306 ↓ 0.0 0 1

Nested Loop (cost=4.12..1,859.04 rows=1 width=192) (actual time=96,824.306..96,824.306 rows=0 loops=1)

5. 0.005 96,824.302 ↓ 0.0 0 1

Nested Loop (cost=3.85..1,857.72 rows=1 width=204) (actual time=96,824.302..96,824.302 rows=0 loops=1)

6. 0.004 96,824.297 ↓ 0.0 0 1

Nested Loop (cost=3.57..1,856.33 rows=1 width=159) (actual time=96,824.297..96,824.297 rows=0 loops=1)

7. 0.004 96,824.293 ↓ 0.0 0 1

Nested Loop (cost=3.28..1,854.86 rows=1 width=179) (actual time=96,824.293..96,824.293 rows=0 loops=1)

8. 0.005 96,824.289 ↓ 0.0 0 1

Nested Loop (cost=3.00..1,853.34 rows=1 width=163) (actual time=96,824.289..96,824.289 rows=0 loops=1)

9. 0.004 96,824.284 ↓ 0.0 0 1

Nested Loop (cost=2.71..1,851.83 rows=1 width=163) (actual time=96,824.284..96,824.284 rows=0 loops=1)

  • Join Filter: (d.idagencia = ag.id)
10. 0.007 96,824.280 ↓ 0.0 0 1

Nested Loop (cost=2.71..1,848.55 rows=1 width=142) (actual time=96,824.280..96,824.280 rows=0 loops=1)

  • Join Filter: (f.iddeposito = d.id)
11. 0.005 96,824.273 ↓ 0.0 0 1

Nested Loop (cost=2.71..1,839.58 rows=1 width=142) (actual time=96,824.273..96,824.273 rows=0 loops=1)

12. 196.248 96,824.268 ↓ 0.0 0 1

Nested Loop (cost=2.29..1,837.90 rows=1 width=127) (actual time=96,824.268..96,824.268 rows=0 loops=1)

13. 1,813.242 71,776.364 ↓ 3,106,457.0 3,106,457 1

Nested Loop (cost=1.85..1,836.18 rows=1 width=87) (actual time=6.022..71,776.364 rows=3,106,457 loops=1)

14. 671.104 4,727.525 ↓ 14,448.6 3,106,457 1

Nested Loop (cost=1.29..1,416.50 rows=215 width=81) (actual time=5.290..4,727.525 rows=3,106,457 loops=1)

15. 3.390 78.649 ↓ 3,142.0 6,284 1

Nested Loop (cost=0.86..62.03 rows=2 width=49) (actual time=2.555..78.649 rows=6,284 loops=1)

16. 3.376 35.011 ↓ 3,354.0 6,708 1

Nested Loop (cost=0.57..58.96 rows=2 width=49) (actual time=2.176..35.011 rows=6,708 loops=1)

17. 3.364 3.364 ↓ 17.0 17 1

Index Scan using proveedor_codproveedor_idx on proveedor p (cost=0.29..11.07 rows=1 width=8) (actual time=2.104..3.364 rows=17 loops=1)

  • Index Cond: (codproveedor = 2)
  • Filter: (idempresa = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,26,27}'::bigint[]))
  • Rows Removed by Filter: 9
18. 28.271 28.271 ↓ 3.8 395 17

Index Scan using articulo_idproveedor_idx on articulo a (cost=0.29..46.86 rows=103 width=57) (actual time=0.086..1.663 rows=395 loops=17)

  • Index Cond: (idproveedor = p.id)
19. 40.248 40.248 ↑ 1.0 1 6,708

Index Scan using "articuloembalaje_UQ_ArticuloEmbalaje_LegacyPK" on articuloembalaje ae (cost=0.29..1.52 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=6,708)

  • Index Cond: (idarticulo = a.id)
20. 3,977.772 3,977.772 ↑ 5.1 494 6,284

Index Scan using detallefacturaescala_idarticuloembalaje_idx on detallefacturaescala dfe (cost=0.43..652.22 rows=2,501 width=32) (actual time=0.010..0.633 rows=494 loops=6,284)

  • Index Cond: (idarticuloembalaje = ae.id)
21. 65,235.597 65,235.597 ↑ 1.0 1 3,106,457

Index Scan using "PK_dbo.detallefactura" on detallefactura df (cost=0.56..1.94 rows=1 width=46) (actual time=0.021..0.021 rows=1 loops=3,106,457)

  • Index Cond: (id = dfe.iddetallefactura)
  • Filter: (dfe.idarticuloembalaje = idarticuloembalaje)
22. 24,851.656 24,851.656 ↓ 0.0 0 3,106,457

Index Scan using "PK_dbo.factura" on factura f (cost=0.43..1.72 rows=1 width=56) (actual time=0.008..0.008 rows=0 loops=3,106,457)

  • 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))
  • 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

Seq Scan on deposito d (cost=0.00..6.21 rows=221 width=16) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Seq Scan on agencia ag (cost=0.00..2.57 rows=57 width=37) (never executed)

26. 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)
27. 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)
28. 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))
29. 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)
30. 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)
31. 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)