Skip to Content
0
Jan 17, 2018 at 09:59 AM

View Calculation Model of SQLScript Code

113 Views Last edit Jan 17, 2018 at 01:06 PM 7 rev

Is there a way to see view the calculation model that is generated from SQLScript code by the calculation engine?

I know, that there is PlanViz for visualizing the executed plan. However, it does not show nodes such as those generated for imperative code (the L-code nodes). I want to find out how the L-nodes and the other nodes are playing together, particularly if constructs such as loops are involved.

For example, if the following code is executed by PlanViz, the call would be represented by just a single "Call" node:

CREATE OR REPLACE PROCEDURE no_selects (
    out result INT
)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
READS SQL DATA AS
BEGIN
    DECLARE i INTEGER;
    DECLARE j INTEGER;
    DECLARE a INTEGER;
    
    FOR i IN 1..4 DO
        j=:i-1;
    END FOR;
    
    a = :j + :i;    
    result = :a * :j;
END;

call no_selects(?);

Specifically, I'm interested learning how to get the exact output of the calculation engine.