Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRBf-0002qK-HT for pgsql-odbc@arkaria.postgresql.org; Fri, 28 Feb 2014 17:25:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WJRBf-0002qC-1W for pgsql-odbc@arkaria.postgresql.org; Fri, 28 Feb 2014 17:25:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRBe-0002q2-HI; Fri, 28 Feb 2014 17:25:26 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRBb-0001zi-1o; Fri, 28 Feb 2014 17:25:26 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 2F36D284FD; Fri, 28 Feb 2014 09:25:20 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 2C5CE401A0; Fri, 28 Feb 2014 09:25:20 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 5CA8EC0049; Fri, 28 Feb 2014 09:25:18 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Fri, 28 Feb 2014 09:25:17 -0800 (PST) Message-ID: <5310C67D.7040901@vmware.com> Date: Fri, 28 Feb 2014 19:25:17 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Jeremy Thornton CC: "pgsql-bugs@postgresql.org" , "pgsql-odbc@postgresql.org" Subject: Re: UUID, UUID-OSSP extension, and ODBC issue References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) 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 02/28/2014 06:31 PM, Jeremy Thornton wrote: > ODBC: pgsql 09.03.0200;OS: Windows 8.1 Pro;Postgres version: 9.3.3; > In using pgsqlODBC 09.03.0200 > or any version prior that we have tested we seem to be having a > performance decrease to only 625 inserts per second when > using UUID as the primary key and using the UUID-OSSP to generate > the default value of uuid_generate_v1() whereas if we generate the > UUID client side for the primary key and send it with the values in > the insert transaction we can increase it to 1500 inserts per second > bypassing the UUID-OSSP extension. This is consistent and > repeatable. The only change being made is Postgres generating the > UUID using the extension or us passing the value in the insert > statement. If Postgres generates it internally while inserting using a script through PgAdmin then it can generate at near 2000 inserts per second so > uuid-ossp shouldn't be the problem since it can keep up inside PgAdmin, but when > used over default settings in ODBC it is 2/3 slower. The data being > tested is the same in all cases. I am using a default System DSN on > Windows 8.1 Pro (no special settings). Is this a bug, expected behavior, or a settings > adjustment that needs to be made? I doubt this is an ODBC issue. I'm guessing that uuid_generate_v1() is simply quite slow. The upcoming PostgreSQL 9.4 will contain a new method for generating UUIDs: the pgcrypto contrib module will include a gen_random_uuid() function, which creates v4 random UUIDs. In a quick test, that's a lot faster than the UUID-OSSP based functions. If you need it bad enough and can't wait for 9.4, you could extract that into a stand-alone module for older version. It's not a lot of code. Or you could implement such a function in PL/pgSQL using pgcrypto's get_random_bytes() function. - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc