I have a big SuiteQL query that runs in 1,7sec. Bu...
# suiteql
e
I have a big SuiteQL query that runs in 1,7sec. But when I put it inside a RestLet and call it by:
Copy code
const result = query.runSuiteQL({
                query: q,
                params: [customerID],
            }).asMappedResults();
it uses 155sec. Should I not run it from a RestLet?
d
Have you tried logging before & after the query to clarify its execution time? If the restlet is being called externally, I've found authentication can be slow
e
It is slow even in the debugger
The problem is the
params
field. If you have multiple params and a long string that is your query. It takes forever. When I concatinate the params into the string myself, it is fast. from 155sec to 2sec
w
Note that Netsuite seems to cache query results for identical queries.
It could be that 155s is the normal "cold" execution time. But when you run the same query over and over without parameters it's executed in 2s.
e
No. This Restlet runs at 155sec every time.
But without params it runs at 1-2 sec every time
m
are you able to pull more than 5000 results? the help says you should be able to pull at least 100,000 results with the runSuiteQL function but I am only ever returning 5000
e
It returns just one row
j
runSuiteQL only returns 5000 results max
e
My query should only return one row. So that is not the issue
j
wait maybe I’m lying. Did it just change recently? It definitely very recently was only 5000….I just wrote a wrapper for mine to get more than 5000 easily! Sorry for offtopicking @Eystein Bye
🙂 1