Just to give people a flavor of how bad the cc_users view can be in postgresql,
here is the plan generated for a fairly straightforward
query:
explain select * from cc_users u, forums_messages f where u.user_id = f.user_id and message_id = 100;
NOTICE: QUERY PLAN:
Nested Loop (cost=1812.21..2367.32 rows=1 width=1442)
-> Index Scan using forums_messages_pk on forums_messages f (cost=0.00..3.05 rows=1 width=923)
-> Materialize (cost=2321.71..2321.71 rows=3404 width=519)
-> Hash Join (cost=1812.21..2321.71 rows=3404 width=519)
-> Hash Join (cost=1618.34..2059.76 rows=3406 width=503)
-> Hash Join (cost=1410.51..1792.44 rows=3403 width=479)
-> Seq Scan on users u (cost=0.00..288.27 rows=10227 width=241)
-> Hash (cost=1401.99..1401.99 rows=3408 width=238)
-> Hash Join (cost=1146.20..1401.99 rows=3408 width=238)
-> Seq Scan on parties pa (cost=0.00..188.43 rows=10243 width=145)
-> Hash (cost=1137.68..1137.68 rows=3408 width=93)
-> Hash Join (cost=304.61..1137.68 rows=3408 width=93)
-> Seq Scan on acs_objects o (cost=0.00..655.31 rows=27031 width=85)
-> Hash (cost=296.10..296.10 rows=3408 width=8)
-> Seq Scan on group_element_index (cost=0.00..296.10 rows=3408 width=8)
-> Hash (cost=182.27..182.27 rows=10227 width=24)
-> Seq Scan on persons pe (cost=0.00..182.27 rows=10227 width=24)
-> Hash (cost=168.29..168.29 rows=10229 width=16)
-> Seq Scan on membership_rels mr (cost=0.00..168.29 rows=10229 width=16)