Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5a9b18

Browse files
committed
Provide API for streaming relation data.
Introduce an abstraction allowing relation data to be accessed as astream of buffers, with an implementation that is more efficient thanthe equivalent sequence of ReadBuffer() calls.Client code supplies a callback that can say which block number it wantsnext, and then consumes individual buffers one at a time from thestream. This division puts read_stream.c in control of how far ahead itcan see and allows it to read clusters of neighboring blocks withStartReadBuffers(). It also issues POSIX_FADV_WILLNEED advice ahead oftime when random access is detected.Other variants of I/O stream will be proposed in future work (forexample to support recovery, whose LsnReadQueue device inxlogprefetcher.c is a distant cousin of this code and should eventuallybe replaced by this), but this basic API is sufficient for many commonexecutor usage patterns involving predictable access to a single fork ofa single relation.Several patches using this API are proposed separately.This stream concept is loosely based on ideas from Andres Freund on howwe should pave the way for later work on asynchronous I/O.Author: Thomas Munro <thomas.munro@gmail.com>Author: Heikki Linnakangas <hlinnaka@iki.fi> (contributions)Author: Melanie Plageman <melanieplageman@gmail.com> (contributions)Suggested-by: Andres Freund <andres@anarazel.de>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>Reviewed-by: Andres Freund <andres@anarazel.de>Tested-by: Tomas Vondra <tomas.vondra@enterprisedb.com>Discussion:https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com
1 parent210622c commitb5a9b18

File tree

7 files changed

+898
-1
lines changed

7 files changed

+898
-1
lines changed

‎src/backend/storage/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ subdir = src/backend/storage
88
top_builddir = ../../..
99
include$(top_builddir)/src/Makefile.global
1010

11-
SUBDIRS = buffer file freespace ipc large_object lmgr page smgr sync
11+
SUBDIRS =aiobuffer file freespace ipc large_object lmgr page smgr sync
1212

1313
include$(top_srcdir)/src/backend/common.mk

‎src/backend/storage/aio/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Makefile for storage/aio
3+
#
4+
# src/backend/storage/aio/Makefile
5+
#
6+
7+
subdir = src/backend/storage/aio
8+
top_builddir = ../../../..
9+
include$(top_builddir)/src/Makefile.global
10+
11+
OBJS =\
12+
read_stream.o
13+
14+
include$(top_srcdir)/src/backend/common.mk

‎src/backend/storage/aio/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024, PostgreSQL Global Development Group
2+
3+
backend_sources+=files(
4+
'read_stream.c',
5+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp