pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres Analog of Oracle APPEND hint
9+ messages / 7 participants
[nested] [flat]

* Postgres Analog of Oracle APPEND hint
@ 2021-02-25 14:44  Rumpi Gravenstein <rgravens@gmail.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Rumpi Gravenstein @ 2021-02-25 14:44 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

All,

Using PostgreSQL 13.1

I am new to PostgreSQL transitioning from Oracle.  One of the many Oracle
tricks I learned is that large inserts can be sped up by adding the direct
path load hint /*+APPEND*/ .  I am faced with having to perform many large
inserts (100K->100M rows) in my PostgreSQL database.

My questions are:

   - Is there something comparable within the PostgreSQL community edition
   product?
   - Are my only options to un-log the table and tune instance memory
   parameters?

I've googled for this and can't find a definitive statement on this point.

-- 
Rumpi Gravenstein

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 15:31  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Jayadevan M @ 2021-02-25 15:31 UTC (permalink / raw)
  To: Rumpi Gravenstein <rgravens@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

>
> Using PostgreSQL 13.1
>
> I am new to PostgreSQL transitioning from Oracle.  One of the many Oracle
> tricks I learned is that large inserts can be sped up by adding the direct
> path load hint /*+APPEND*/ .  I am faced with having to perform many large
> inserts (100K->100M rows) in my PostgreSQL database.
>
> My questions are:
>
>    - Is there something comparable within the PostgreSQL community
>    edition product?
>    - Are my only options to un-log the table and tune instance memory
>    parameters?
>
>
> I remember trying this some time ago. It is not part of the PG community
edition. Still, worth a look -
https://ossc-db.github.io/pg_bulkload/pg_bulkload.html
<https://ossc-db.github.io/pg_bulkload/pg_bulkload.html;

Regards,
Jayadevan

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 15:35  Mark Johnson <remi9898@gmail.com>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Mark Johnson @ 2021-02-25 15:35 UTC (permalink / raw)
  To: Rumpi Gravenstein <rgravens@gmail.com>; +Cc: PostgreSQL <pgsql-general@lists.postgresql.org>

