Indexes
An index in SereneDB is an inverted index, on a table or on a view.
PRIMARY KEY, UNIQUE and FOREIGN KEY constraints are enforced by the table itself and need no index. CREATE UNIQUE INDEX adds a unique key the same way.
Index Types
| Index | Created | Purpose |
|---|---|---|
| Inverted Index | With CREATE INDEX or CREATE UNIQUE INDEX, with or without USING inverted | Equality and range lookups, full-text search, vector / ANN search and geospatial search |
The catalog lists the keys of PRIMARY KEY and UNIQUE constraints as indexes with the inverted access method.
Persistence
Indexes are persisted on disk.
CREATE INDEX and DROP INDEX
Indexes are created with CREATE INDEX and removed with DROP INDEX. CREATE INDEX creates an inverted index, with or without USING inverted; USING btree creates one too, and any other access method fails, for example with access method "gin" does not exist. See CREATE INDEX for the full statement reference and the inverted index pages for the column dictionaries, INCLUDE columns and index options.