Rostan TABET
01/10/2023, 9:18 AMCursor.fetchall has the following docstring :
Fetch all (remaining) rows of a query result, returning them as a
sequence of sequences (e.g. a list of tuples). Note that the cursor's
arraysize attribute can affect the performance of this operation.However, the method's implementation is simply :
return list(self)
which basically creates a list by calling fetchone, i.e. self._results.pop(0) once for each element of the list self._results. I wonder if there is a reason for this, instead of something like :
res = self._results
self._results = []
return res
My main concern is about possible performance issues when the query result contains many rowsRichard
01/10/2023, 11:49 AMRostan TABET
01/10/2023, 2:33 PMRostan TABET
01/10/2023, 2:35 PMMayank