 CREATE INDEX ON tree (sort);
 CREATE INDEX ON tree USING GIN (path);
 CREATE INDEX ON tree (depth);
+CREATE INDEX ON tree (structure);
 CREATE INDEX ON tree (pos);
-CREATE INDEX ON tree (sortpos);
 CREATE INDEX ON tree (project_id);
 
 -- -----------------------------------------------------------

            p.url,
            p.parent_id,
            p.sort,
            t.path || TO_JSONB(p.id) AS path,
            t.depth + 1 AS depth,
            t.pos || '.' || CAST(p.sort AS text) AS pos,
            t.sortpos || '.' || LPAD(CAST(p.sort AS text), 3, '0') AS sortpos,
            p.project_id
        FROM
            page p

    url,
    parent_id,
    sort,
    content,
    path,
    depth,
    structure,
    pos,
    project_id
FROM
    t
ORDER BY
    project_id ASC,
    pos ASC;

CREATE UNIQUE INDEX ON tree (id);
CREATE INDEX ON tree (name);
