Subject Re: [firebird-support] Puzzled by difference in execution time
Author Mark Rotteveel
On 3-3-2018 17:43, setysvar setysvar@... [firebird-support] wrote:
> The execute blocks had similar similar content to:
>
> for select mt.PK
> from <temporary table> tt
> join <normal table> mt on <join criteria>
> where mt.integerfield = 1 into :PK do
> begin
>   suspend;
>   update <normal table>
>   set field1 = 'K', field2 = '-'
>   where pk = :pk;
>   MyCount = MyCount + rows_affected;
> end
>
> The join criteria were
>
> (slow)
> tt.VarChar40 = mt.VarChar40
>
> (quick)
> tt.int1 = mt.int1 and tt.int2 = mt.int2
>
> Running the select part without the update is quick in both cases.
>
> Can anyone enlighten me regarding what the cause of the performance
> difference may be? I'm simply puzzled and clueless...

What happens if you use MERGE instead of doing the updates 'manually',
or if you remove the SUSPEND statement? Which columns is the EXECUTE
BLOCK returning?

Mark
--
Mark Rotteveel