explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qcb

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 880.155 ↓ 5.9 200 1

Limit (cost=50,248.69..50,248.77 rows=34 width=260) (actual time=880.135..880.155 rows=200 loops=1)

2. 2.884 880.142 ↓ 5.9 200 1

Sort (cost=50,248.69..50,248.77 rows=34 width=260) (actual time=880.134..880.142 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. 25.434 877.258 ↓ 30.5 1,036 1

Hash Left Join (cost=530.95..50,247.82 rows=34 width=260) (actual time=848.604..877.258 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. 32.922 847.046 ↓ 26.5 67,971 1

Nested Loop Left Join (cost=55.44..49,742.63 rows=2,563 width=246) (actual time=12.352..847.046 rows=67,971 loops=1)

5. 36.073 746.153 ↓ 26.5 67,971 1

Nested Loop Left Join (cost=55.02..33,531.60 rows=2,563 width=227) (actual time=12.348..746.153 rows=67,971 loops=1)

6. 58.968 166.312 ↓ 26.5 67,971 1

Hash Join (cost=54.60..17,516.12 rows=2,563 width=213) (actual time=12.283..166.312 rows=67,971 loops=1)

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

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

  • Filter: (("Domain")::text = 'mys'::text)
8. 0.003 1.629 ↑ 3.0 1 1

Hash (cost=54.56..54.56 rows=3 width=37) (actual time=1.629..1.629 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
9. 1.626 1.626 ↑ 3.0 1 1

Seq Scan on "Proveedores" (cost=0.00..54.56 rows=3 width=37) (actual time=0.126..1.626 rows=1 loops=1)

  • Filter: ((lower(("Codigo")::text) = '10000'::text) OR (lower(("NombreComercial")::text) ~~ '%10000%'::text))
  • Rows Removed by Filter: 530
10. 543.768 543.768 ↑ 1.0 1 67,971

Index Scan using "Venta_Cabeceras_pkey" on "Venta_Cabeceras" (cost=0.42..6.24 rows=1 width=88) (actual time=0.008..0.008 rows=1 loops=67,971)

  • Index Cond: (("Venta_Cabecera_Id")::text = ("Venta_Transmitidas"."Venta_Cabecera_Id")::text)
11. 67.971 67.971 ↓ 0.0 0 67,971

Index Scan using "Compra_Cabeceras_pkey" on "Compra_Cabeceras" (cost=0.42..6.32 rows=1 width=93) (actual time=0.001..0.001 rows=0 loops=67,971)

  • Index Cond: (("Compra_Cabecera_Id")::text = ("Venta_Transmitidas"."Compra_Cabecera_Id")::text)
12. 2.040 4.778 ↑ 1.1 6,224 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 743kB
13. 2.738 2.738 ↑ 1.1 6,224 1

Seq Scan on "PGC_Facturas_Contables_Cabeceras" (cost=0.00..391.34 rows=6,734 width=88) (actual time=0.007..2.738 rows=6,224 loops=1)