Re: [psycopg] Turbo ODBC - Mailing list psycopg

From Jim Nasby
Subject Re: [psycopg] Turbo ODBC
Date
Msg-id 297e5b7b-58b2-cff3-9daf-41c2a166638d@BlueTreble.com
Whole thread Raw
In response to Re: [psycopg] Turbo ODBC  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
Possibly, if large objects are actually being returned from Postgres.
But I suspect that in most cases what you'd be getting from Postgres
would be a bunch of rows, which you then want to turn into a python form
that's efficient for analytics, such as a DataFrame or arrow.

The binary return option on PQexecParams might be useful though. That
would allow ints to come over as 4 bytes instead of a variable length
string, for example. Presumably that would provide a performance increase.

On 1/17/17 12:34 PM, Daniele Varrazzo wrote:
> ISTM there has to be a fundamental switch in how psycopg uses the
> libpq: it should use, at least for what these large objects are
> concerned, a binary data type and asking for a binary result
> (https://www.postgresql.org/docs/9.6/static/libpq-exec.html#LIBPQ-PQEXECPARAMS),
> right?
>
> -- Daniele
>
> On Tue, Jan 17, 2017 at 4:31 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
>> On 1/17/17 9:16 AM, Koenig, Michael wrote:
>>>
>>> For the NumPy functionality, NULL values are handled by returning masked
>>> arrays (https://docs.scipy.org/doc/numpy/reference/maskedarray.html) instead
>>> of plain arrays.
>>
>>
>> Oh, interesting. That's the same representation Postgres uses internally as
>> well. I hope to explore this further in plpython at some point.
>>
>> --
>> Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
>> Experts in Analytics, Data Architecture and PostgreSQL
>> Data in Trouble? Get it in Treble! http://BlueTreble.com
>> 855-TREBLE2 (855-873-2532)
>>
>>
>> --
>> Sent via psycopg mailing list (psycopg@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/psycopg


--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: [psycopg] Turbo ODBC
Next
From: Aryeh Leib Taurog
Date:
Subject: Re: [psycopg] speed concerns with executemany()