Removed unnecessary depth calculation from entity query.
This commit is contained in:
parent
89a729924d
commit
e4e0eb23dd
|
@ -151,16 +151,14 @@ async function fetchIncludedEntities() {
|
|||
/* get recursive parents of networks (necessary for scraper resolve) */
|
||||
SELECT to_jsonb(included_per_network) as entity,
|
||||
parent_id,
|
||||
array['parent'] as parent_path,
|
||||
0 as depth
|
||||
array['parent'] as parent_path
|
||||
FROM included_per_network
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT jsonb_set(entity_tree.entity, entity_tree.parent_path, to_jsonb(entities)),
|
||||
entities.parent_id,
|
||||
entity_tree.parent_path || array['parent'],
|
||||
depth + 1
|
||||
entity_tree.parent_path || array['parent']
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
|
@ -185,8 +183,7 @@ async function fetchReleaseEntities(baseReleases) {
|
|||
WITH RECURSIVE entity_tree as (
|
||||
SELECT to_jsonb(entities) as entity,
|
||||
parent_id,
|
||||
array['parent'] as parent_path,
|
||||
0 as depth
|
||||
array['parent'] as parent_path
|
||||
FROM entities
|
||||
WHERE slug = ANY(:entitySlugs)
|
||||
|
||||
|
@ -194,8 +191,7 @@ async function fetchReleaseEntities(baseReleases) {
|
|||
|
||||
SELECT jsonb_set(entity_tree.entity, entity_tree.parent_path, to_jsonb(entities)),
|
||||
entities.parent_id,
|
||||
entity_tree.parent_path || array['parent'],
|
||||
depth + 1
|
||||
entity_tree.parent_path || array['parent']
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue