Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4mNH-0004d7-Sz for pgsql-sql@arkaria.postgresql.org; Mon, 12 Dec 2022 17:13:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p4mNF-0006zd-RU for pgsql-sql@arkaria.postgresql.org; Mon, 12 Dec 2022 17:13:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4mNF-0006yZ-H0 for pgsql-sql@lists.postgresql.org; Mon, 12 Dec 2022 17:13:53 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p4mNB-0000i9-G8 for pgsql-sql@lists.postgresql.org; Mon, 12 Dec 2022 17:13:53 +0000 Received: by mail-qt1-x82c.google.com with SMTP id h16so9510305qtu.2 for ; Mon, 12 Dec 2022 09:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=YL5Fa4UnKKe3apDNyzQ8rINqR9nHUxDkfBhpUi1alQo=; b=jKu6/zVF8I04CtZSuVazvMatNeOqLXfhHfCEUGQflxTC3wQxW8TJL9fnrSHcVSNbxO 8Hd0WhLxYyIiogMcjU6qQLeheMievQnnDoxWCHqWVcppWJZhXNb64M7Dia26GP+dmSZ7 x4E5G+fdhrUu5ODWx9tQQu6K8o2Tr+SUV+JPTe+20jUH6HW0bCfH/pJwAI0INOowcTIQ DI/FjJS7m0DESKIECywj06FMtW8ABlE41m7cue4cbTQjxv4TjM0wtSJUKogJTjFPAHO/ BhMlaieHUaig/7Mp5ciqkFuP8/+rw1lrRbPSzeuepiDkDxeFzVqCYv2DwbLqH3+3NvGt a9tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YL5Fa4UnKKe3apDNyzQ8rINqR9nHUxDkfBhpUi1alQo=; b=O77CW/g+ibaoZEov1C7G9+uCVmWRpiu3EvvVlI4o0Hahm+FG/RuE0geWM76xnZG/WK pqeOz9SnAzvKXVXfi0iVPJIuRYkUbHFLiM9nbkev7ROm14DPtqhO7xhRoHG+XLWstaAN NPB5k4TD5TR0ktnpTspjlDyVia6HKRLFNiSOLgedHvYJYMEmIX3qi3fuiqeY2OODtPTe dZY+H9FbNZso+T9gWzDaxNs6DLZq1BS0U26B3b5naTToh3Su6WO0csKOaRcvdrPySsIf 5FzKKIcc4+LTA6FM61sWqgz1EAFIvY18Sg7qFg5kkkvhywDS+jyU7rasVB17nLly8EO3 35cg== X-Gm-Message-State: ANoB5plAYk7HmtREC4yFC/Mv/eevxm7OtN6t3E3ghhfDVi4SJBlO6CNH rxXMHfjMD3FUiO2K/cU6/sBBvJ9M5P4= X-Google-Smtp-Source: AA0mqf5ywKtvScKVARyzMgaG8y7tyefkzPL9L5tBLTv/SNA2uokQaZ1ns6RvlekG4vDvsnlTcVD4lw== X-Received: by 2002:ac8:7452:0:b0:3a8:e7e:182c with SMTP id h18-20020ac87452000000b003a80e7e182cmr13610799qtr.32.1670865227559; Mon, 12 Dec 2022 09:13:47 -0800 (PST) Received: from smtpclient.apple (162-231-200-43.lightspeed.dybhfl.sbcglobal.net. [162.231.200.43]) by smtp.gmail.com with ESMTPSA id t7-20020ac86a07000000b003a569a0afcasm5983970qtr.66.2022.12.12.09.13.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2022 09:13:47 -0800 (PST) From: Shane Borden Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_4C2D72E4-551B-4112-A8C5-C8560A83357B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: PARALLEL CTAS Date: Mon, 12 Dec 2022 12:13:36 -0500 In-Reply-To: Cc: pgsql-sql@lists.postgresql.org To: Erik Brandsberg References: X-Mailer: Apple Mail (2.3731.200.110.1.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_4C2D72E4-551B-4112-A8C5-C8560A83357B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 The issue is there are certain performance benefits to be had by doing = parallel CTAS operations and when converting from Oracle to PostgreSQL = switching to a =E2=80=9CCOPY=E2=80=9D operation isn=E2=80=99t feasible. --- Thanks, Shane Borden sborden76@gmail.com > On Dec 12, 2022, at 11:55 AM, Erik Brandsberg = wrote: >=20 > Copy operations are by far the most efficient way to do bulk loads. = The fdw extension isn't very efficient based on prior experience. >=20 > On Mon, Dec 12, 2022 at 11:17 AM Shane Borden > wrote: >> Based on testing thus far, it appears that the only way to get a bulk = load operation (similar to oracle) would be to use the COPY command or = to use multiple connections and break up the inserts across connections. = I did see a possibility of using the postgres_fdw extension and use the = batch functionality, but I haven=E2=80=99t tested that yet. >>=20 >> Does anyone know the status of this feature / patch that was = discussed in this link? >>=20 >> = https://www.postgresql.org/message-id/CAJcOf-cXnB5cnMKqWEp2E2z7Mvcd04iLVmV= %3DqpFJrR3AcrTS3g%40mail.gmail.com >>=20 >> Is there a way in PostgreSQL to parallelize a CTAS statement similar = to how you can do it in Oracle? >>=20 >> --- >>=20 >> Thanks, >>=20 >>=20 >> Shane Borden >> sborden76@gmail.com --Apple-Mail=_4C2D72E4-551B-4112-A8C5-C8560A83357B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 The issue is = there are certain performance benefits to be had by doing parallel CTAS = operations and when converting from Oracle to PostgreSQL switching to a = =E2=80=9CCOPY=E2=80=9D operation isn=E2=80=99t feasible.
---

Thanks,


Shane = Borden
sborden76@gmail.com

On Dec 12, 2022, at 11:55 AM, = Erik Brandsberg <erik@heimdalldata.com> wrote:

Copy = operations are by far the most efficient way to do bulk = loads.  The fdw extension isn't very efficient based on prior = experience.

On Mon, Dec 12, 2022 at 11:17 AM Shane Borden = <sborden76@gmail.com> = wrote:
Based on testing thus far, = it appears that the only way to get a bulk load operation (similar to = oracle) would be to use the COPY command or to use multiple connections = and break up the inserts across connections.  I did see a = possibility of using the postgres_fdw extension and use the batch = functionality, but I haven=E2=80=99t tested that = yet.

Does anyone know the status of this = feature / patch that was discussed in this = link?


Is there a way in PostgreSQL to parallelize a CTAS statement = similar to how you can do it in Oracle?

---

Thanks,


Shane Borden
sborden76@gmail.com


= --Apple-Mail=_4C2D72E4-551B-4112-A8C5-C8560A83357B--