RE: Map/Reduce scripts, is there a hard limit on t...
# suitescript
d
RE: Map/Reduce scripts, is there a hard limit on the number of maps() you can create?
s
I don’t think there is a hard limit, i’ve seen instances of several hundreds of thousands of map contexts created. However two things to keep in mind: There is a memory size limit of 200 MB for the getInputData stage’s serialized data output. This means that if the serialized/stringified version of the query, search, or other return type is larger than 200 MB, the script will fail and terminate, and no further stages will get called. The other is that performance of map/reduce does not scale in a linear fashion. From what I’ve seen, there is a reflection point where more results from getInputData cause the entire map/reduce to run more slowly. Experimentally, it seems to be around 30-40 thousands results for small queries or searches, with just a few columns. Sometimes it’s best to impose your own limit, even if NetSuite doesn’t.