I'd like to ask a simple question before reporting what I suspect to be a
bug.
On a Feb2013, using default_pipe (same holds for no_mitosis and sequential
pipes), no matter what the query and the data schema look like (really,
that shouldn't matter here), is it for any reason possible to have a MAL
plan with repeated, identical bind operations?
Like this:
function user.s4_1():void;
...
X_40 := sql.bind(X_1,"spinque","dict","idstr",0);
...
X_126 := sql.bind(X_1,"spinque","dict","idstr",0);
...
X_298 := sql.bind(X_1,"spinque","dict","idstr",0);
..
X_384 := sql.bind(X_1,"spinque","dict","idstr",0);
...
... and so on
My understanding is: with commonTerms optimizer enabled (I'm just using the
standard pipes), there should be no way to see those calls repeated:
- they have no side-effects
- they do not depend on any user data
Why isn't the first bind reused in the rest of the plan?
Of course my worries are not much about those calls per se, which are super
fast, but about my suspicion that entire subqueries built on top of such
binds are replicated unnecessarily.
I don't want to focus on the actual query here, because if I am correct
(please correct me otherwise), the situation above is already enough to
submit a more complete bug report.
By the way, another suspicious instruction that I see in my MAL plan is:
X_25 := X_24;
Shouldn't this be removed by the aliases optimizer?
Best, Roberto