Avoiding introspection queries for built-in array types
还没有人认领这个 Issue。
评估
调研方向
从 asyncpg/protocol/codecs/array.pyx 开始,重点查看 init_array_codecs 以及 861-875 附近的相关代码行。检查 _oid 和 _text 的初始化方式,然后评估列出的内置数组类型,以及包含这些类型是否能避免 introspection 查询,同时不会带来 issue 中提出的权衡。完成的标准是作出明确的决定,并进行适当的更改或记录相应的理由。
由索引模型根据 Issue 内容生成。
描述
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?
- 主要语言
- Python
- 星标
- 8.1k
- 派生
- 469
- 平均合并
- 4 小时 42 分钟
- 30 天内合并 PR
- 6
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MagicStack/asyncpg 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
MagicStack/asyncpg#1357 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
MagicStack/asyncpg#997 ·
-
Connection.close(timeout=) waits forever on a pending cancel when the server never acknowledges it 未关闭
难度 4/5 3-5 天 新手友好度 68/100
MagicStack/asyncpg#1356 ·
-
难度 4/5 3-5 天 新手友好度 48/100
MagicStack/asyncpg#1354 ·
-
难度 3/5 1-2 天 新手友好度 72/100
MagicStack/asyncpg#1342 ·
查看 MagicStack/asyncpg 的全部 Issue
相似的 Issue
-
triage/confirmed
难度 2/5 1-3 小时 新手友好度 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
难度 1/5 1 小时以内 新手友好度 92/100
NousResearch/hermes-agent#118866 ·
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
apache/cloudstack#14222 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100