If you've tried using `BUILTIN.RELATIVE_RANGES` in...
# suiteql
m
If you've tried using
BUILTIN.RELATIVE_RANGES
in a SuiteQL criteria, you have probably noticed how poor the performance is. I suspect that there might be an internal function that the query optimizer doesn't cache, resulting in it being called for every line. However, I've found a workaround that gets the engine to calculate the call only once. Hopefully, this will help anyone else facing the same issue.
Copy code
SELECT id
FROM transaction
         INNER JOIN (SELECT BUILTIN.RELATIVE_RANGES('DAGO15', 'START') AS StartDate FROM DUAL) AS RelativeDate ON 1 = 1
WHERE createddate >= RelativeDate.StartDate
The original version looked prettier with a CTE and CROSS JOIN, but I had to find a creative solution to make it work with ODBC.
🧠 2
🙌 2
slack bookmark 1
c
I wish they'd expose EXPLAIN PLANs. Just a pipedream though, their intermediate abstraction layer is probably insane
netsuite 1