Files
speckle-server/test-queries/materialised-simple.sql
T
Dimitrie Stefanescu 85cc525663 feat(queries): figuring out the perfect querie for getting objects
quite a few things are being considered, perf. wise: pagination, ordering, querying, depth.
2020-05-04 16:25:37 +01:00

10 lines
254 B
SQL

WITH ids AS(
SELECT unnest( string_to_array( ltree2text( subltree("path", 1, 3) ), '.') ) as obj_id
FROM object_tree_refs
WHERE parent = '0_hash'
)
SELECT obj_id, speckle_type, "data"
FROM ids
JOIN objects ON ids.obj_id = objects.id
OFFSET 0
LIMIT 100