I have tried the solution provided in #1854 which memorizes the result of toString()
. It works for a simple SQL but failed with complex one.
Then I took a heap snapshot and found the real reason of OOM:
And my question is should I simplify my parser or is there any improvement for toString()
method?
// PredictionContext.js ArrayPredictionContext.prototype.toString = function() {
Here's my parse tree of following SQL:
SELECT `ename`, `deptno`, `sal`
FROM `emp`
WHERE `deptno`=(SELECT `deptno` FROM `dept` WHERE `loc`='NEW YORK');