From: Adrian Klaver <adrian.klaver@gmail.com>
To: Andriy Rysin <Andriy.Rysin@sas.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: pgsqlodbc 09_00_0200 is twice as slow on inserts as jdbc driver
Date: Tue, 21 Dec 2010 11:10:41 -0800
Message-ID: <4D10FBB1.70104@gmail.com> (raw)
In-Reply-To: <3D66EBA5D043E34AADB194828BD4468F1F0714B1@MERCMBX03D.na.SAS.com>
References: <3D66EBA5D043E34AADB194828BD4468F1F0714B1@MERCMBX03D.na.SAS.com>
On 12/21/2010 09:29 AM, Andriy Rysin wrote:
> I have written little test program which takes rows from table in one
> database and inserts them into same table in PostgreSQL 9.0.
> It can do the inserts either via jdbc or via odbc (09_00_0200 and
> unixODBC 2.3.0). The pattern is fairly simple:
>
> 1. Turn autocommit off
> 2. Prepare the insert sql
> 3. Fetch row from source table
> 4. Bind all columns for insert statement
> 5. Perform insert, repeat 3)
> 6. When done, commit
>
> The problem is that jdbc performs pretty well (on par with Oracle DB)
> but odbc inserts are about twice as slow: ~70sec vs ~32 for jdbc. My
> test was ~70,000 rows and table has 14 columns: NUMBERs, DATEs and small
> VARCHARs, 1 numeric primary key and two non-uniqu varchar indeces –
> nothing fancy. I measure just the insert timing so select from source
> does not impact the benchmark. The test was repeated multiple times with
> pretty consistent results.
> Can anybody confirm this or have a hint on where to look for the source
> of the problem?
> Thanks
> Andriy
One to thing look at is whether you have logging turned on in ODBC, this
really slows things down. In any case I have never found ODBC to be
particularly fast in comparison to other interfaces.
--
Adrian Klaver
adrian.klaver@gmail.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-odbc@postgresql.org
Cc: adrian.klaver@gmail.com, Andriy.Rysin@sas.com
Subject: Re: pgsqlodbc 09_00_0200 is twice as slow on inserts as jdbc driver
In-Reply-To: <4D10FBB1.70104@gmail.com>
References: <3D66EBA5D043E34AADB194828BD4468F1F0714B1@MERCMBX03D.na.SAS.com> <4D10FBB1.70104@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