Hi All, I'm interested in the most efficient way t...
# suitescript
j
Hi All, I'm interested in the most efficient way to pull information from the database when scripting.. is it using searches or the newer query module, and what method within? I'm sure others have wondered the same thing but I haven't found where it is documented.
s
empirically it seems that the SuiteQL method seems fastest.
j
hey @stalbert, have you found any numbers that show this or do you have experience with it?
c
It really depends on what you're doing and when. For example, if you just needed a few fields from a record, you can do a lookupFields operation rather than a search or record load. There's times where you have to load a record like modifying sublist info. The rest of the time, I usually use searches/saved searches via N/search module.
👍 2
j
thanks @creece, i'm thinking in terms of say 100,000 lines of data what would be the most efficient
s
I've recently adopted SuiteQL as my go-to search method, falling back on N/search if needed
c
Some form of search then like SuiteQL or N/search is what you want for sure.
a
SuiteQL is going to be the way to go for any larger data set now. The efficiency on this vs searches is night and day. For example, 100K rows in .53 seconds as a recent test, as opposed to calling the search module for every X,000 rows, which can take 10's of seconds to minutes depending on search parameters/dataset being called
👍 4
j
love the analysis! thanks @Anthony (NimbusLabs)