Since INSERT /*+APPEND*/ is generally used when bulk loading data into
Oracle from external files you should probably look at the PostgreSQL COPY
command (https://www.postgresql.org/docs/13/sql-copy.html) and additional
utilities like pg_bulkload (https://github.com/ossc-db/pg_bulkload)   .

On Thu, Feb 25, 2021 at 9:45 AM Rumpi Gravenstein <rgravens@gmail.com>
wrote:

> All,
>
> Using PostgreSQL 13.1
>
> I am new to PostgreSQL transitioning from Oracle.  One of the many Oracle
> tricks I learned is that large inserts can be sped up by adding the direct
> path load hint /*+APPEND*/ .  I am faced with having to perform many large
> inserts (100K->100M rows) in my PostgreSQL database.
>
> My questions are:
>
>    - Is there something comparable within the PostgreSQL community
>    edition product?
>    - Are my only options to un-log the table and tune instance memory
>    parameters?
>
> I've googled for this and can't find a definitive statement on this
> point.
>
> --
> Rumpi Gravenstein
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 16:26  Rumpi Gravenstein <rgravens@gmail.com>
  parent: Mark Johnson <remi9898@gmail.com>
  0 siblings, 3 replies; 9+ messages in thread

From: Rumpi Gravenstein @ 2021-02-25 16:26 UTC (permalink / raw)
  To: Mark Johnson <remi9898@gmail.com>; +Cc: PostgreSQL <pgsql-general@lists.postgresql.org>

Unfortunately, I am not looking to load from an external source.  My
process is moving data from source PostgreSQL tables to target PostgreSQL
tables.

On Thu, Feb 25, 2021 at 10:36 AM Mark Johnson <remi9898@gmail.com> wrote:

> Since INSERT /*+APPEND*/ is generally used when bulk loading data into
> Oracle from external files you should probably look at the PostgreSQL COPY
> command (https://www.postgresql.org/docs/13/sql-copy.html) and additional
> utilities like pg_bulkload (https://github.com/ossc-db/pg_bulkload)   .
>
> On Thu, Feb 25, 2021 at 9:45 AM Rumpi Gravenstein <rgravens@gmail.com>
> wrote:
>
>> All,
>>
>> Using PostgreSQL 13.1
>>
>> I am new to PostgreSQL transitioning from Oracle.  One of the many Oracle
>> tricks I learned is that large inserts can be sped up by adding the direct
>> path load hint /*+APPEND*/ .  I am faced with having to perform many large
>> inserts (100K->100M rows) in my PostgreSQL database.
>>
>> My questions are:
>>
>>    - Is there something comparable within the PostgreSQL community
>>    edition product?
>>    - Are my only options to un-log the table and tune instance memory
>>    parameters?
>>
>> I've googled for this and can't find a definitive statement on this
>> point.
>>
>> --
>> Rumpi Gravenstein
>>
>

-- 
Rumpi Gravenstein

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 16:34  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2021-02-25 16:34 UTC (permalink / raw)
  To: Rumpi Gravenstein <rgravens@gmail.com>; +Cc: Mark Johnson <remi9898@gmail.com>; PostgreSQL <pgsql-general@lists.postgresql.org>

Rumpi Gravenstein <rgravens@gmail.com> writes:
> Unfortunately, I am not looking to load from an external source.  My
> process is moving data from source PostgreSQL tables to target PostgreSQL
> tables.

The hints in

https://www.postgresql.org/docs/current/populate.html

would still largely apply, though of course not the advice to use COPY.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 16:40  Rob Sargent <robjsargent@gmail.com>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  2 siblings, 1 reply; 9+ messages in thread

From: Rob Sargent @ 2021-02-25 16:40 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 2/25/21 9:26 AM, Rumpi Gravenstein wrote:
> Unfortunately, I am not looking to load from an external source.  My 
> process is moving data from source PostgreSQL tables to target 
> PostgreSQL tables.
> 
Are you trying to duplicate the source tables in the target tables?  If 
so, there are replication tools for this.  If not, temporary tables in 
the target db (possible loaded with copy) and smallish batches of 
inserts from those to target might be an option.






^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-02-25 19:52  Rumpi Gravenstein <rgravens@gmail.com>
  parent: Rob Sargent <robjsargent@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Rumpi Gravenstein @ 2021-02-25 19:52 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

My use case involves complicated joins on source tables in one schema
loading a target table in the same or a different schema.

On Thu, Feb 25, 2021 at 11:41 AM Rob Sargent <robjsargent@gmail.com> wrote:

> On 2/25/21 9:26 AM, Rumpi Gravenstein wrote:
> > Unfortunately, I am not looking to load from an external source.  My
> > process is moving data from source PostgreSQL tables to target
> > PostgreSQL tables.
> >
> Are you trying to duplicate the source tables in the target tables?  If
> so, there are replication tools for this.  If not, temporary tables in
> the target db (possible loaded with copy) and smallish batches of
> inserts from those to target might be an option.
>
>
>
>

-- 
Rumpi Gravenstein

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-03-05 15:10  Peter J. Holzer <hjp-pgsql@hjp.at>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter J. Holzer @ 2021-03-05 15:10 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 2021-02-25 14:52:20 -0500, Rumpi Gravenstein wrote:
> My use case involves complicated joins on source tables in one schema loading a
> target table in the same or a different schema.

So source(s) and target are in the same database? That wasn't clear from
your earlier mails.

If you are doing "complicated joins on source tables" that's probably
where the bottleneck will be, so you shouldn't worry about the insert
speed unless (or until) you notice that the bottleneck is writing the
data, not reading it.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Postgres Analog of Oracle APPEND hint
@ 2021-03-05 20:15  Merlin Moncure <mmoncure@gmail.com>
  parent: Rumpi Gravenstein <rgravens@gmail.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Merlin Moncure @ 2021-03-05 20:15 UTC (permalink / raw)
  To: Rumpi Gravenstein <rgravens@gmail.com>; +Cc: Mark Johnson <remi9898@gmail.com>; PostgreSQL <pgsql-general@lists.postgresql.org>

On Thu, Feb 25, 2021 at 10:26 AM Rumpi Gravenstein <rgravens@gmail.com> wrote:
>
> Unfortunately, I am not looking to load from an external source.  My process is moving data from source PostgreSQL tables to target PostgreSQL tables.


INSERT INTO ...SELECT ... is one of the fastest ways possible to move
data around.

merlin





^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2021-03-05 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 14:44 Postgres Analog of Oracle APPEND hint Rumpi Gravenstein <rgravens@gmail.com>
2021-02-25 15:31 ` Jayadevan M <maymala.jayadevan@gmail.com>
2021-02-25 15:35 ` Mark Johnson <remi9898@gmail.com>
2021-02-25 16:26   ` Rumpi Gravenstein <rgravens@gmail.com>
2021-02-25 16:34     ` Tom Lane <tgl@sss.pgh.pa.us>
2021-02-25 16:40     ` Rob Sargent <robjsargent@gmail.com>
2021-02-25 19:52       ` Rumpi Gravenstein <rgravens@gmail.com>
2021-03-05 15:10         ` Peter J. Holzer <hjp-pgsql@hjp.at>
2021-03-05 20:15     ` Merlin Moncure <mmoncure@gmail.com>

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