Re: Logical Replication speed-up initial data

From: Nikhil Shetty <nikhil(dot)dba04(at)gmail(dot)com>
To: Stefano Amoroso <stefano(dot)amoroso(at)gmail(dot)com>
Cc: Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical Replication speed-up initial data
Date: 2021-08-05 04:57:50
Message-ID: CAFpL5VzE9EAat-NCNwwrQrcra69ZdhByO=ebaBjp-eL3nMN66Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Stefano,

Thank you for the information.

Regards,
Nikhil

On Wed, Aug 4, 2021 at 9:25 PM Stefano Amoroso <stefano(dot)amoroso(at)gmail(dot)com>
wrote:

> Hello,
> in my experience, to speed up the initial load, I had to drop UKs and FKs.
> Unfortunately, the initial load doesn't work in parallel and, for each
> table, there is only one sync worker.
>
> Regards
>
> Stefano Amoroso
>
> Il giorno mer 4 ago 2021 alle ore 17:24 Hüseyin Demir <
> demirhuseyinn(dot)94(at)gmail(dot)com> ha scritto:
>
>> Hello,
>>
>> I also faced a similar issue. Try removing the indexes on the destination
>> first if possible. After that, you can add the indexes.
>>
>> Regards.
>>
>>
>> Nikhil Shetty <nikhil(dot)dba04(at)gmail(dot)com>, 4 Ağu 2021 Çar, 18:07 tarihinde
>> şunu yazdı:
>>
>>> Hi Team,
>>>
>>> We have a highly transactional system as the source of logical
>>> replication and the database size is 500GB+. We are replicating all tables
>>> from source using logical replication.
>>>
>>> For two tables the initial data load is very slow and it never completes
>>> even after 24hrs+
>>> Table size is under 100GB and index size is around 400GB.
>>>
>>> How can we increase the speed of the initial data load without dropping
>>> the indexes on destination?
>>>
>>> We increased max_sync_workers_per_subscription to 3 but it didn't help
>>> much for single tables
>>>
>>> Thanks,
>>> Nikhil
>>>
>>
>>
>> --
>> Hüseyin Demir
>>
>> Senior Database Platform Engineer
>>
>> Twitter: https://twitter.com/d3rh5n
>> Linkedin: hseyindemir
>> <https://www.linkedin.com/in/h%C3%BCseyin-demir-4020699b/>
>> Github: https://github.com/hseyindemir
>> Gitlab: https://gitlab.com/demirhuseyinn.94
>> Medium: https://demirhuseyinn-94.medium.com/
>>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rick Otten 2021-08-05 13:25:57 Re: Logical Replication speed-up initial data
Previous Message Nikhil Shetty 2021-08-05 04:56:59 Re: Logical Replication speed-up initial data