Subject Re: [firebird-support] Re: Optimizer not optimizing
Author Harriv
On Fri, Mar 13, 2009 at 12:25 AM, dr_bentonquest <conversar@...> wrote:
>> It is reasonable to expect that the PICKUP_CLIFEC to be used, but it
>> depends on the _selectivity_ of the CLIENTE field.
>> How many distinct Cliente values are there compared to the number of
>> distinct FECHAREC?
> Well actually right now there is only 2 or 3 records on the PICKUP table.
> All share the same CLIENTE and FECHAREC. Also it might be worth noting that
> CLIENTE is also a Foreign Key column.
> Perhaps the optimizer will "think" different with enough normal day-to-day
> records in the table?

That's possible, you should fill your database with real (or
simulated) data, and recalculate the index selectivity. See