[英]I am getting connection reset error when trying execute two queries at the same time in arangodb?
[英]Execute two queries at the same time on psql with node postgres
例如,我有兩個獨立的查詢:
const query = "SELECT PG_SLEEP(30);"
const query1 = "SELECT PG_SLEEP(30);"
console.time("Query")
await Promise.all([pgClient.query(query), pgClient.query(query1)]);
console.timeEnd("Query")
根據文檔,這將被添加到隊列中並一個接一個地執行,是否可以異步執行兩個查詢? 所以注冊時間應該是30左右而不是60...
為此,您必須打開兩個數據庫連接。 那么同時運行兩個查詢就沒有問題了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.