Skip to content

Commit

Permalink
Add SP-GiST to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zachasme committed Jan 3, 2025
1 parent 85047a5 commit cec1d79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ Returns true if A contains B.
Returns true if A is contained by B.


## SP-GiST operator class (experimental)
*This is still an experimental feature and may change in future versions.*
Add an SP-GiST index using the `h3index_ops_experimental` operator class:
```sql
-- CREATE INDEX [indexname] ON [tablename] USING spgist([column] h3index_ops_experimental);
CREATE INDEX spgist_idx ON h3_data USING spgist(hex h3index_ops_experimental);
```

# Type casts

### `h3index` :: `bigint`
Expand Down
13 changes: 9 additions & 4 deletions h3/sql/install/14-opclass_spgist.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
* limitations under the License.
*/

-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
-- SP-GiST Operator Class (opclass_spgist.c)
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
--| ## SP-GiST operator class (experimental)
--|
--| *This is still an experimental feature and may change in future versions.*
--| Add an SP-GiST index using the `h3index_ops_experimental` operator class:
--|
--| ```sql
--| -- CREATE INDEX [indexname] ON [tablename] USING spgist([column] h3index_ops_experimental);
--| CREATE INDEX spgist_idx ON h3_data USING spgist(hex h3index_ops_experimental);
--| ```

-- SP-GiST operator class
--@ internal
CREATE OR REPLACE FUNCTION h3index_spgist_config(internal, internal) RETURNS void
AS 'h3' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
Expand Down

0 comments on commit cec1d79

Please sign in to comment.