INSERT INTO gorfs.nodes(node_full_path, object_type, permissions)
SELECT
pn.node_full_path, pn.object_type, pn.permissions
FROM
(
VALUES
(CAST(0 AS SMALLINT), CAST('/userfiles' AS gorfs.absolute_pathname), CAST('S_IFDIR' AS gorfs.mode_t_constant_name), CAST('111111111' AS BIT(9))),
(1, '/userfiles/account', 'S_IFDIR', '111111111'),
(2, '/userfiles/account/2681', 'S_IFDIR', '111111111'),
(3, '/userfiles/account/2681/attachment', 'S_IFDIR', '111111111'),
(4, '/userfiles/account/2681/attachment/33168371', 'S_IFDIR', '111111111'),
(5, '/userfiles/account/2681/attachment/33168371/file', 'S_IFDIR', '111111111'),
(6, '/userfiles/account/2681/attachment/33168371/file/7038561', 'S_IFDIR', '111111111'),
(7, '/userfiles/account/2681/attachment/33168371/file/7038561/main.with_name', 'S_IFDIR', '111111111')
) AS pn(elevation, node_full_path, object_type, permissions)
WHERE
(NOT EXISTS(SELECT 0 FROM gorfs.nodes AS en WHERE (pn.elevation < 7) AND (en.node_full_path = pn.node_full_path) AND (en.object_type = 'S_IFDIR')))
ORDER BY
pn.elevation ASC
;
It took 8.120 ms...
Running an "api.php" from the website.