Sql, Spl, Database.
from what we expected. Therefore, we think that Oracle probably did sorting when calculating in-group TopN, resulting in a sharp drop in performance (whatever, we don’t have the source code to confirm) and making the optimizer fail. Then, how SPL solve these? For the first example: