From: | Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com> |
---|---|
To: | Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> |
Cc: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, 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-14 05:17:56 |
Message-ID: | CAJrrPGcYWE1g_jhTyOLDX+A-UUf8CADGwWBO8FGKqfQgRq9BCg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Sep 12, 2017 at 3:52 PM, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
wrote:
>
> * int rs_ntuples; /* number of visible tuples on page */*
> * OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]; /* their offsets */*
>
> *tsm_system_rows.c, nodeBitmapHeapscan.c, nodesamplescan.c*
> *Used for retrieve the offsets mainly Bitmap and sample scans.*
>
> I think rest of the above parameters usage other than heap can be changed
> once the Bitmap and Sample scans are modified to use the storage routines
> while returning the tuple instead of their own implementations. I feel
> these
> scans are the major users of the rest of the parameters. This approach may
> need to some more API's to get rid of Bitmap and sample scan's own
> implementation.
>
Instead of modifying the Bitmap Heap and Sample scan's to avoid referring
the internal members of the HeapScanDesc, I divided the HeapScanDesc
into two parts.
1. StorageScanDesc
2. HeapPageScanDesc
The StorageScanDesc contains the minimal information that is required
outside
the Storage routine and this must be provided by all storage routines. This
structure contains minimal information such as relation, snapshot, buffer
and
etc.
The HeapPageScanDesc contains other extra information that is required for
Bitmap Heap and Sample scans to work. This structure contains the
information
of blocks, visible offsets and etc. Currently this structure is used only
in
Bitmap Heap and Sample scan and it's supported contrib modules, except
the pgstattuple module. The pgstattuple needs some additional changes.
By adding additional storage API to return HeapPageScanDesc as it required
by the Bitmap Heap and Sample scan's and this API is called only in these
two scan's. And also these scan methods are choosen by the planner only
when the storage routine supports to returning of HeapPageScanDesc API.
Currently Implemented the planner support only for Bitmap, yet to do it
for Sample scan.
With the above approach, I removed all the references of HeapScanDesc
outside the heap. The changes of this approach is available in the
0008-Remove-HeapScanDesc-usage-outside-heap.patch
Suggestions/comments with the above approach.
Because of a recent commit in the master, there was an OID conflict with
the other patches. Rebased patches are attached.
Regards,
Hari Babu
Fujitsu Australia
Attachment | Content-Type | Size |
---|---|---|
0008-Remove-HeapScanDesc-usage-outside-heap.patch | application/octet-stream | 90.5 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.3 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 | 145.7 KB |
0005-slot-hooks-are-added-to-storage-AM.patch | application/octet-stream | 60.2 KB |
0006-Tuple-Insert-API-is-added-to-Storage-AM.patch | application/octet-stream | 246.1 KB |
0007-Scan-functions-are-added-to-storage-AM.patch | application/octet-stream | 178.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Ashutosh Bapat | 2017-09-14 05:20:28 | Re: <> join selectivity estimate question |
Previous Message | Fabien COELHO | 2017-09-14 05:15:40 | Re: psql: new help related to variables are not too readable |