Re: [JDBC] Good performance?

Поиск
Список
Период
Сортировка
От Barry Lind
Тема Re: [JDBC] Good performance?
Дата
Msg-id 3E5120E2.30401@xythos.com
обсуждение исходный текст
Ответ на Re: [JDBC] Good performance?  (Rafal Kedziorski <rafcio@polonium.de>)
Список pgsql-performance
Rafal,

I would expect things to be slower with a commit after each insert,
since it is the commit that forces the data to be written to disk.
However 50x seems a bit much and I think is due to cygwin performance.

I ran your code on my laptop running RH7.3 and get the following results:

Running with autocommit on:
InsertFirmSQLInt8() needed 5129 for creating 1000 entries
InsertFirmSQLInt8() needed 5417 for creating 1000 entries
InsertFirmSQLInt8() needed 4976 for creating 1000 entries
InsertFirmSQLInt8() needed 4162 for creating 1000 entries

Running with autocommit off:
InsertFirmSQLInt8() needed 1250 for creating 1000 entries
InsertFirmSQLInt8() needed 932 for creating 1000 entries
InsertFirmSQLInt8() needed 1000 for creating 1000 entries
InsertFirmSQLInt8() needed 1321 for creating 1000 entries
InsertFirmSQLInt8() needed 1248 for creating 1000 entries

On linux I see about a 5x slowdown which is more in line with what I
would expect.

thanks,
--Barry


Rafal Kedziorski wrote:
> hi,
>
> Barry Lind wrote:
>
>> Rafal,
>>
>> Performance of postgres running under cygwin isn't great.  Can you try
>> the same test on a different platform?  It also looks like you are
>> running in autocommit mode.  You should see a significant performance
>> improvement if you batch your commits in say groups of 1000 inserts
>> per commit.
>
>
> after set autocommit false, I need 0,9 - 1,04 seconds for insert 1000
> new entries into my table. is this normal, that autocommit false is
> 40-50 times slower?
>
>
> Rafal
>
>> thanks,
>> --Barry
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: cost and actual time
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: [JDBC] Good performance?