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 1q4Tsa-00010Z-4Q for pgsql-general@arkaria.postgresql.org; Wed, 31 May 2023 22:01:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q4TsY-0003eV-Ma for pgsql-general@arkaria.postgresql.org; Wed, 31 May 2023 22:01:14 +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 1q4TsY-0003eM-Bf for pgsql-general@lists.postgresql.org; Wed, 31 May 2023 22:01:14 +0000 Received: from evolvis.org ([2a02:a00:2000:f::1]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q4TsT-003Mdr-5k for pgsql-general@lists.postgresql.org; Wed, 31 May 2023 22:01:13 +0000 Received: from x61w.mirbsd.org (xdsl-84-44-128-118.nc.de [84.44.128.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by evolvis.org (Postfix) with ESMTPSA id 8288C10069B; Wed, 31 May 2023 22:01:08 +0000 (UTC) Received: by x61w.mirbsd.org (Postfix, from userid 1000) id ED00963B9A; Thu, 1 Jun 2023 00:01:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by x61w.mirbsd.org (Postfix) with ESMTP id E7A4F60B96; Thu, 1 Jun 2023 00:01:07 +0200 (CEST) Date: Thu, 1 Jun 2023 00:01:07 +0200 (CEST) From: Thorsten Glaser To: Adrian Klaver cc: Lian Jiang , pgsql-general@lists.postgresql.org Subject: Re: speed up full table scan using psql In-Reply-To: Message-ID: <4299d8b-f374-c0cc-b9ad-66bdc0554a67@evolvis.org> References: Content-Language: de-DE-1901 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 31 May 2023, Adrian Klaver wrote: > Given that I would just COPY the data out as CSV. I recently did something similar. I found the JSON functions not quite satisfying and the extra spaces redundant, but it turns out that, for a numerical table, exporting as CSV, loading that via AJAX then (on xhr.responseText) substituting newlines with '],[' and prepending '[[' and appending ']]' was enough to let JSON.parse eat it. With strings this is more complex ofc (though partial use of JSON functions, e.g. to convert strings to JSONString already, might help). bye, //mirabilos --=20 Infrastrukturexperte =E2=80=A2 tarent solutions GmbH Am Dickobskreuz 10, D-53121 Bonn =E2=80=A2 http://www.tarent.de/ Telephon +49 228 54881-393 =E2=80=A2 Fax: +49 228 54881-235 HRB AG Bonn 5168 =E2=80=A2 USt-ID (VAT): DE122264941 Gesch=C3=A4ftsf=C3=BChrer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Ale= xander Steeg ***************************************************= * /=E2=81=80\ The UTF-8 Ribbon =E2=95=B2=C2=A0=E2=95=B1 Campaign against Mit dem tarent-Newsletter ni= chts mehr verpassen: =C2=A0=E2=95=B3=C2=A0 HTML eMail! Also, https://www.tarent.de/newslette= r =E2=95=B1=C2=A0=E2=95=B2 header encryption! ***************************************************= *