On Mon, Dec 12, 2011 at 4:41 PM, Sushant Sinha <sushant354@gmail.com> wrote:
> I am using psycopg 2.4.2 and facing performance issue. An explain
> analyze of the query on the database shows 0.75secs. But when used
> through the psycopg layer I am seeing 1.5 secs. Any idea why the extra
> cost and how to optimize it?
>
> from psycopg2.extras import DictCursor
> from psycopg2.extensions import UNICODE, UNICODEARRAY
> psycopg2.extensions.register_type(UNICODE)
> psycopg2.extensions.register_type(UNICODEARRAY)
>
>
> cursor = dbCnx.cursor(cursor_factory=DictCursor)
> cursor.execute(query, params)
> results = cursor.fetchall()
What is the performance using only the basic cursor? And how big is
the returned set?
-- Daniele