Hello.

My database is used purely for storage and it is rarely necessary to get it out, everything you need is in RAM. Therefore, I upload data every 15 minutes. But a lot of momoko.execute(query) ruthlessly attack the Postgre server. Then I saw the seemingly solution: momoko.transaction([queries]) , but judging by the fact that the method returns a list of cursors for each result of the query, this method also does a lot of momoko.execute . Yes, and in the source code, it also looks like that execute in a loop, although asynchronous code is very difficult to read for me.

So the question is why it is impossible to make all requests for a single execute through a semicolon? In general, there is such a possibility, but this is not being written about anywhere, as if it were wildness and it is impossible to do so. And also if you transmit one large request, then the stream hangs, if through a transaction , then gen.corountine works as expected.

  • I do not see a fundamental difference - so that that way the server will be attacked by a variety of requests, not? On network delays save perhaps - andreymal
  • Do you think there is no difference in practice? So it’s interesting to me to know whether it is worth making a thousand requests through a ";" or leave it like it is - iproger
  • And you check and write about this article on some popular site. Or even a magazine. - Sergey
  • Exactly, thanks! I just need an article for magistracy!) And how can I analyze the performance of postgresql itself? - iproger

0