MagicStack / MagicStack/asyncpg
Avoiding introspection queries for built-in array types
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 8.1k
- フォーク
- 468
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi, and thanks for all the work on asyncpg! 👋
I’ve noticed that fresh connections usually emit introspection queries even for statements involving simple arrays of integers.
Looking at the code in init_array_codecs, asyncpg seems to initialize only the core codecs for _oid and _text (as mentioned in the comment, “to make type introspection query work”).
I was wondering: was there a particular reason that asyncpg doesn’t include more built-in types there? From my perspective, types like _int2, _int4, _int8, _float4, _float8, _bool, and _char are very commonly used in queries. Including them might avoid a lot of introspection queries on new connections.
Is this something that could be considered, or are there trade-offs I might be missing?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
asyncpg/protocol/codecs/array.pyx から始め、特に init_array_codecs と 861-875 前後の関連する行を確認してください。_oid と _text がどのように初期化されるかを確認し、次に列挙されている組み込み配列型を評価して、それらを含めることで、issue で提起されたトレードオフなしにイントロスペクションクエリを回避できるかどうかを検討してください。明確な判断と、適切な変更または文書化された根拠があれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- postgresql, python
- 領域
- databases
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100