Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
------------
Expand All @@ -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 <maxime.schoemans@ulb.be>
33 changes: 18 additions & 15 deletions contrib/mobilitydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<json-c/json.h>`, 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
Expand All @@ -30,30 +34,29 @@ 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)`
```sql
CREATE INDEX trips_trip_mquadtree_idx ON trips USING MSPGIST(trip);
```

The access methods have an optional parameter that sets the maximum number of &ldquo;boxes&rdquo; 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 &ldquo;boxes&rdquo; 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 <maxime.schoemans@ulb.be>
Loading
Loading