Re: speed up full table scan using psql

From: Thorsten Glaser <tg(at)evolvis(dot)org>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Lian Jiang <jiangok2006(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: speed up full table scan using psql
Date: 2023-05-31 22:01:07
Message-ID: 4299d8b-f374-c0cc-b9ad-66bdc0554a67@evolvis.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
--
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also, https://www.tarent.de/newsletter
╱ ╲ header encryption!
****************************************************

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yu Shi (Fujitsu) 2023-06-01 02:12:27 RE: Support logical replication of DDLs
Previous Message Adrian Klaver 2023-05-31 21:50:10 Re: speed up full table scan using psql