The database function permission.grp_descendants should
be marked stable; it qualifies, and doing so should allow
PostgreSQL to improve query plans. One example of a query
that would benefit is searching by patron profile (a la
bug 1497322)