Set the default array size to 50 instead of 1 as the DB API suggests because
the performance difference is so drastic and many people have recommended that the default be changed.
This commit is contained in:
parent
b8b97ac65a
commit
9b56028455
3
Cursor.c
3
Cursor.c
@ -287,7 +287,8 @@ static int Cursor_Init(
|
||||
Py_INCREF(connection);
|
||||
self->connection = connection;
|
||||
self->environment = connection->environment;
|
||||
self->arraySize = 1;
|
||||
self->arraySize = 50;
|
||||
self->fetchArraySize = 50;
|
||||
self->bindArraySize = 1;
|
||||
self->statementType = -1;
|
||||
self->outputSize = -1;
|
||||
|
||||
@ -9,10 +9,11 @@ Cursor Object
|
||||
|
||||
This read-write attribute specifies the number of rows to fetch at a time
|
||||
internally and is the default number of rows to fetch with the
|
||||
:meth:`~Cursor.fetchmany()` call. It defaults to 1 meaning to fetch a
|
||||
single row at a time. Note that this attribute can drastically affect the
|
||||
:meth:`~Cursor.fetchmany()` call. It defaults to 50 meaning to fetch 50
|
||||
rows at a time. Note that this attribute can drastically affect the
|
||||
performance of a query since it directly affects the number of network round
|
||||
trips that need to be performed.
|
||||
trips that need to be performed. This is the reason for setting it to 50
|
||||
instead of the 1 that the DB API recommends.
|
||||
|
||||
|
||||
.. attribute:: Cursor.bindarraysize
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user