the number of queries is the same, but instead of only getting the last 5 results, you will get all. Thus the query takes a bit longer. 
Not sure why you get an memory-exhausted error. Perhaps you have a really huge linkes-Database and the query is taking a lot more time. 
Unfortunately you...