Re: Pluggable storage

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pluggable storage
Date: 2017-09-01 01:51:50
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Sat, Aug 26, 2017 at 1:34 PM, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>

> I will submit the new patch series with all comments given
> in the upthread to the upcoming commitfest.

Here I attached new set of patches that are rebased to the latest master.


Add the support of storage method to create as part of create
access method syntax.


The necessary storage AM API hooks that are required
to support pluggable storage API and supporting functions
to frame the storage routine.


Add the storageAm routine pointer to relation structure
and necessary functions to initialize the storage AM routine
whenever the relation is built.


The tuple visibility functions are moved into heap storage AM
and the visibility function in snapshot structure is changed from
function pointer to an enum to indicate what type of snapshot
it is. Based on that enum, the corresponding visibility function
is executed from the relation storage AM routine.


The slot specific storage AM routine pointer is added to slot
structure and removed some of the members and created
a new HeapamSlot structure to hold the necessary tuple
information. Currently the slot supports the minimal tuple

Currently this patch may further needs some changes as it
assumes the tuple is in HeapTuple format in some API's.
This slot storage AM routine may be common to all the
pluggable storage modules.


The write support functionality is added to storage AM.
And also all the storage AM functions are extracted into
another file to make it easier to understand while writing
and changing the code to support new API's.


All the scan supported functions are added to storage AM.
And these functions are also extracted into storageam.c file.

Pending comments from Andres:
1. Remove the usage of HeapScanDesc.
2. Remove the usage of scan_getpage, scan_update_snapshot
and scan_rescan_set_params hooks.
3. Many places the relation is not available while creating the slot,
and also slot shouldn't depend on relation, because the slot values
are may be some times from two different storage relations also.
So I modified the slot code to use the same storage mechanism.
4.Tuples functionality moving into a separate folder.

Other pending activities are:
1. Handle Bitmap and sample scans as they dependent on heap format.
2. Add some configuration flags in the storage AM, based on these flags
whether vacuum can run on these relations or not will be decided. This
may be further enhanced to provide the cost parameters also that can be
used for planning.

I attached individual patches in the mail, in case if it increases the mail
or creates problems to some one, i will attach the zip version from next

Hari Babu
Fujitsu Australia

Attachment Content-Type Size
0007-Scan-functions-are-added-to-storage-AM.patch application/octet-stream 177.8 KB
0001-Change-Create-Access-method-to-include-storage-handl.patch application/octet-stream 9.6 KB
0002-Storage-AM-API-hooks-and-related-functions.patch application/octet-stream 18.4 KB
0003-Adding-storageam-hanlder-to-relation-structure.patch application/octet-stream 7.0 KB
0004-Adding-tuple-visibility-function-to-storage-AM.patch application/octet-stream 144.5 KB
0005-slot-hooks-are-added-to-storage-AM.patch application/octet-stream 60.6 KB
0006-Tuple-Insert-API-is-added-to-Storage-AM.patch application/octet-stream 245.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2017-09-01 02:14:03 Re: Re: [PATCH] Fix drop replication slot blocking instead of returning error
Previous Message Michael Paquier 2017-09-01 01:30:20 Re: Update low-level backup documentation to match actual behavior