Subject Re: [firebird-support] Views and left outer does not generate efficient plans
Author Svein Erling Tysvaer
Views don't automagically become tables, and I doubt there is a general
answer that can explain why your particular query OUTER JOINing two
views are slow. Show us the view definitions, the actual query with the
outer join, the generated plan and some explanation about the indexes
actually used in the plan (e.g. whether practically unique or containing
lots of duplicates) and then someone on this list may be able to
understand and explain why it is slow.

Set

kokok_kokok wrote:
> I use Firebird 1.5.4 and I have created some views joining several
> tables in each view.
>
> Views work fine and efficiently in statements like SELECT * FROM VIEW1.
>
> The problem is when I use LEFT OUTER operator in 2 views, they query
> takes several minutes in a large database.
>
> For example:
>
> SELECT * FROM VIEW1 LEFT OUTER JOIN VIEW2 ON ...
>
> If I use INNER JOIN or I re-write the SQL statement using the
> underlying tables instead of the views (using LEFT OUTER), the results
> are displayed in seconds.
>
> Does somebody have a clue about this problem?
>
> Thank you