Subject Re: Plan not working
Author rod@myiafrica.com
I found the problem

I did a test backup, renamed my current dataset and restored the
backup. All the data was there, the correct metadata etc. but the
plan would just not work. (Backed up using IBConsole).

When I recovered my renamed dataset - the plans work.

I will play about a bit more to see how this is possible, but it
would be nice to know restored backups can use indices !



--- In ib-support@y..., Paul Reeves <paul@f...> wrote:
> rod@m... wrote:
> >
> > yes - that is the exact command.
> >
> > In fact any table I use where I would use an index is not being
> > chosen. Interbase always uses Plan Natural...
> >
>
> Well I just tried this:
>
> select * from employee
> where job_code='Eng'
> order by last_name, first_name;
>
> which is semantically the same query. There is a NAMEX index on
last_name,
> first_name and the plan generated is
>
> PLAN (EMPLOYEE ORDER NAMEX)
>
> This is actually tested against a very early version of Firebird,
so I doubt
> that it differs too much from InterBase. So, given that there is a
consensus
> that the plan should use the index for this type of query, what is
it about
> your database that is confounding this?
>
> I guess we should start at the beginning - O/S, IB/Fb version,
double check
> the indexes exits and are active, phase of the moon etc.
>
>
> Paul
> --
>
> Paul Reeves
> http://www.ibphoenix.com
> taking InterBase further