Forum OpenACS Development: Re: cc_users considered harmful (sometimes at least)

Collapse
Posted by Tilmann Singer on
Why do we need a view for this at all? Why not encourage people to join against the persons table if they need first_names, last_name, and additionally against parties in case email is needed too? For neither of those attributes the users table is necessary, since the user_id is recorded in the applications table (e.g. the bug assignee), so it is already assured that the party is a user.

Wouldn't that be a little more efficient in most cases, without much overhead (e.g. writing a join against persons is as easy as writing a join against cc_users_lite).

As a side note - usage of person.name in queries that return more than one row should be strongly discouraged for efficiency reasons, right?

Collapse
Posted by Dirk Gomez on
Views are nice for abstracting information - in fact they are the Oracle-recommended way of "information encapsulation". We still very much rely on PL/SQL functions for doing so which usually gives us performance grieving...

The danger with views - evidenced frequently enough in OpenACS - that they retrieve more information than needed in the "master query".

No PL/SQL functions that perform banal operations :)