Subject Re[2]: [ib-support] Optimizer or De-optimizer ?
Author Ann W. Harrison
At 03:29 PM 3/21/2001 -0300, Carlos H. Cantu wrote:

>Aquisi is the larger table. I tried to put the lookup field as part of the
>Query but it didnt change the plan.

I think the optimization is correct. Walk the smaller table,
performing lookups in the larger. Every hit in the larger table
will be a result. Remember that a foreign key column can be
null, so the larger table might have lots of rows that have
no match in the smaller table.

>If I understand correctly, the PLAN can change when the tables grow up, so
>the right PLAN today can be the wrong PLAN tomorrow, right ?

It is (theoretically) more likely that the optimizer will choose
the right plan now and a different plan, also right, under different
conditions. A plan you attach to the query eliminates that possibility.


Regards,

Ann
www.ibphoenix.com
We have answers.