aio-readstream

Implement and debug PostgreSQL asynchronous I/O and read-stream subsystems.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill aio-readstream
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aio-readstream
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/aio-readstream
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill aio-readstream

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of implementing high-performance asynchronous I/O in PostgreSQL, preventing inefficient blocking reads and helping developers correctly utilize the read-stream API.

Core Features & Use Cases

  • API Migration: Provides a structured checklist for refactoring legacy scan loops into the modern read-stream API.
  • Subsystem Guidance: Offers deep technical context on the AIO layer, including io_uring, worker pools, and synchronous fallbacks.
  • Use Case: When optimizing a custom scan or VACUUM path, use this skill to determine the correct callback implementation and ensure proper buffer management across different I/O methods.

Quick Start

Use the aio-readstream skill to guide the migration of my current sequential scan loop to the read_stream API.

Frequently Asked Questions about aio-readstream

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a PostgreSQL sequential scan loop to the read-stream API?

PostgreSQL asynchronous I/O uses a layered architecture including io_uring, worker pools, and synchronous fallbacks. This AIO layer allows backend operations to perform non-blocking reads, preventing inefficient blocking behaviors during intensive database tasks.

When do I need asynchronous I/O for PostgreSQL VACUUM operations?

You need asynchronous I/O for PostgreSQL VACUUM operations when optimizing the VACUUM path to leverage non-blocking reads. This prevents inefficient blocking reads and helps maximize throughput during intensive database maintenance tasks.

How do I configure AIO GUCs for optimal PostgreSQL read-stream throughput?

PostgreSQL asynchronous I/O uses a layered architecture including io_uring, worker pools, and synchronous fallbacks. This AIO layer allows backend operations to perform non-blocking reads, preventing inefficient blocking behaviors during intensive database tasks.

What is the PostgreSQL read-stream API and how does it handle asynchronous I/O?

The PostgreSQL read-stream API is a subsystem designed to facilitate high-performance asynchronous I/O. It uses a callback interface and AIO layer, including io_uring and worker pools, to execute non-blocking reads and prevent inefficient blocking operations.

Does the PostgreSQL read-stream API support synchronous fallbacks when io_uring is unavailable?

Yes, the PostgreSQL read-stream API supports synchronous fallbacks alongside io_uring and worker pools. This ensures the asynchronous I/O subsystem remains functional and maintains correct buffer management even when native non-blocking methods are unavailable.