From: Andrew Chernow <ac@esilo.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-bugs@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Rikard Pavelic <rikard.pavelic@zg.htnet.hr>
Subject: Re: BUG #5982: recursive type crashes postgres
Date: Fri, 15 Apr 2011 19:28:11 -0400
Message-ID: <4DA8D48B.2050404@esilo.com> (raw)
In-Reply-To: <4DA87D03020000250003C8E5@gw.wicourts.gov>
References: <201104151834.p3FIYSQ0067290@wwwmaster.postgresql.org>
<BANLkTikVekidaty3_CczUKBYxhkqYiq1QA@mail.gmail.com>
<28780.1302894395@sss.pgh.pa.us>
<4DA8AAD7.9000606@zg.htnet.hr>
<4DA86904020000250003C8CD@gw.wicourts.gov>
<BANLkTin2ud7LiKcKCs-USkXdnKnn2b+SqA@mail.gmail.com>
<4DA8720F020000250003C8D5@gw.wicourts.gov>
<BANLkTi=xZPS=8MB5rjVztSAk-PWeZ1ohYA@mail.gmail.com>
<4DA87D03020000250003C8E5@gw.wicourts.gov>
On 4/15/2011 6:14 PM, Kevin Grittner wrote:
> Merlin Moncure<mmoncure@gmail.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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: ac@esilo.com, Kevin.Grittner@wicourts.gov, mmoncure@gmail.com, tgl@sss.pgh.pa.us, rikard.pavelic@zg.htnet.hr
Subject: Re: BUG #5982: recursive type crashes postgres
In-Reply-To: <4DA8D48B.2050404@esilo.com>
References: <201104151834.p3FIYSQ0067290@wwwmaster.postgresql.org> <BANLkTikVekidaty3_CczUKBYxhkqYiq1QA@mail.gmail.com> <28780.1302894395@sss.pgh.pa.us> <4DA8AAD7.9000606@zg.htnet.hr> <4DA86904020000250003C8CD@gw.wicourts.gov> <BANLkTin2ud7LiKcKCs-USkXdnKnn2b+SqA@mail.gmail.com> <4DA8720F020000250003C8D5@gw.wicourts.gov> <BANLkTi=xZPS=8MB5rjVztSAk-PWeZ1ohYA@mail.gmail.com> <4DA87D03020000250003C8E5@gw.wicourts.gov> <4DA8D48B.2050404@esilo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox