explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SiO3

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 26,142.463 ↓ 0.0 0 1

GroupAggregate (cost=84,071.55..84,071.63 rows=1 width=299) (actual time=26,142.463..26,142.463 rows=0 loops=1)

  • Group Key: f.idempresa, p.codproveedor, f.fecharendicion, v.nrovendedor, 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, e.nombreempleado, e.apellidoempleado
2. 0.881 26,142.446 ↓ 0.0 0 1

Sort (cost=84,071.55..84,071.55 rows=1 width=247) (actual time=26,142.445..26,142.446 rows=0 loops=1)

  • Sort Key: f.idempresa, p.codproveedor, f.fecharendicion, v.nrovendedor, 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, e.nombreempleado, e.apellidoempleado
  • Sort Method: quicksort Memory: 25kB
3. 0.009 26,141.565 ↓ 0.0 0 1

Nested Loop (cost=3,266.21..84,071.54 rows=1 width=247) (actual time=26,141.565..26,141.565 rows=0 loops=1)

4. 0.001 26,141.556 ↓ 0.0 0 1

Nested Loop (cost=3,265.93..84,070.10 rows=1 width=224) (actual time=26,141.556..26,141.556 rows=0 loops=1)

5. 0.008 26,141.555 ↓ 0.0 0 1

Nested Loop (cost=3,265.65..84,068.63 rows=1 width=244) (actual time=26,141.555..26,141.555 rows=0 loops=1)

6. 0.009 26,141.547 ↓ 0.0 0 1

Nested Loop (cost=3,265.36..84,067.11 rows=1 width=228) (actual time=26,141.547..26,141.547 rows=0 loops=1)

7. 0.009 26,141.538 ↓ 0.0 0 1

Nested Loop (cost=3,265.07..84,065.60 rows=1 width=228) (actual time=26,141.538..26,141.538 rows=0 loops=1)

8. 0.009 26,141.529 ↓ 0.0 0 1

Nested Loop (cost=3,264.93..84,064.30 rows=1 width=207) (actual time=26,141.529..26,141.529 rows=0 loops=1)

9. 0.008 26,141.520 ↓ 0.0 0 1

Nested Loop (cost=3,264.65..84,062.98 rows=1 width=219) (actual time=26,141.520..26,141.520 rows=0 loops=1)

10. 0.195 26,141.512 ↓ 0.0 0 1

Nested Loop (cost=3,264.37..84,061.59 rows=1 width=174) (actual time=26,141.512..26,141.512 rows=0 loops=1)

  • Join Filter: (f.iddeposito = d.id)
11. 0.995 0.995 ↑ 1.0 221 1

Index Scan using "deposito_UQ_Deposito_LegacyPK" on deposito d (cost=0.14..72.00 rows=221 width=16) (actual time=0.040..0.995 rows=221 loops=1)

12. 0.000 26,140.322 ↓ 0.0 0 221

Materialize (cost=3,264.23..83,986.28 rows=1 width=174) (actual time=118.282..118.282 rows=0 loops=221)

13. 0.000 26,140.335 ↓ 0.0 0 1

Nested Loop (cost=3,264.23..83,986.27 rows=1 width=174) (actual time=26,140.335..26,140.335 rows=0 loops=1)

14. 118.254 26,228.317 ↓ 0.0 0 1

Gather (cost=3,263.81..83,984.60 rows=1 width=159) (actual time=26,140.323..26,228.317 rows=0 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
15. 6,002.828 26,110.063 ↓ 0.0 0 5

Nested Loop (cost=2,263.81..82,984.50 rows=1 width=159) (actual time=26,110.063..26,110.063 rows=0 loops=5)

16. 19,348.268 20,107.226 ↓ 29,030.8 638,678 5

Nested Loop (cost=2,263.38..82,946.57 rows=22 width=119) (actual time=110.177..20,107.226 rows=638,678 loops=5)

17. 352.467 758.928 ↓ 52.6 638,678 5

Hash Join (cost=2,262.81..59,237.55 rows=12,146 width=105) (actual time=86.742..758.928 rows=638,678 loops=5)

  • Hash Cond: (dfe.idarticuloembalaje = ae.id)
18. 320.073 320.073 ↑ 1.3 638,678 5

Parallel Seq Scan on detallefacturaescala dfe (cost=0.00..53,859.48 rows=798,348 width=32) (actual time=0.171..320.073 rows=638,678 loops=5)

19. 6.107 86.388 ↓ 41.2 18,559 5

Hash (cost=2,257.17..2,257.17 rows=451 width=73) (actual time=86.388..86.388 rows=18,559 loops=5)

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2152kB
20. 50.461 80.281 ↓ 41.2 18,559 5

Nested Loop (cost=140.95..2,257.17 rows=451 width=73) (actual time=1.154..80.281 rows=18,559 loops=5)

21. 6.025 29.818 ↓ 41.9 19,528 5

Hash Join (cost=140.67..1,542.25 rows=466 width=57) (actual time=1.060..29.818 rows=19,528 loops=5)

  • Hash Cond: (a.idproveedor = p.id)
22. 22.824 22.824 ↑ 1.0 30,619 5

Seq Scan on articulo a (cost=0.00..1,321.19 rows=30,619 width=57) (actual time=0.028..22.824 rows=30,619 loops=5)

23. 0.052 0.969 ↑ 1.0 226 5

Hash (cost=137.84..137.84 rows=226 width=16) (actual time=0.967..0.969 rows=226 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
24. 0.917 0.917 ↑ 1.0 226 5

Index Scan using "proveedor_UQ_Proveedor_LegacyPK" on proveedor p (cost=0.29..137.84 rows=226 width=16) (actual time=0.150..0.917 rows=226 loops=5)

  • Index Cond: (idempresa = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,26,27}'::bigint[]))
25. 0.002 0.002 ↑ 1.0 1 97,640

Index Scan using "articuloembalaje_UQ_ArticuloEmbalaje_LegacyPK" on articuloembalaje ae (cost=0.29..1.52 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=97,640)

  • Index Cond: (idarticulo = a.id)
26. 0.030 0.030 ↑ 1.0 1 3,193,391

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

  • Index Cond: (id = dfe.iddetallefactura)
  • Filter: (dfe.idarticuloembalaje = idarticuloembalaje)
27. 0.009 0.009 ↓ 0.0 0 3,193,391

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

  • 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
28. 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)
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.agencia" on agencia ag (cost=0.14..1.26 rows=1 width=37) (never executed)

  • Index Cond: (id = d.idagencia)
32. 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)
33. 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)
34. 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))
35. 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)