Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Proper way to batch queries?

オープン
#3,331 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, node.js, postgresql
領域
backend, databases

調査の方向性

ソースファイル、テスト、エントリーポイントのいずれも特定されていません。提供された Promise.all の例と、リンクされている node-postgres の issue #1388 から始め、具体的なバッチ処理の変更が意図されているかどうかを明らかにしてください。完了とするには、合意されたスコープと、報告された大規模な UPDATE ワークロードのパフォーマンスを検証する方法の指定が必要です。

索引モデルが issue の本文から書いたものです。

説明

I have a large amount of UPDATE statements to make. The most efficient way I have found, however slow, is:

await Promise.all(largeBatchOfQueries.map(async (query) => {
    const client = await pool.connect();
    await client.query(query.sql, [
        query.param1,
        query.param2,
        query.param3,
        query.param4
    ])
    await client.release();
}));

~160k UPDATEs takes ~2.5 minutes which is too slow for my situation. ~30 max connections in pool gives me the best time.

I saw there is discussion around the topic but not sure if I need a different approach or to add another library. Wondering if anyone has any insight, much appreciated.
https://github.com/brianc/node-postgres/issues/1388

主要言語
JavaScript
スター
13.2k
フォーク
1.4k
平均マージ
6日 15時間
マージ済み PR(30日)
6

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

brianc/node-postgres のほかの issue

brianc/node-postgres の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。