Set Oracle stmtcachesize to 20 instead of 0 for a performance boost.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Matt Boersma 2007-12-21 18:49:07 +00:00
parent 0a348bb269
commit c5d3a925c7
1 changed files with 6 additions and 0 deletions

View File

@ -432,6 +432,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self.oracle_version = int(self.connection.version.split('.')[0]) self.oracle_version = int(self.connection.version.split('.')[0])
except ValueError: except ValueError:
pass pass
try:
self.connection.stmtcachesize = 20
except:
# Django docs specify cx_Oracle version 4.3.1 or higher, but
# stmtcachesize is available only in 4.3.2 and up.
pass
if not cursor: if not cursor:
cursor = FormatStylePlaceholderCursor(self.connection) cursor = FormatStylePlaceholderCursor(self.connection)
# Default arraysize of 1 is highly sub-optimal. # Default arraysize of 1 is highly sub-optimal.