From 802357e63212aca99e7bea415b57634bdc11c21b Mon Sep 17 00:00:00 2001 From: Rostan <30502549+RostanTabet@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:50:43 +0200 Subject: [PATCH] Optimize Cursor.fetchall (#62) Co-authored-by: Xiang Fu --- pinotdb/db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pinotdb/db.py b/pinotdb/db.py index 7e9ac8b..e1546bf 100644 --- a/pinotdb/db.py +++ b/pinotdb/db.py @@ -524,10 +524,10 @@ def fetchmany(self, size=None): def fetchall(self): """ 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. + sequence of sequences (e.g. a list of tuples). """ - return list(self) + results, self._results = self._results, [] + return results @check_result @check_closed