-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.6
-
Component/s: Core VCS
-
Environment:PostgreSQL
-
Tags:
In the nx_update_read_acls the first insert request may result in full scan on hierarchy. Adding a LIMIT 1 will prevent this:
INSERT INTO hierarchy_read_acl SELECT id, md5(nx_get_read_acl(id)) FROM (SELECT DISTINCT(hierarchy_id) AS id FROM aclr_modified WHERE is_new AND EXISTS (SELECT 1 FROM hierarchy WHERE aclr_modified.hierarchy_id=hierarchy.id LIMIT 1)) AS uids;