"Josh Berkus" <[EMAIL PROTECTED]> writes:
> I created a view to support comprehensive reporting on one of the
> databases I work with. Unfortunately, due to the structure of the
> database, which includes 25 reference tables, this requires 3 regular
> joins and about 40 LEFT OUTER JOINS, outputting about 100 columns.
I suppose this is a star schema, wherein rows of the main tables join
to at most one row of the "reference" tables? If so, you probably want
to make sure you perform the join of the main tables before you start
outerjoining the reference tables onto them. The syntax you are using
is constraining the planner to use what's probably not a good plan.
See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/explicit-joins.html
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]