Re: Turbo ODBC

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: "Koenig, Michael" <Michael(dot)Koenig(at)blue-yonder(dot)com>, "Uwe L(dot) Korn" <uwelk(at)xhochy(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Wes McKinney <wesmckinn(at)gmail(dot)com>, Matthew Rocklin <mrocklin(at)continuum(dot)io>, "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: Turbo ODBC
Date: 2017-01-17 21:30:25
Message-ID: 297e5b7b-58b2-cff3-9daf-41c2a166638d@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Nasby(at)bluetreble(dot)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(at)postgresql(dot)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)

In response to

Browse psycopg by date

  From Date Subject
Next Message Aryeh Leib Taurog 2017-01-19 12:23:15 Re: speed concerns with executemany()
Previous Message Daniele Varrazzo 2017-01-17 18:34:22 Re: Turbo ODBC