explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hDl0

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 455,205.170 ↓ 2.5 200 1

Limit (cost=81,515.61..81,515.81 rows=79 width=260) (actual time=455,205.153..455,205.170 rows=200 loops=1)

2. 7.912 455,205.160 ↓ 2.5 200 1

Sort (cost=81,515.61..81,515.81 rows=79 width=260) (actual time=455,205.152..455,205.160 rows=200 loops=1)

  • Sort Key: "Venta_Transmitidas"."Fecha_Transmision", "Venta_Cabeceras"."Fecha_Servicio", "Venta_Cabeceras"."Serie", "Venta_Cabeceras"."Numero", "Compra_Cabeceras"."Fecha_Documento", "Compra_Cabeceras"."Serie", "Compra_Cabeceras"."Numero", "PGC_Factu (...)
  • Sort Method: top-N heapsort Memory: 78kB
3. 66.131 455,197.248 ↓ 13.1 1,036 1

Hash Left Join (cost=47,378.52..81,513.12 rows=79 width=260) (actual time=23,028.499..455,197.248 rows=1,036 loops=1)

  • Hash Cond: (("Venta_Transmitidas"."Factura_Contable_Cabecera_Id")::text = ("PGC_Facturas_Contables_Cabeceras"."PGC_Factura_Contable_Cabecera_Id")::text)
  • Filter: ((("Venta_Cabeceras"."Fecha_Servicio" >= '2018-12-01 00:00:00'::timestamp without time zone) AND ("Venta_Cabeceras"."Fecha_Servicio" < '2018-12-16 00:00:00'::timestamp without time zone)) OR (("Compra_Cabeceras"."Fecha_Documento" >= ' (...)
  • Rows Removed by Filter: 66935
4. 454,342.744 455,125.811 ↓ 11.4 67,971 1

Hash Right Join (cost=46,903.01..80,968.36 rows=5,980 width=246) (actual time=23,023.137..455,125.811 rows=67,971 loops=1)

  • Hash Cond: (("Venta_Cabeceras"."Venta_Cabecera_Id")::text = ("Venta_Transmitidas"."Venta_Cabecera_Id")::text)
5. 273.667 273.667 ↓ 1.0 292,458 1

Seq Scan on "Venta_Cabeceras" (cost=0.00..24,786.93 rows=290,493 width=88) (actual time=0.020..273.667 rows=292,458 loops=1)

6. 43.957 509.400 ↓ 11.4 67,971 1

Hash (cost=46,641.26..46,641.26 rows=5,980 width=232) (actual time=509.400..509.400 rows=67,971 loops=1)

  • Buckets: 1024 Batches: 131072 (originally 2) Memory Usage: 2238kB
7. 150.483 465.443 ↓ 11.4 67,971 1

Hash Right Join (cost=17,801.08..46,641.26 rows=5,980 width=232) (actual time=294.725..465.443 rows=67,971 loops=1)

  • Hash Cond: (("Compra_Cabeceras"."Compra_Cabecera_Id")::text = ("Venta_Transmitidas"."Compra_Cabecera_Id")::text)
8. 87.084 87.084 ↓ 1.0 113,723 1

Seq Scan on "Compra_Cabeceras" (cost=0.00..24,925.07 rows=113,107 width=93) (actual time=1.267..87.084 rows=113,723 loops=1)

9. 35.765 227.876 ↓ 11.4 67,971 1

Hash (cost=17,550.33..17,550.33 rows=5,980 width=213) (actual time=227.876..227.876 rows=67,971 loops=1)

  • Buckets: 1024 Batches: 512 (originally 2) Memory Usage: 10826kB
10. 70.578 192.111 ↓ 11.4 67,971 1

Hash Join (cost=54.65..17,550.33 rows=5,980 width=213) (actual time=10.836..192.111 rows=67,971 loops=1)

  • Hash Cond: (("Venta_Transmitidas"."Proveedor_Id")::text = ("Proveedores"."Proveedor_Id")::text)
11. 120.521 120.521 ↑ 1.0 451,070 1

Seq Scan on "Venta_Transmitidas" (cost=0.00..15,744.38 rows=451,070 width=213) (actual time=0.013..120.521 rows=451,070 loops=1)

  • Filter: (("Domain")::text = 'mys'::text)
12. 0.002 1.012 ↑ 7.0 1 1

Hash (cost=54.56..54.56 rows=7 width=37) (actual time=1.012..1.012 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
13. 1.010 1.010 ↑ 7.0 1 1

Seq Scan on "Proveedores" (cost=0.00..54.56 rows=7 width=37) (actual time=0.127..1.010 rows=1 loops=1)

  • Filter: ((lower(("Codigo")::text) = 'sage'::text) OR (lower(("NombreComercial")::text) ~~ '%sage%'::text))
  • Rows Removed by Filter: 530
14. 2.189 5.306 ↑ 1.1 6,223 1

Hash (cost=391.34..391.34 rows=6,734 width=88) (actual time=5.306..5.306 rows=6,223 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 743kB
15. 3.117 3.117 ↑ 1.1 6,223 1

Seq Scan on "PGC_Facturas_Contables_Cabeceras" (cost=0.00..391.34 rows=6,734 width=88) (actual time=0.031..3.117 rows=6,223 loops=1)