That makes sense. I do see one difference: When executing the statements with F5, I declare one variable as NUMBER and one as VARCHAR2(100):
variable firmanr number;
variable id varchar2(100);
begin
:firmanr:=11;
:id:='TAKS12145.0';
end;
/
select .....
When executing the query with F9, in the bind variable pop up, both variables are declared as VARCHAR2.
However, I just traced TOADs execution of the query, and in both cases (F9 or F5 execution) ended up with the same SQLID. The different data types of the bind variables do not seem to force a different SQLID. So whatever effect caused a different execution plan before does not seem to happen anymore.
The bottom line is TOAD doesn't really do anything different when executing statements via F9 or F5, but we still ended up with a different plan. The reason for that can't be explained, because we can't reproduce it now that the tables are re-analyzed and the underlying issue is fixed.
I'll look into this some more if we have this effect again, and that time take the traces before fixing/working around the underlying issue (urgency permitting), maybe we'll find the problem then.
Thank you for your help!