diff options
| author | Heikki Linnakangas | 2020-09-17 08:33:40 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2020-09-17 08:33:40 +0000 |
| commit | 16fa9b2b30a357b4aea982bd878ec2e5e002dbcc (patch) | |
| tree | d1ee3378a010ad424ce41db8af503d534566cf6e /src/include/access/xloginsert.h | |
| parent | 089da3c4778fdc1931f721a265caa0c6fca38584 (diff) | |
Add support for building GiST index by sorting.
This adds a new optional support function to the GiST access method:
sortsupport. If it is defined, the GiST index is built by sorting all data
to the order defined by the sortsupport's comparator function, and packing
the tuples in that order to GiST pages. This is similar to how B-tree
index build works, and is much faster than inserting the tuples one by
one. The resulting index is smaller too, because the pages are packed more
tightly, upto 'fillfactor'. The normal build method works by splitting
pages, which tends to lead to more wasted space.
The quality of the resulting index depends on how good the opclass-defined
sort order is. A good order preserves locality of the input data.
As the first user of this facility, add 'sortsupport' function to the
point_ops opclass. It sorts the points in Z-order (aka Morton Code), by
interleaving the bits of the X and Y coordinates.
Author: Andrey Borodin
Reviewed-by: Pavel Borisov, Thomas Munro
Discussion: https://www.postgresql.org/message-id/1A36620E-CAD8-4267-9067-FB31385E7C0D%40yandex-team.ru
Diffstat (limited to 'src/include/access/xloginsert.h')
| -rw-r--r-- | src/include/access/xloginsert.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/access/xloginsert.h b/src/include/access/xloginsert.h index 63df25ae90f..4ba2c56be60 100644 --- a/src/include/access/xloginsert.h +++ b/src/include/access/xloginsert.h @@ -54,6 +54,8 @@ extern bool XLogCheckBufferNeedsBackup(Buffer buffer); extern XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum, BlockNumber blk, char *page, bool page_std); +extern void log_newpages(RelFileNode *rnode, ForkNumber forkNum, int num_pages, + BlockNumber *blknos, char **pages, bool page_std); extern XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std); extern void log_newpage_range(Relation rel, ForkNumber forkNum, BlockNumber startblk, BlockNumber endblk, bool page_std); |
