2021年3月23日星期二

Memory usage of node-influx when querying

I use node-influx and influx.query(...) use too much heap.

In my application I have something like

const data = await influx.query(`SELECT "f_power" as "power", "nature", "scope", "participantId"      FROM "power"      WHERE      "nature" =~  /^Conso$|^Prod$|^Autoconso$/ AND      "source" =~ /^$|^One$|^Two AND      "participantId" =~ /${participantIdFilter.join('|')}/ AND      "time" >= '${req.query.dateFrom}' AND      "time" <= '${req.query.dateTo}'      GROUP BY "timestamp"  `);  

Data is a result set of about 50M (I used this code) And the heap used by this method is about 350M (I used process.memoryUsage().heapUsed)

I'm surprised by the diference between these two values... So is possible to make this query less resource intensive?

https://stackoverflow.com/questions/66747910/memory-usage-of-node-influx-when-querying March 22, 2021 at 10:21PM

没有评论:

发表评论