On Mon, Sep 26, 2011 at 12:06 PM, firebirdsql <firebird...@yahoo.com> wrote:

> I have the following view:
> CREATE VIEW as example
> AS
> SELECT col1 FROM table1 INNER JOIN table2 USING(col1);
>

> Then when I use it:
> SELECT a.col1, a.col2, a.col3 FROM table1 AS a INNER JOIN example
> USING (col1);
>
>
> Is the optimizer smart enough to figure out that it can join table1
> directly to table 2 and get col1, col2, col3? Or does it process the view
> first and then join it to table1 (redundant) and get col1, col2, col3?
>

In this case yes, but some views must be instantiated first, so the general
case is more complicated.


> Is it possible to display a detailed execution plan?
>

With isql, you can say set plan, or set plan only.

Good luck,

Ann

>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu.  Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]

Reply via email to