Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alPYT-00043D-1S for pgsql-odbc@arkaria.postgresql.org; Wed, 30 Mar 2016 23:29:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1alPYS-0004wD-KD for pgsql-odbc@arkaria.postgresql.org; Wed, 30 Mar 2016 23:29:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1alPYS-0004w7-46 for pgsql-odbc@postgresql.org; Wed, 30 Mar 2016 23:29:40 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1alPYN-0004Ed-Lp for pgsql-odbc@postgresql.org; Wed, 30 Mar 2016 23:29:39 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 816CE21DD3 for ; Wed, 30 Mar 2016 19:29:33 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 30 Mar 2016 19:29:33 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=PRqXv3CE16GO6BRcGdVw5NwwXcE=; b=ecKTeJ oBZelCCET+6RAHXrhOj21VM/uR9kx+XjAFBAr+WPfn8Ls4i0rpa1mbbsAIRV0gfu pmx/EK7T0QE3K7mb6bKa3XHx/ALAhjvlwgpGsJbSCH8u9V847D0+f4/2xRGYxMcS a4ZWzaIlZMdr+ZVoTvSp9m/f8I0ea2xB6Pe+8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=PRqXv3CE16GO6BR cGdVw5NwwXcE=; b=YpejABIUpmKyZvfFoDXL3WsgxLG1+PJU5F+oULZT8vcrq+v NYZk3SN53maZq4LQLoHpWMyLtvLCFJmsW2VicXpJpNo7dBDlowZicvrhNgbK4MJX fJHoE39TMzsafaHtDwjVHPqPprWWZLTBxsh594vrF5N7GCG2/tNPlDCdevSE= X-Sasl-enc: QWS75tivGGnyvEvbnGMDSjm3hMxY33Qwnq/sVtGWWcaU 1459380573 Received: from [192.168.1.2] (174-24-160-10.tukw.qwest.net [174.24.160.10]) by mail.messagingengine.com (Postfix) with ESMTPA id F1C4A680224; Wed, 30 Mar 2016 19:29:32 -0400 (EDT) Subject: Re: 10 row/second insert in ssis To: Bill Kuhn References: <56FC37BB.7050802@aklaver.com> Cc: pgsql-odbc From: Adrian Klaver Message-ID: <56FC615C.3020103@aklaver.com> Date: Wed, 30 Mar 2016 16:29:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 03/30/2016 03:35 PM, Bill Kuhn wrote: Ccing list > Adrian, > > Sorry for not including details earlier. > > Here is detail information: > psqlodbc version = psqlodbc_09_05_0100-x86 > sql server version = 11.0.3401.0 (2012) > postgres version = PostgreSQL 9.5.1 on x86_64-pc-linux-gnu, compiled by > gcc (Debian 4.9.2-10) 4.9.2, 64-bit > client/ETL tool = ssis > postgresql log = ? I don't have ssh access to the box. If this > information is needed I'll work with the admin to get it > odbc log = didn't see anything jumping out at me but I attached a copy > if you'd like to take a look > > Iteration 1: > 1. Created a odbc system dsn via odbad32 tool (windows) and > successfully tested connection > 2. Created an odbc connection manager (ssis) using odbc dsn created in > step #1 > 3. Created an odbc destination using connection manager created in step #2 > 4. Created a source (sql server ole db, query that select a single > integer column) > 5. Mapped the source column to the destination column > 6. Executed data flow for 100 records > 7. Observed execution time = 10 seconds (10 records/second) > > Iteration 2: > The only thing I changed from Iteration 1 was to use an ado.net > connection manager but it still used the same odbc dsn. > Same result. > > To prove that postgres is not having issues I cross joined the table > several times in postgres and inserted 11 million records in 14 > seconds. I did this just to make sure it wasn't something poorly > configured on the postgres side. > > Finally, I reproduced the steps in Iteration 1 on my laptop (originally > I was developing on a remote server) and I observed the same 10 > records/second throughput. > > After trying the above I then resorted to tweaking a setting (either on > the odbc dsn or within ssis), running, not seeing any difference, > reverting, tweaking a different setting, etc. No change in performance > regardless of any settings. > > I work a lot with sql server and oracle in ssis and I'm used to commits > being done in batches. With postgresql it seems like each insert is > being executed/committed separately (not in batch). By default psqlodbc runs in autocommit mode which would explain the above. I do not use SSIS so I am not going to be of much help there. All I can say is maybe check the 2,3,4 steps you mention above for a setting that turns autocommit off. This means though there will need to be explicit BEGIN/COMMIT commands somewhere. Do you know how the Oracle setup does that? You might also want to look at: https://technet.microsoft.com/en-us/library/ms131281%28v=sql.105%29.aspx > > Thanks in advance for any help you can provide. > > My real task is to migrate an entire database containing a few hundred > million rows from sql server to postgresql and continue to send data to > it every 10 minutes via an ssis package. I have no doubt that I could > figure out a way (dump to text and load into postgres) to load the > database initially but given the throughput I'm seeing the incremental > load would likely not be able to keep up. > > > > On Wed, Mar 30, 2016 at 4:31 PM, Adrian Klaver > > wrote: > > On 03/30/2016 12:00 PM, Bill Kuhn wrote: > > Greetings. > > Is there anything special to configure to use the 32 bit odbc > driver? > > I'm attempting to use the odbc driver to transfer data from > microsoft > sql server to postgresql and I'm seeing dismal insert > performance. It > is as if each insert is being performed individually. > > The rows I'm inserting only have one integer column. > > Is there anything special that needs to be done to configure the > driver > to improve performance? > > > Well given the almost complete lack of information provided, I would > the answer is maybe, depending on: > > psqlodbc version? > > SQL Server version? > > Postgres version? > > Exactly how are you transferring the data? > > Or to put it another way, what client are you using? > > What does the Postgres log show? > > What does the ODBC log show? > > > Many thanks. > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc