From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: speed up full table scan using psql
Date: Tue, 30 May 2023 22:36:40 -0600
Message-ID: <67ffdd7a-8870-c560-d5e4-c53f237f6ae3@gmail.com> (raw)
In-Reply-To: <CA+aY8X6E6qq-i_10G_wTjkorEtm3XYW+Ag+83xk7gmJUoAoing@mail.gmail.com>
References: <CA+aY8X6E6qq-i_10G_wTjkorEtm3XYW+Ag+83xk7gmJUoAoing@mail.gmail.com>
On 5/30/23 22:25, Lian Jiang wrote:
> hi,
>
> I am using psql to periodically dump the postgres tables into json
> files which are imported into snowflake. For large tables (e.g. 70M
> rows), it takes hours for psql to complete. Using spark to read the
> postgres table seems not to work as the postgres read only replication
> is the bottleneck so spark cluster never uses >1 worker node and the
> working node timeout or out of memory.
>
> Will vertical scaling the postgres db speed up psql? Or any thread
> related parameter of psql can help? Thanks for any hints.
>
> Regards
> Lian
Have you looked into COPY command? Or CopyManager java class?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: robjsargent@gmail.com
Subject: Re: speed up full table scan using psql
In-Reply-To: <67ffdd7a-8870-c560-d5e4-c53f237f6ae3@gmail.com>
References: <CA+aY8X6E6qq-i_10G_wTjkorEtm3XYW+Ag+83xk7gmJUoAoing@mail.gmail.com> <67ffdd7a-8870-c560-d5e4-c53f237f6ae3@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox