dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.47k stars 550 forks source link

MSSQL to Azure Database for PostgreSQL: Slow and unreliable :( #1447

Open StanleyP opened 2 years ago

StanleyP commented 2 years ago

Hello,

I am experiencing VERY slow operation times and VERY high CPU usage using pgloader to copy data from Microsoft SQL Server 2016 (SP3) (KB5003279) - 13.0.6300.2 (X64) to Azure Database for PostgreSQL (single server - version 11) from Azure VM. I tried tweaking all parameters (workers, concurrency, work_mem, maintenance_work_mem, batch parameters...), but to no avail.

Source server: SQL Server 2016 SP3 Target server: Azure Database for PostgreSQL Pgloader server: 4xCPU 16GB memory Data size: ~35GB Copy time: ~8h

Any help or hints would be gladly appreciated. We try to replace our proprietary DB init-load tools with pgloader, but so far the results are really disappointing.

Kind regards, StanleyP

It is compiled from tag v3.6.9

pgloader version "3.6.7~devel"
compiled with Clozure Common Lisp Version 1.12 (v1.12) LinuxX8664
load database
     from mssql://{{MSSQL_CONNSTR}}
     into postgresql://{{PGSQL_CONNSTR}}

with create no indexes, reset sequences, workers = 4, concurrency = 1, uniquify index names,
     batch rows = 25000, batch size = 20MB, prefetch rows = 100000, on error stop

set work_mem to '64MB', maintenance_work_mem to '256MB'

cast type datetime  to timestamp,
     type datetime2 to timestamp,
     type char      to varchar drop typemod,
     type nchar     to varchar drop typemod,
     type varchar   to varchar drop typemod,
     type nvarchar  to varchar drop typemod,
     type xml       to varchar drop typemod

including only table names like '%' in schema 'schemaX'
including only table names like '%' in schema 'schemaY'