Comment 7 for bug 1497322

Revision history for this message
Mike Rylander (mrylander) wrote :

Because every user is in a group that is a descendent of the top of the group tree (normally "Users"), we could make the group selector non-nullable and default to users and then use the JOIN syntax rather than the WHERE syntax. This would remove the chance of evaluating the function more than once (re marking the function STABLE) and simplify the function as a whole. Group search would then parallel home library search.

This would require forcing use of the top of the org tree in the case of a search from the XUL client that didn't supply a group, for compatibility. That's a simple matter. However, it would mean that multi-rooted trees would not be directly supported in the XUL client, and would produce undefined results.

(NOTE: Marking the function STABLE does give the database the option of only running the function once, but does not force that. The projection of the function's output as a relation via JOIN will restrict it to a single evaluation, however.)

Thoughts?