Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1

Поиск
Список
Период
Сортировка
От ning
Тема Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1
Дата
Msg-id 27f31620907142010u391841e2ha432f939d3acbb7e@mail.gmail.com
обсуждение исходный текст
Ответы Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1  (Craig Ringer <craig@postnewspapers.com.au>)
Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-performance
Hi,

I am transplanting an application to use PostgreSQL8.2.4 instead of DB2 9.1.
CLI was used to connect to DB2, and ODBC is used to connect to PostgreSQL.
The query statement is as follows:

SELECT void,nameId,tag FROM (SELECT void,nameId,tag,.... FROM Attr
WHERE attributeof IN (SELECT oid_ FROM ItemView WHERE
ItemView.ItemId=?)) x RIGHT OUTER JOIN (SELECT oid_ FROM ItemView
WHERE ItemView.ItemId=? and ItemView.assignedTo_=?) y ON attributeof =
oid_ FOR READ ONLY

I tested the performance on PostgreSQL against DB2, and found that

First execution: PostgreSQL 0.006277 seconds / DB2 0.009028 seconds
Second execution: PostgreSQL 0.005932 seconds / DB2 0.000332 seconds

PostgreSQL cost nearly the same time but DB2 ran 30 times faster in
second execution.

I tried to adjust shared_buffers parameter in postgresql.conf, no speed up.
Actually my DB holds only several records so I don't think memory is the reason.

Could anybody give some advice to speed up in repeated execution in
PostgreSQL or
give an explanation why DB2 is so mush faster in repeated execution?

Thank you.
ning

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

Предыдущее
От: Lauris Ulmanis
Дата:
Сообщение: CREATE USER command slows down when user count per server reaches up to 500 000
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Performance comparison between Postgres and Greenplum