Re: Performance problems with prepared statements

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Performance problems with prepared statements
Дата
Msg-id b42b73150710120602g2f47dd21lb851a72d05a184f1@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Performance problems with prepared statements  (Theo Kramer <theo@flame.co.za>)
Ответы Re: Performance problems with prepared statements
Список pgsql-performance
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

В списке pgsql-performance по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Performance problems with prepared statements
Следующее
От: Theo Kramer
Дата:
Сообщение: Re: Performance problems with prepared statements