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 1p4mj5-0005ny-Vd for pgsql-sql@arkaria.postgresql.org; Mon, 12 Dec 2022 17:36:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p4mj4-00089M-Is for pgsql-sql@arkaria.postgresql.org; Mon, 12 Dec 2022 17:36:26 +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 1p4mj4-00089D-AC for pgsql-sql@lists.postgresql.org; Mon, 12 Dec 2022 17:36:26 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p4mj2-000130-Cm for pgsql-sql@lists.postgresql.org; Mon, 12 Dec 2022 17:36:25 +0000 Received: by mail-ot1-x32e.google.com with SMTP id m7-20020a9d6447000000b0066da0504b5eso7704985otl.13 for ; Mon, 12 Dec 2022 09:36:24 -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=nmHo62957dn77fw2JaF9k4tNmsqtfc7uUFKOJMqJl8Y=; b=E90nIBgfS5CzA8iWBkEl1BwbFhqjW6SPMnOQWSvRAngicM0Z5N0r1BA9BsbkZTuFJY Kg2jAN58v4zi9b11tQ32DFZ/Tf0HQZXRlUwOfMEJuUO/AD1AWVC7RB9k6gc9GCbfSavW FvnkAPV0IqYqXUlEeiXjxOz+U8EFQhMLVj4oB8aT0WAIQlSdJjmQbqMBPuf148RPf2M5 KuAORCgfpONr5VWdF5jxOSEvoMd+e4Q8yerkgdL6waAoUQuSU/DikyJDV9Zo3dHVx5xV LloJ6RJgsT5BEiZwLg6F5kCQfwunO9WkDnCgRbfQuLmOcU3pWToAKcV9qKaxR3dPGdAy Wuiw== 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=nmHo62957dn77fw2JaF9k4tNmsqtfc7uUFKOJMqJl8Y=; b=rNF80ItnH+yOZSwLGOoHtreiGym7lfPDHozMgRbqixsmMoCyQJwxSHbZx8Iy/Ic2aF lS0tv3vd29aDci8qlbnzKRea3CRJkQodwSVI25KtyzhlfLo7rdbYq5KN6hJIKiIq2wxX UzP3Zi5hFX0tisCCdB8CvUJvxueSV/VovrDIRMmjOle1C8wcOq2tVJ0OtL56JXJUD/Qp 30n2z1ueaKz6/uYxuDlRHku1HPuZXvORX9CFK0QtxA4wogvjSkD4V2NJ+JA10Y0pdt1W zKxh88XSkArg2iuW6KqQ88zZZX1SuT6WiOrzF4qANfJi/XeH71SW88ptMxDfEfByOTEj myPg== X-Gm-Message-State: ANoB5pl8QVosLKV3TijcxcT8wj6Jth+lYLfiVNmaQLqX8mJ5k+sZTDb8 naD0SglL1NK25pqPVgfhSmf6hSDjWEY= X-Google-Smtp-Source: AA0mqf5+rIOPaOUzJA+L6Jb5B1uqU2UnH2PPM9FCllGP+9X410ljEUNmdyNjb3WVLx5s2FTM6OokuA== X-Received: by 2002:a05:6830:1357:b0:670:8aa6:f381 with SMTP id r23-20020a056830135700b006708aa6f381mr3801650otq.15.1670866582579; Mon, 12 Dec 2022 09:36:22 -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 d18-20020a0568301b7200b0066dae8cf9a0sm169750ote.50.2022.12.12.09.36.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2022 09:36:22 -0800 (PST) From: Shane Borden Message-Id: <7BD04D8E-9307-4107-B4D0-4C281390F996@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_E5BB8EE3-91F0-4781-8264-36DBC5B8EA5F" 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:36:11 -0500 In-Reply-To: <1e0484b6-40a6-15a9-9890-0991c8b8c1da@gmail.com> Cc: pgsql-sql@lists.postgresql.org To: Rob Sargent References: <1e0484b6-40a6-15a9-9890-0991c8b8c1da@gmail.com> 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=_E5BB8EE3-91F0-4781-8264-36DBC5B8EA5F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I saw this as an option. Let=E2=80=99s say you have a million row = table. If you copy from STDIN, do you have to spool the source table to = a local file first? Looking to replace a CTAS thats doing this all = within SQL statements now. --- Thanks, Shane Borden sborden76@gmail.com > On Dec 12, 2022, at 12:25 PM, Rob Sargent = wrote: >=20 > On 12/12/22 10:13, Shane Borden wrote: >> 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. >> --- >>=20 >> Thanks, >>=20 > Today I suspect you're left with something like the following: > - CTAS from source where 1=3D2 (i.e. table definition via select = semantics) > - copy from stdin (filled with intended CTAS select) >=20 >=20 >=20 --Apple-Mail=_E5BB8EE3-91F0-4781-8264-36DBC5B8EA5F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I saw this as = an option.  Let=E2=80=99s say you have a million row table. =  If you copy from STDIN, do you have to spool the source table to a = local file first?  Looking to replace a CTAS thats doing this all = within SQL statements now.
---

Thanks,


Shane = Borden
sborden76@gmail.com

On Dec 12, 2022, at 12:25 PM, = Rob Sargent <robjsargent@gmail.com> wrote:

On 12/12/22 10:13, Shane = Borden wrote:
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,

Today I suspect = you're left with something like the following:
- CTAS from source = where 1=3D2 (i.e. table definition via select semantics)
- copy from = stdin (filled with intended CTAS = select)




= --Apple-Mail=_E5BB8EE3-91F0-4781-8264-36DBC5B8EA5F--