Skip to content

Test an index on the last item of an ElementPath

The backend is unable to use the existing GIN index on path when looking for direct children (p.path[array_length(p."path", 1)] in Postgres, path__last in Django). The index is only designed for containment or intersection operators like @>, <@ and &&.

It might be possible to create an classic B-Tree index on p.path[array_length(p."path", 1)], either directly or via a generated column. This could make queries for direct children on ListElementChildren faster and speed up the whole navigation, as well as IIIF manifests and Create/DestroyElementParent.