I have a function which creates a SELECT statement with a WHERE clause. This function then gets called multiple times (the WHERE clause will be different each time). I have two versions of this function. One opens the recordset and then iterates each row with MoveNext and populates some variables from each row. The other version opens the recordset and then calls GetRows to populate an array. Using the first version, my app takes 9 seconds but with the GetRows version it takes 79 seconds. I had read that GetRows is more efficient. Is this not the case?
Share
it is more efficient, as long as you’re not running out of memory (i.e. if you’re already low in available memory and we’re talking about a big table, then getting them in memory may be making your app start paging out to disk, while the other approach doesn’t because it gets a few at a time).
Why not post the offending code to see if there’s something else that’s causing the issue?