Re: BUG #5982: recursive type crashes postgres

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
Subject: Re: BUG #5982: recursive type crashes postgres
Date: 2011-04-15 23:28:11
Message-ID: 4DA8D48B.2050404@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 4/15/2011 6:14 PM, Kevin Grittner wrote:
> Merlin Moncure<mmoncure(at)gmail(dot)com> wrote:
>
>> Consider we also have to send data to the database. I can
>> recursively wrap up data in the client using libpqtypes, fire it
>> to a receiving function which unnests it and processes it. This
>> is a couple of orders of magnitude faster than streaming it in
>> over multiple queries.
>
> I'll think on that. I hadn't really considered creating an ORM in
> the database engine itself, which seems to me to be what you're
> describing, but I guess it couldn't be worse than having an ORM on
> the other end of the wire.
>
> Is that a hard sell to your application programmers, or do you wear
> both hats?
>

libpqtypes is very easy to use, small learning curve. Should be easy for
someone with libpq experience.

Merlin is describing loop,pack,exec vs. loop,exec where the former packs an
array of parameters and performs one transaction, and the latter must execute
multiple transactions one at a time. If you take the params of an insert and
create a composite out of it, you can wrap the insert into a function that takes
an array of that composite. You are not creating any new bindings, translations
or encodings, just leveraging existing functionality a little differently.

--
Andrew Chernow
eSilo, LLC
global backup
http://www.esilo.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Mark Kirkwood 2011-04-16 07:17:00 Re: Massive memory use for star query
Previous Message Kevin Grittner 2011-04-15 22:14:43 Re: BUG #5982: recursive type crashes postgres