diff --git a/README.md b/README.md index 586d97b..fe7f2e7 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,29 @@ Multi-Entry Search Trees for PostgreSQL ===================================================== -This repository contains implementations for the Multi-Entry GiST and SP-GiST access methods. -These access methods are variations of the GiST and SP-GiST indices, allowing for more efficient -indexing of complex and composite data types. +This repository contains implementations for the Multi-Entry GiST (MGiST) and the +Multi-Entry SP-GiST (MSP-GiST) access methods. These access methods are variations of the +GiST and SP-GiST indices, allowing for more efficient indexing of complex and composite +data types. Contents -------- The repository contains 3 PostgreSQL extensions split into 3 separate folders: -- [mest](./): +- [MEST](./): - contains the Multi-Entry GiST access method and an implementation of a multi-entry R-tree for the PostgreSQL `multirange` and `path` types. - contains the Multi-Entry SP-GiST access method and an implementation of a multi-entry Quadtree for the PostgreSQL `multirange` and `path` types. -- [postgis-mest](contrib/postgis-mest): - - contains the implementation of a multi-entry R-tree, multi-entry Quadtree, and multi-entry Kd-tree for the PostGIS `geometry` and `geography` types. -- [mobilitydb-mest](contrib/mobilitydb): - - contains the implementation of a multi-entry R-tree, multi-entry Quadtree, and multi-entry Kd-tree for the MobilityDB `spanset` and `tgeompoint` types. +- [PostGIS MEST](contrib/postgis): + - contains the implementation of a multi-entry R-tree for the PostGIS `geometry` type. +- [MobilityDB MEST](contrib/mobilitydb): + - contains the implementation of a multi-entry R-tree, multi-entry Quadtree, and multi-entry Kd-tree for the MobilityDB `spanset`, temporal, and `tgeompoint` types. For more information about each extension, please refer to their associated README file. Dependencies ------------ -- [PostgreSQL 17](https://www.postgresql.org/) +- [PostgreSQL 17 or 18](https://www.postgresql.org/) Installation ------------ @@ -39,5 +40,7 @@ Enabling the `mest` extension CREATE EXTENSION mest CASCADE; ``` +The `mest` extension provides both the `mgist` and the `mspgist` access methods. + Contact: Maxime Schoemans diff --git a/contrib/mobilitydb/README.md b/contrib/mobilitydb/README.md index d22b93f..e80e1fb 100644 --- a/contrib/mobilitydb/README.md +++ b/contrib/mobilitydb/README.md @@ -5,15 +5,19 @@ This directory contains an implementation of Multi-Entry Search Trees for Mobili Dependencies ------------ -- [PostgreSQL 17](https://www.postgresql.org/) -- [MobilityDB 1.2](https://github.com/MobilityDB/MobilityDB) -- [MEOS 1.2](https://www.libmeos.org/) -- [mest](https://github.com/MobilityDB/mest) +- [PostgreSQL 17 or 18](https://www.postgresql.org/) +- [MobilityDB 1.4](https://github.com/MobilityDB/MobilityDB) +- [MEOS 1.4](https://www.libmeos.org/) +- [MEST](https://github.com/MobilityDB/mest) -You should also set the following in postgresql.conf depending on the version of PostGIS and MobilityDB you have installed (below we use PostGIS 3, MobilityDB 1.2): +The extension compiles against the MEOS headers that a MobilityDB installation provides, and +those headers include ``, so the json-c development files must be on the +include path as well. + +The following setting in postgresql.conf names the installed PostGIS and MobilityDB libraries, here PostGIS 3 and MobilityDB 1.4: ``` -shared_preload_libraries = 'postgis-3,libMobilityDB-1.2' +shared_preload_libraries = 'postgis-3,libMobilityDB-1.4' ``` Installation @@ -30,9 +34,9 @@ Enabling the `mobilitydb_mest` extension CREATE EXTENSION mobilitydb_mest CASCADE; ``` -Create a Multi-Entry R-Tree on the `tstzspan` column from the table `tbl_tstzspan(id int, t tstzspan)` +Create a Multi-Entry R-Tree on the `tstzspanset` column from the table `tbl_tstzspanset(id int, t tstzspanset)` ```sql -CREATE INDEX tbl_tstzspan_mrtree_idx ON trips USING MGIST(t); +CREATE INDEX tbl_tstzspanset_mrtree_idx ON tbl_tstzspanset USING MGIST(t); ``` Create a Multi-Entry Quadtree on the `tgeompoint` column `trip` from the table `trips(id int, trip tgeompoint)` @@ -40,20 +44,19 @@ Create a Multi-Entry Quadtree on the `tgeompoint` column `trip` from the table ` CREATE INDEX trips_trip_mquadtree_idx ON trips USING MSPGIST(trip); ``` -The access methods have an optional parameter that sets the maximum number of “boxes” stored in the index. This parameter is typically used to control the size of the resulting index. +The operator classes have optional parameters that set the maximum number of “boxes” stored in the index. These parameters control the size of the resulting index. -Create a Multi-Entry R-Tree on the `tstzspan` column from the table `tbl_tstzspan(id int, t tstzspan)` specifying a maximum number of spans per row. +Create a Multi-Entry R-Tree on the `tstzspanset` column from the table `tbl_tstzspanset(id int, t tstzspanset)` specifying a maximum number of spans per row. ```sql -CREATE INDEX tbl_tstzspanset_mrtree_opts_idx ON tbl_tstzspan - USING MGIST(p tstzspanset_mrtree_ops (max_ranges = 3)); +CREATE INDEX tbl_tstzspanset_mrtree_opts_idx ON tbl_tstzspanset + USING MGIST(t tstzspanset_mrtree_equisplit_ops (num_spans = 3)); ``` -Create a Multi-Entry Quad-Tree on the `tgeompoint` column from the table `tbl_tstzmultirange(id int, t tgeompoint)` specifying a maximum number of boxes per row. +Create a Multi-Entry Quadtree on the `tgeompoint` column from the table `tbl_tgeompoint(id int, temp tgeompoint)` specifying a maximum number of boxes per row. ```sql CREATE INDEX tbl_tgeompoint_mquadtree_opts_idx ON tbl_tgeompoint - USING MSPGIST(t multirange_mquadtree_ops (max_boxes = 3)); + USING MSPGIST(temp tgeompoint_mquadtree_equisplit_ops (num_boxes = 3)); ``` - Contact: Maxime Schoemans diff --git a/contrib/mobilitydb/mobilitydb_mest--1.0.sql b/contrib/mobilitydb/mobilitydb_mest--1.0.sql index b198bb5..0a06751 100755 --- a/contrib/mobilitydb/mobilitydb_mest--1.0.sql +++ b/contrib/mobilitydb/mobilitydb_mest--1.0.sql @@ -124,7 +124,7 @@ CREATE OPERATOR CLASS intspanset_mrtree_equisplit_ops FUNCTION 7 span_gist_same(intspan, intspan, internal), FUNCTION 8 span_gist_distance(internal, intspan, smallint, oid, internal), FUNCTION 10 spanset_mest_span_options(internal), - FUNCTION 12 spanset_mest_equisplit(internal, internal, internal); + FUNCTION 13 spanset_mest_equisplit(internal, internal, internal); /******************************************************************************/ @@ -175,7 +175,7 @@ CREATE OPERATOR CLASS bigintspanset_mrtree_equisplit_ops FUNCTION 7 span_gist_same(bigintspan, bigintspan, internal), FUNCTION 8 span_gist_distance(internal, bigintspan, smallint, oid, internal), FUNCTION 10 spanset_mest_span_options(internal), - FUNCTION 12 spanset_mest_equisplit(internal, internal, internal); + FUNCTION 13 spanset_mest_equisplit(internal, internal, internal); /******************************************************************************/ @@ -226,7 +226,7 @@ CREATE OPERATOR CLASS floatspanset_mrtree_equisplit_ops FUNCTION 7 span_gist_same(floatspan, floatspan, internal), FUNCTION 8 span_gist_distance(internal, floatspan, smallint, oid, internal), FUNCTION 10 spanset_mest_span_options(internal), - FUNCTION 12 spanset_mest_equisplit(internal, internal, internal); + FUNCTION 13 spanset_mest_equisplit(internal, internal, internal); /******************************************************************************/ @@ -276,7 +276,7 @@ CREATE OPERATOR CLASS datespanset_mrtree_equisplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(datespan, datespan, internal), FUNCTION 10 spanset_mest_span_options(internal), - FUNCTION 12 spanset_mest_equisplit(internal, internal, internal); + FUNCTION 13 spanset_mest_equisplit(internal, internal, internal); /******************************************************************************/ @@ -326,7 +326,7 @@ CREATE OPERATOR CLASS tstzspanset_mrtree_equisplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 10 spanset_mest_span_options(internal), - FUNCTION 12 spanset_mest_equisplit(internal, internal, internal); + FUNCTION 13 spanset_mest_equisplit(internal, internal, internal); /****************************************************************************** * Segment split @@ -384,7 +384,7 @@ CREATE OPERATOR CLASS intspanset_mrtree_segsplit_ops FUNCTION 7 span_gist_same(intspan, intspan, internal), FUNCTION 8 span_gist_distance(internal, intspan, smallint, oid, internal), FUNCTION 10 spanset_mest_seg_options(internal), - FUNCTION 12 spanset_mest_segsplit(internal, internal, internal); + FUNCTION 13 spanset_mest_segsplit(internal, internal, internal); /******************************************************************************/ @@ -435,7 +435,7 @@ CREATE OPERATOR CLASS bigintspanset_mrtree_segsplit_ops FUNCTION 7 span_gist_same(bigintspan, bigintspan, internal), FUNCTION 8 span_gist_distance(internal, bigintspan, smallint, oid, internal), FUNCTION 10 spanset_mest_seg_options(internal), - FUNCTION 12 spanset_mest_segsplit(internal, internal, internal); + FUNCTION 13 spanset_mest_segsplit(internal, internal, internal); /******************************************************************************/ @@ -486,7 +486,7 @@ CREATE OPERATOR CLASS floatspanset_mrtree_segsplit_ops FUNCTION 7 span_gist_same(floatspan, floatspan, internal), FUNCTION 8 span_gist_distance(internal, floatspan, smallint, oid, internal), FUNCTION 10 spanset_mest_seg_options(internal), - FUNCTION 12 spanset_mest_segsplit(internal, internal, internal); + FUNCTION 13 spanset_mest_segsplit(internal, internal, internal); /******************************************************************************/ @@ -536,7 +536,7 @@ CREATE OPERATOR CLASS datespanset_mrtree_segsplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(datespan, datespan, internal), FUNCTION 10 spanset_mest_seg_options(internal), - FUNCTION 12 spanset_mest_segsplit(internal, internal, internal); + FUNCTION 13 spanset_mest_segsplit(internal, internal, internal); /******************************************************************************/ @@ -586,7 +586,7 @@ CREATE OPERATOR CLASS tstzspanset_mrtree_segsplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 10 spanset_mest_seg_options(internal), - FUNCTION 12 spanset_mest_segsplit(internal, internal, internal); + FUNCTION 13 spanset_mest_segsplit(internal, internal, internal); /****************************************************************************** * Binsplit @@ -656,7 +656,7 @@ CREATE OPERATOR CLASS intspanset_mrtree_binsplit_ops FUNCTION 7 span_gist_same(intspan, intspan, internal), FUNCTION 8 span_gist_distance(internal, intspan, smallint, oid, internal), FUNCTION 10 intspanset_mest_bin_options(internal), - FUNCTION 12 intspanset_mest_binsplit(internal, internal, internal); + FUNCTION 13 intspanset_mest_binsplit(internal, internal, internal); /******************************************************************************/ @@ -707,7 +707,7 @@ CREATE OPERATOR CLASS bigintspanset_mrtree_binsplit_ops FUNCTION 7 span_gist_same(bigintspan, bigintspan, internal), FUNCTION 8 span_gist_distance(internal, bigintspan, smallint, oid, internal), FUNCTION 10 intspanset_mest_bin_options(internal), - FUNCTION 12 bigintspanset_mest_binsplit(internal, internal, internal); + FUNCTION 13 bigintspanset_mest_binsplit(internal, internal, internal); /******************************************************************************/ @@ -758,7 +758,7 @@ CREATE OPERATOR CLASS floatspanset_mrtree_binsplit_ops FUNCTION 7 span_gist_same(floatspan, floatspan, internal), FUNCTION 8 span_gist_distance(internal, floatspan, smallint, oid, internal), FUNCTION 10 floatspanset_mest_bin_options(internal), - FUNCTION 12 floatspanset_mest_binsplit(internal, internal, internal); + FUNCTION 13 floatspanset_mest_binsplit(internal, internal, internal); /******************************************************************************/ @@ -808,7 +808,7 @@ CREATE OPERATOR CLASS datespanset_mrtree_binsplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(datespan, datespan, internal), FUNCTION 10 timespanset_mest_bin_options(internal), - FUNCTION 12 timespanset_mest_binsplit(internal, internal, internal); + FUNCTION 13 timespanset_mest_binsplit(internal, internal, internal); /******************************************************************************/ @@ -858,7 +858,7 @@ CREATE OPERATOR CLASS tstzspanset_mrtree_binsplit_ops FUNCTION 6 span_gist_picksplit(internal, internal), FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 10 timespanset_mest_bin_options(internal), - FUNCTION 12 timespanset_mest_binsplit(internal, internal, internal); + FUNCTION 13 timespanset_mest_binsplit(internal, internal, internal); /****************************************************************************** * Multi-Entry Quad-tree and Kd-tree SP-GiST indexes @@ -2463,7 +2463,7 @@ CREATE OPERATOR CLASS tbool_mrtree_equisplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), -- FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_span_options(internal), - FUNCTION 12 temporal_mest_equisplit(internal, internal, internal); + FUNCTION 13 temporal_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS tbool_mquadtree_equisplit_ops DEFAULT FOR TYPE tbool USING mspgist AS @@ -2568,7 +2568,7 @@ CREATE OPERATOR CLASS ttext_mrtree_equisplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_span_options(internal), - FUNCTION 12 temporal_mest_equisplit(internal, internal, internal); + FUNCTION 13 temporal_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS ttext_mquadtree_equisplit_ops DEFAULT FOR TYPE ttext USING mspgist AS @@ -2680,7 +2680,7 @@ CREATE OPERATOR CLASS tbool_mrtree_segsplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_seg_options(internal), - FUNCTION 12 temporal_mest_segsplit(internal, internal, internal); + FUNCTION 13 temporal_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS tbool_mquadtree_segsplit_ops FOR TYPE tbool USING mspgist AS @@ -2785,7 +2785,7 @@ CREATE OPERATOR CLASS ttext_mrtree_segsplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_seg_options(internal), - FUNCTION 12 temporal_mest_segsplit(internal, internal, internal); + FUNCTION 13 temporal_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS ttext_mquadtree_segsplit_ops FOR TYPE ttext USING mspgist AS @@ -2897,7 +2897,7 @@ CREATE OPERATOR CLASS tbool_mrtree_binsplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_bin_options(internal), - FUNCTION 12 temporal_mest_binsplit(internal, internal, internal); + FUNCTION 13 temporal_mest_binsplit(internal, internal, internal); CREATE OPERATOR CLASS tbool_mquadtree_binsplit_ops FOR TYPE tbool USING mspgist AS @@ -3002,7 +3002,7 @@ CREATE OPERATOR CLASS ttext_mrtree_binsplit_ops FUNCTION 7 span_gist_same(tstzspan, tstzspan, internal), FUNCTION 8 span_gist_distance(internal, tstzspan, smallint, oid, internal), FUNCTION 10 temporal_mest_bin_options(internal), - FUNCTION 12 temporal_mest_binsplit(internal, internal, internal); + FUNCTION 13 temporal_mest_binsplit(internal, internal, internal); CREATE OPERATOR CLASS ttext_mquadtree_binsplit_ops FOR TYPE ttext USING mspgist AS @@ -3164,7 +3164,7 @@ CREATE OPERATOR CLASS tint_mrtree_equisplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tnumber_mest_box_options(internal), - FUNCTION 12 tnumber_mest_equisplit(internal, internal, internal); + FUNCTION 13 tnumber_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS tint_mquadtree_equisplit_ops DEFAULT FOR TYPE tint USING mspgist AS @@ -3299,7 +3299,7 @@ CREATE OPERATOR CLASS tfloat_mrtree_equisplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tnumber_mest_box_options(internal), - FUNCTION 12 tnumber_mest_equisplit(internal, internal, internal); + FUNCTION 13 tnumber_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS tfloat_mquadtree_equisplit_ops DEFAULT FOR TYPE tfloat USING mspgist AS @@ -3441,7 +3441,7 @@ CREATE OPERATOR CLASS tint_mrtree_segsplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tnumber_mest_seg_options(internal), - FUNCTION 12 tnumber_mest_segsplit(internal, internal, internal); + FUNCTION 13 tnumber_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS tint_mquadtree_segsplit_ops FOR TYPE tint USING mspgist AS @@ -3576,7 +3576,7 @@ CREATE OPERATOR CLASS tfloat_mrtree_segsplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tnumber_mest_seg_options(internal), - FUNCTION 12 tnumber_mest_segsplit(internal, internal, internal); + FUNCTION 13 tnumber_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS tfloat_mquadtree_segsplit_ops FOR TYPE tfloat USING mspgist AS @@ -3725,7 +3725,7 @@ CREATE OPERATOR CLASS tint_mrtree_tilesplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tint_mest_tile_options(internal), - FUNCTION 12 tint_mest_tilesplit(internal, internal, internal); + FUNCTION 13 tint_mest_tilesplit(internal, internal, internal); CREATE OPERATOR CLASS tint_mquadtree_tilesplit_ops FOR TYPE tint USING mspgist AS @@ -3862,7 +3862,7 @@ CREATE OPERATOR CLASS tfloat_mrtree_tilesplit_ops FUNCTION 7 tbox_gist_same(tbox, tbox, internal), FUNCTION 8 tbox_gist_distance(internal, tbox, smallint, oid, internal), FUNCTION 10 tfloat_mest_tile_options(internal), - FUNCTION 12 tfloat_mest_tilesplit(internal, internal, internal); + FUNCTION 13 tfloat_mest_tilesplit(internal, internal, internal); CREATE OPERATOR CLASS tfloat_mquadtree_tilesplit_ops FOR TYPE tfloat USING mspgist AS @@ -4035,7 +4035,7 @@ CREATE OPERATOR CLASS tgeompoint_mrtree_equisplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_box_options(internal), - FUNCTION 12 tpoint_mest_equisplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_equisplit_ops DEFAULT FOR TYPE tgeompoint USING mspgist AS @@ -4174,7 +4174,7 @@ CREATE OPERATOR CLASS tgeogpoint_mrtree_equisplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_box_options(internal), - FUNCTION 12 tpoint_mest_equisplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_equisplit(internal, internal, internal); CREATE OPERATOR CLASS tgeogpoint_mquadtree_equisplit_ops DEFAULT FOR TYPE tgeogpoint USING mspgist AS @@ -4332,7 +4332,7 @@ CREATE OPERATOR CLASS tgeompoint_mrtree_segsplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_seg_options(internal), - FUNCTION 12 tpoint_mest_segsplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_segsplit_ops FOR TYPE tgeompoint USING mspgist AS @@ -4478,7 +4478,7 @@ CREATE OPERATOR CLASS tgeogpoint_mrtree_segsplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_seg_options(internal), - FUNCTION 12 tpoint_mest_segsplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_segsplit(internal, internal, internal); CREATE OPERATOR CLASS tgeogpoint_mquadtree_segsplit_ops FOR TYPE tgeogpoint USING mspgist AS @@ -4638,7 +4638,7 @@ CREATE OPERATOR CLASS tgeompoint_mrtree_tilesplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_tile_options(internal), - FUNCTION 12 tpoint_mest_tilesplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_tilesplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_tilesplit_ops FOR TYPE tgeompoint USING mspgist AS @@ -4783,7 +4783,7 @@ CREATE OPERATOR CLASS tgeogpoint_mrtree_tilesplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_tile_options(internal), - FUNCTION 12 tpoint_mest_tilesplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_tilesplit(internal, internal, internal); CREATE OPERATOR CLASS tgeogpoint_mquadtree_tilesplit_ops FOR TYPE tgeogpoint USING mspgist AS @@ -4964,7 +4964,7 @@ CREATE OPERATOR CLASS tgeompoint_mgist_mergesplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_box_options(internal), - FUNCTION 12 tpoint_mest_mergesplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_mergesplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_mergesplit_ops FOR TYPE tgeompoint USING mspgist AS @@ -5117,7 +5117,7 @@ CREATE OPERATOR CLASS tgeompoint_mrtree_linearsplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_query_options(internal), - FUNCTION 12 tpoint_mest_linearsplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_linearsplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_linearsplit_ops FOR TYPE tgeompoint USING mspgist AS @@ -5270,7 +5270,7 @@ CREATE OPERATOR CLASS tgeompoint_mrtree_adaptsplit_ops FUNCTION 7 stbox_gist_same(stbox, stbox, internal), FUNCTION 8 stbox_gist_distance(internal, stbox, smallint, oid, internal), FUNCTION 10 tpoint_mest_box_options(internal), - FUNCTION 12 tpoint_mest_adaptsplit(internal, internal, internal); + FUNCTION 13 tpoint_mest_adaptsplit(internal, internal, internal); CREATE OPERATOR CLASS tgeompoint_mquadtree_adaptsplit_ops FOR TYPE tgeompoint USING mspgist AS diff --git a/contrib/postgis/README.md b/contrib/postgis/README.md index 7372d45..4926271 100644 --- a/contrib/postgis/README.md +++ b/contrib/postgis/README.md @@ -10,11 +10,11 @@ However, the PostGIS support functions are not yet implemented for MGiST indexes Dependencies ------------ -- [PostgreSQL 17](https://www.postgresql.org/) -- [PostGIS 3.4](https://postgis.net/) -- [mgist](../mgist) +- [PostgreSQL 17 or 18](https://www.postgresql.org/) +- [PostGIS 3](https://postgis.net/) +- [MEST](https://github.com/MobilityDB/mest) -You should also set the following in postgresql.conf depending on the version of PostGIS you have installed (below we use PostGIS 3): +The following setting in postgresql.conf names the installed PostGIS library, here PostGIS 3: ``` shared_preload_libraries = 'postgis-3' @@ -31,10 +31,10 @@ make sudo make install ``` -Using the extension to create a Multi-Entry R-Tree on the geometry column `trip` from the table `trips(id, trip)` +Using the extension to create a Multi-Entry R-Tree on the geometry column `geom` from the table `regions(id int, geom geometry)` ```sql -CREATE EXTENSION mgist_mobilitydb CASCADE; -CREATE INDEX trips_mgist_trip on trips using mgist(trip); +CREATE EXTENSION postgis_mest CASCADE; +CREATE INDEX regions_mgist_geom ON regions USING MGIST(geom); ``` Contact: diff --git a/contrib/postgis/postgis_mest--1.0.sql b/contrib/postgis/postgis_mest--1.0.sql index e8ad73e..ac1e534 100755 --- a/contrib/postgis/postgis_mest--1.0.sql +++ b/contrib/postgis/postgis_mest--1.0.sql @@ -26,6 +26,6 @@ CREATE OPERATOR CLASS geometry_mgist_ops_2d FUNCTION 5 geometry_gist_penalty_2d (internal, internal, internal), FUNCTION 6 geometry_gist_picksplit_2d (internal, internal), FUNCTION 7 geometry_gist_same_2d (geom1 geometry, geom2 geometry, internal), - FUNCTION 12 geometry_mest_extract(internal, internal, internal); + FUNCTION 13 geometry_mest_extract(internal, internal, internal); /******************************************************************************/ diff --git a/src/README.md b/src/README.md index aed7967..ad52a2d 100644 --- a/src/README.md +++ b/src/README.md @@ -23,7 +23,7 @@ Create a Multi-Entry Quad-Tree on the `tstzmultirange` column from the table `tb CREATE INDEX tbl_tstzmultirange_mquadtree_idx on tbl_tstzmultirange USING mspgist(t); ``` -The access methods have an optional parameter that sets the maximum number of “boxes” stored in the index. This parameter is typically used to control the size of the resulting index. +The access methods have an optional parameter that sets the maximum number of “boxes” stored in the index. This parameter controls the size of the resulting index. Create a Multi-Entry R-Tree on the `path` column from the table `tbl_path(id int, p path)` specifying a maximum number of boxes per row. ```sql diff --git a/src/mgist/README.md b/src/mgist/README.md index 4f3059e..71c51c5 100644 --- a/src/mgist/README.md +++ b/src/mgist/README.md @@ -5,34 +5,31 @@ This directory contains an implementation of the Multi-Entry GiST access method It is a variation of the GiST index that allows for more efficient indexing of complex and composite data types. -The extension on its own only adds a Multi-Entry R-Tree for the PostgreSQL *path* type.\ +The access method is shipped by the `mest` extension, which also provides a Multi-Entry +R-Tree for the PostgreSQL `path` and `multirange` types.\ For more advanced uses of the Multi-Entry GiST index, see the example use-cases below. Dependencies ------------ -- [PostgreSQL 15](https://www.postgresql.org/) +- [PostgreSQL 17 or 18](https://www.postgresql.org/) Installation ------------ -Compiling and installing the extension -``` -make -sudo make install -``` +Please refer to the top directory for instructions to compile and install the `mest` extension. -Using the extension to create a Multi-Entry R-Tree on the path column from the table `paths(id int, p path)` +Using the extension to create a Multi-Entry R-Tree on the `p` column from the table `paths(id int, p path)` ```sql -CREATE EXTENSION mgist CASCADE; -CREATE INDEX paths_mgist_path on paths using mgist(path); +CREATE EXTENSION mest CASCADE; +CREATE INDEX paths_mgist_path ON paths USING MGIST(p); ``` Example use-cases ----------------- -Below are some extension using the Multi-Entry SP-GiST index to index complex data types. +Below are the extensions using the Multi-Entry GiST index to index complex data types. - * PostGIS GeometryCollections and LineString: TODO - * MobilityDB Trajectories: [mgist-mobilitydb](../mgist-mobilitydb) + * PostGIS geometries: [PostGIS MEST](../../contrib/postgis) + * MobilityDB trajectories: [MobilityDB MEST](../../contrib/mobilitydb) Contact: diff --git a/src/mgist/mgistutil.c b/src/mgist/mgistutil.c index 5f63885..2419759 100644 --- a/src/mgist/mgistutil.c +++ b/src/mgist/mgistutil.c @@ -1092,7 +1092,7 @@ gist_stratnum_common(PG_FUNCTION_ARGS) /* * Returns the opclass's private stratnum used for the given compare type. * - * Calls the opclass's GIST_STRATNUM_PROC support function, if any, + * Calls the opclass's GIST_TRANSLATE_CMPTYPE_PROC support function, if any, * and returns the result. * Returns InvalidStrategy if the function is not defined. */ @@ -1103,7 +1103,7 @@ gisttranslatecmptype(CompareType cmptype, Oid opfamily) Datum result; /* Check whether the function is provided. */ - funcid = get_opfamily_proc(opfamily, ANYOID, ANYOID, GIST_STRATNUM_PROC); + funcid = get_opfamily_proc(opfamily, ANYOID, ANYOID, GIST_TRANSLATE_CMPTYPE_PROC); if (!OidIsValid(funcid)) return InvalidStrategy; diff --git a/src/mgist/mgistvalidate.c b/src/mgist/mgistvalidate.c index 88824e4..8953ac9 100644 --- a/src/mgist/mgistvalidate.c +++ b/src/mgist/mgistvalidate.c @@ -139,7 +139,7 @@ mgistvalidate(Oid opclassoid) ok = check_amproc_signature(procform->amproc, VOIDOID, true, 1, 1, INTERNALOID); break; - case GIST_STRATNUM_PROC: + case GIST_TRANSLATE_CMPTYPE_PROC: ok = check_amproc_signature(procform->amproc, INT2OID, true, 1, 1, INT4OID) && procform->amproclefttype == ANYOID && @@ -271,7 +271,7 @@ mgistvalidate(Oid opclassoid) if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC || i == GIST_COMPRESS_PROC || i == GIST_DECOMPRESS_PROC || i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC || - i == GIST_STRATNUM_PROC) + i == GIST_TRANSLATE_CMPTYPE_PROC) continue; /* optional methods */ ereport(INFO, (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), @@ -343,7 +343,7 @@ mgistadjustmembers(Oid opfamilyoid, case GIST_FETCH_PROC: case GIST_OPTIONS_PROC: case GIST_SORTSUPPORT_PROC: - case GIST_STRATNUM_PROC: + case GIST_TRANSLATE_CMPTYPE_PROC: /* Optional, so force it to be a soft family dependency */ op->ref_is_hard = false; op->ref_is_family = true; diff --git a/src/mspgist/README.md b/src/mspgist/README.md index a325281..d866cb4 100644 --- a/src/mspgist/README.md +++ b/src/mspgist/README.md @@ -5,34 +5,29 @@ This directory contains an implementation of the Multi-Entry SP-GiST access meth It is a variation of the SP-GiST index that allows for more efficient indexing of complex and composite data types. -The extension on its own only adds the access method handler, but no index implementations.\ -For uses of the Multi-Entry SP-GiST index, see the example use-cases below. +The access method is shipped by the `mest` extension, which also provides a Multi-Entry +Quadtree for the PostgreSQL `path` and `multirange` types.\ +For more uses of the Multi-Entry SP-GiST index, see the example use-cases below. Dependencies ------------ -- [PostgreSQL 15](https://www.postgresql.org/) +- [PostgreSQL 17 or 18](https://www.postgresql.org/) Installation ------------ -Compiling and installing the extension -``` -make -sudo make install -``` +Please refer to the top directory for instructions to compile and install the `mest` extension. Creating the extension in a PostgreSQL database ```sql -CREATE EXTENSION mspgist; +CREATE EXTENSION mest; ``` Example use-cases ----------------- -Below are some extension using the Multi-Entry SP-GiST index to index complex data types. +Below are the extensions using the Multi-Entry SP-GiST index to index complex data types. - * PostGIS GeometryCollections and LineString: TODO - * MobilityDB Trajectories: [mspgist-mobilitydb](../mspgist-mobilitydb) - * JSON Data: TODO + * MobilityDB trajectories: [MobilityDB MEST](../../contrib/mobilitydb) Contact: