kapilratnani/django_hana — pull request #20 by lanzz (2014-01-09 11:17:23+00:00)
Title: Call `create_or_set_default_schema` only once per connection

`create_or_set_default_schema` is being called once for every new cursor, which results in performing at least a `select (1) as a from schemas ...` query for every cursor. This practically doubles the number of queries performed, as very often cursors are only used for a single query, and there might be cases where a cursor is instantiated but never used, which will still perform the schema check query.

Moved the `create_or_set_default_schema` call into the `connect` method, so that it is called only once per connection instead of once per cursor.