Re: Interest in serializing composite types?

Darren Duncan <[email protected]> Mon, 25 Aug 2014 17:33:06 -0700
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
On 2014-08-24, 5:33 PM, Chris Travers wrote:
> Arrays are at least in theory self-contained.  We don't
> have to ask the db how to parse them.  Tuples are not (we need to do a catalog
> lookup to find the order of elements).

So here's a question ...

DBI has for a long time given the option for tuples to be returned either as 
arrays or as hashes.

If the ability to choose representation is preserved in the improvements you're 
making, then could the extra db lookups be avoided if say the user choose to get 
their tuples as arrays instead?  The information about field names is lost, but 
then the user chose to not want them anyway, as they are identifying the fields 
by ordinal position instead.

DBI defaults to returning tuples from plain SELECTs as arrays, and you have to 
ask it if you want hashes; does doing the latter mean a lookup already that the 
former doesn't have?

-- Darren Duncan