Subject | Re: subselect in update : how to force a plan ? |
---|---|
Author | EvelyneGirard |
Post date | 2004-08-11T21:02:21Z |
--- In firebird-support@yahoogroups.com, Daniel Rail <daniel@a...>
wrote:
the same result ... examen would be scanned completely... I realise I
will have no other choice and have to do this in Delphi instead of
doing it with one SQL...
Thank you
Evelyne
wrote:
>(e.id_visite=10546)
> It is as designed. Because the second WHERE clause is transformed
> internally to: (e.id_visite=8) or (e.id_visite=10) or
> Which will use an index. And, with a subquery, it's hard to use anThere is no field patient.id_visite. But if there was one, I'd have
> index in the same manner.
>
> But, if I'm not mistaken the IN clause with a subquery should be be
> transformed to:
>
> where exists(select 1 FROM Patient
> left join Visite on (Patient.ID_Patient = Visite.ID_Patient)
> WHERE (Patient.ID_Patient = '45691')
> (Patient.id_visite=e.id_visite))
>
> So what happens if you change the first WHERE clause to what I've
> written above? Do you have an index on Patient.id_visite?
>
the same result ... examen would be scanned completely... I realise I
will have no other choice and have to do this in Delphi instead of
doing it with one SQL...
Thank you
Evelyne