mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Add infrastructure for sharing temporary files between backends.
SharedFileSet allows temporary files to be created by one backend and
then exported for read-only access by other backends, with clean-up
managed by reference counting associated with a DSM segment. This
includes changes to fd.c and buffile.c to support the new kind of
temporary file.
This will be used by an upcoming patch adding support for parallel
hash joins.
Author: Thomas Munro
Reviewed-By: Peter Geoghegan, Andres Freund, Robert Haas, Rushabh Lathia
Discussion:
https://postgr.es/m/CAEepm=2W=cOkiZxcg6qiFQP-dHUe09aqTrEMM7yJDrHMhDv_RA@mail.gmail.com
https://postgr.es/m/CAH2-WznJ_UgLux=_jTgCQ4yFz0iBntudsNKa1we3kN1BAG=88w@mail.gmail.com
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#ifndef BUFFILE_H
|
||||
#define BUFFILE_H
|
||||
|
||||
#include "storage/sharedfileset.h"
|
||||
|
||||
/* BufFile is an opaque type whose details are not known outside buffile.c. */
|
||||
|
||||
typedef struct BufFile BufFile;
|
||||
@@ -42,4 +44,9 @@ extern int BufFileSeek(BufFile *file, int fileno, off_t offset, int whence);
|
||||
extern void BufFileTell(BufFile *file, int *fileno, off_t *offset);
|
||||
extern int BufFileSeekBlock(BufFile *file, long blknum);
|
||||
|
||||
extern BufFile *BufFileCreateShared(SharedFileSet *fileset, const char *name);
|
||||
extern void BufFileExportShared(BufFile *file);
|
||||
extern BufFile *BufFileOpenShared(SharedFileSet *fileset, const char *name);
|
||||
extern void BufFileDeleteShared(SharedFileSet *fileset, const char *name);
|
||||
|
||||
#endif /* BUFFILE_H */
|
||||
|
||||
Reference in New Issue
Block a user