diff --git a/server/src/instant/db/model/triple.clj b/server/src/instant/db/model/triple.clj index a039847cd3..c22c478d7f 100644 --- a/server/src/instant/db/model/triple.clj +++ b/server/src/instant/db/model/triple.clj @@ -692,8 +692,7 @@ id_etypes AS ( SELECT cast(elem ->> 0 AS uuid) AS entity_id, - cast(elem ->> 1 AS text) AS etype, - TO_JSONB(cast(elem ->> 0 AS uuid)) AS entity_id_jsonb + cast(elem ->> 1 AS text) AS etype FROM jsonb_array_elements(cast(?id+etypes AS jsonb)) AS elem ), @@ -714,7 +713,7 @@ triples.ctid FROM triples - JOIN id_etypes ON triples.value = entity_id_jsonb + JOIN id_etypes ON json_uuid_to_uuid(triples.value) = id_etypes.entity_id JOIN attrs ON triples.attr_id = attrs.id WHERE triples.vae