When you look at attributes supplied by the
acs_object_party_privilege_map view, you get the idea that it was
designed for certain queries: like figuring out what privileges exist
on a certain object for a certain party. However, I ran the following
query:
select privilege from acs_object_party_privilege_map where
object_id = 6282 and party_id = 2581;
and got the following query plan (top lines only):
Subquery Scan acs_object_party_privilege_map
(cost=685515.52..696024.06 rows=140114 width=148)
-> Unique (cost=685515.52..696024.06 rows=140114 width=148)
-> Sort (cost=685515.52..685515.52 rows=1401139 width=148)
which seems to indicate a very expensive query. With just the default
installation of OACS, this query takes several minutes to complete.
My question is: can this seemingly important query be replaced with
something along the lines of the way ad_permission_p was replaced?
This query is, I guess, building a huge table and doing sequential
scans of many tables that have indicies. Just looking for advice
before I plow into this mess.