Re: Benchmark of using JSON to transport query results in node.js

2019-01-11 Thread Michel Pelletier
On Fri, Jan 11, 2019 at 10:31 AM Mitar wrote: > Hi! > > > Another option is to query directly from node.js and get JSON or native > query from the database (extensive use of functions / stored procedures). > > For web applications, I was even thinking about this crazy approach: > get PostgreSQL t

Re: Benchmark of using JSON to transport query results in node.js

2019-01-11 Thread Mitar
Hi! On Fri, Jan 11, 2019 at 3:06 AM Tony Shelver wrote: > I'm fairly new to Postgres, but one question is how node.js implements the > native driver when fetching the data: fetchall, fetchmany or fetch.single? > Also which native driver is it using? The package I used is here [1]. It is using

Re: Benchmark of using JSON to transport query results in node.js

2019-01-11 Thread Tony Shelver
I'm fairly new to Postgres, but one question is how node.js implements the native driver when fetching the data: fetchall, fetchmany or fetch.single? Also which native driver is it using? Does the native driver do a round trip for each record fetched, or can it batch them into multiples? For examp

Benchmark of using JSON to transport query results in node.js

2019-01-10 Thread Mitar
Hi! I made some benchmarks of using JSON to transport results to node.js and it seems it really makes a difference over using native or standard PostgreSQL. So the idea is that you simply wrap all results into JSON like SELECT to_json(t) FROM (... original query ...) AS t. I am guessing because no