From: Merlin Moncure <mmoncure@gmail.com>
To: theo@flame.co.za
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance problems with prepared statements
Date: Fri, 12 Oct 2007 09:02:32 -0400
Message-ID: <b42b73150710120602g2f47dd21lb851a72d05a184f1@mail.gmail.com> (raw)
In-Reply-To: <1192174502.2470.9.camel@localhost.localdomain>
References: <1192027540.2495.3.camel@localhost.localdomain>
<470CE918.4060608@dalibo.com>
<1192044840.2549.21.camel@fedmac>
<slrnfgsqpi.27gg.andrew+nonews@atlantis.supernews.net>
<b42b73150710111304m161814cds984a7c525ff87241@mail.gmail.com>
<1192174502.2470.9.camel@localhost.localdomain>
On 10/12/07, Theo Kramer <theo@flame.co.za> wrote:
> On Thu, 2007-10-11 at 16:04 -0400, Merlin Moncure wrote:
> > is this a converted cobol app?
>
> :) - on the right track - it is a conversion from an isam based package
> where I have changed the backed to PostgreSQL. Unfortunately there is
> way too much legacy design and application code to change things at a
> higher level.
fwiw, I converted a pretty large cobol app (acucobol) to postgresql
backend translating queries on the fly. if this is a fresh effort,
you definately want to use the row-wise comparison feature of 8.2.
not only is it much simpler, it's much faster. with some clever
caching strategies i was able to get postgresql performance to exceed
the isam backend. btw, I used execprepared for virtually the entire
system.
example read next:
select * from foo where (a,b,c) > (a1,b1,c1) order by a,b,c limit 25;
example read previous:
select * from foo where (a,b,c) < (a1,b1,c1) order by a desc, b desc,
c desc limit 25;
etc. this will use complete index for a,b,c and is much cleaner to
prepare, and parse for the planner (the best you can get with standard
tactics is to get backend to use index on a).
Another big tip i can give you (also 8.2) is to check into advisory
locks for isam style pessimistic locking. With some thin wrappers you
can generate full row and table locking which is quite powerful.
merlin
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-performance@postgresql.org
Cc: mmoncure@gmail.com, theo@flame.co.za
Subject: Re: Performance problems with prepared statements
In-Reply-To: <b42b73150710120602g2f47dd21lb851a72d05a184f1@mail.gmail.com>
References: <1192027540.2495.3.camel@localhost.localdomain> <470CE918.4060608@dalibo.com> <1192044840.2549.21.camel@fedmac> <slrnfgsqpi.27gg.andrew+nonews@atlantis.supernews.net> <b42b73150710111304m161814cds984a7c525ff87241@mail.gmail.com> <1192174502.2470.9.camel@localhost.localdomain> <b42b73150710120602g2f47dd21lb851a72d05a184f1@mail.gmail.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