I'm looking into the documentation of surrealdb, considering whether I should use it rather than postgresql for my next project.
However, the documentation on building indexes seems to be quite sparse.
If I understand correctly, for a toy example I can find all objects for which "foo" is in a list with this command
SELECT * FROM objects WHERE "foo" INSIDE list_field
However, this will obviously not be indexed by default. How can I add an index, that makes this kind of where clause fast, similar to postgresql's GIN indices?
Indexes can be made via fairly standard syntax, as documented here
Ex:
As for index on a list, like postgres GIN, I have not tried myself, but it reads as if it may just work by default. I found this on the feature page:
"... Table indexes can be specified for a column, multiple columns, and have support for all nested fields including arrays and objects."