MagicStack / MagicStack/asyncpg
Avoiding introspection queries for built-in array types
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 8.1k
- Forks
- 469
- Ø Merge
- 18 Min.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit asyncpg/protocol/codecs/array.pyx, insbesondere mit init_array_codecs und den verknüpften Zeilen um 861-875. Untersuche, wie _oid und _text initialisiert werden, und bewerte dann die aufgeführten integrierten Array-Typen sowie, ob ihre Aufnahme Introspektionsabfragen vermeidet, ohne die im Issue angesprochenen Nachteile mit sich zu bringen. Erledigt ist die Aufgabe, wenn eine klare Entscheidung und eine angemessene Änderung oder eine dokumentierte Begründung vorliegen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- postgresql, python
- Bereich
- databases
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100