Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRZO-0003Z5-ET for pgsql-odbc@arkaria.postgresql.org; Fri, 28 Feb 2014 17:49:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WJRZN-0005m9-PL for pgsql-odbc@arkaria.postgresql.org; Fri, 28 Feb 2014 17:49:57 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRZM-0005ly-Pk; Fri, 28 Feb 2014 17:49:56 +0000 Received: from col0-omc2-s18.col0.hotmail.com ([65.55.34.92]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJRZE-0001Zw-SX; Fri, 28 Feb 2014 17:49:56 +0000 Received: from COL128-W19 ([65.55.34.73]) by col0-omc2-s18.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 28 Feb 2014 09:49:47 -0800 X-TMN: [BdM0PleM/8WztzsMbgngM1f1uEW/xQUt] X-Originating-Email: [consolity@outlook.com] Message-ID: Content-Type: multipart/alternative; boundary="_5d561c7e-6ea8-4338-af89-cc8970696d85_" From: Jeremy Thornton To: Heikki Linnakangas CC: "pgsql-odbc@postgresql.org" , "pgsql-bugs@postgresql.org" Subject: Re: UUID, UUID-OSSP extension, and ODBC issue Date: Fri, 28 Feb 2014 12:49:47 -0500 Importance: Normal In-Reply-To: <5310C67D.7040901@vmware.com> References: , <5310C67D.7040901@vmware.com> MIME-Version: 1.0 X-OriginalArrivalTime: 28 Feb 2014 17:49:47.0671 (UTC) FILETIME=[78BD9270:01CF34AD] X-Pg-Spam-Score: -1.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 --_5d561c7e-6ea8-4338-af89-cc8970696d85_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks for the info Heikki. However=2C my concern is the fact that the same= insert when ran inside PgAdmin executes at 2000 inserts per second whereas= through ODBC it is at 625 inserts per second. It seems that if uuid_genera= te_v1() was the only bottleneck it would occur inside PgAdmin. Same informa= tion=2C same uuid_generate_v1() default. Any thoughts on why the performanc= e difference between the two? - Jeremy > Date: Fri=2C 28 Feb 2014 19:25:17 +0200 > From: hlinnakangas@vmware.com > To: consolity@outlook.com > CC: pgsql-bugs@postgresql.org=3B pgsql-odbc@postgresql.org > Subject: Re: [ODBC] UUID=2C UUID-OSSP extension=2C and ODBC issue >=20 > On 02/28/2014 06:31 PM=2C Jeremy Thornton wrote: > > ODBC: pgsql 09.03.0200=3BOS: Windows 8.1 Pro=3BPostgres version: 9.3.3= =3B > > 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 i= n > > the insert transaction we can increase it to 1500 inserts per seco= nd > > 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 usi= ng a script through PgAdmin then it can generate at near 2000 inserts per s= econd so > > uuid-ossp shouldn't be the problem since it can keep up inside PgA= dmin=2C but when > > used over default settings in ODBC it is 2/3 slower. The data bein= g > > tested is the same in all cases. I am using a default System DSN o= n > > Windows 8.1 Pro (no special settings). Is this a bug=2C expected b= ehavior=2C or a settings > > adjustment that needs to be made? >=20 > I doubt this is an ODBC issue. I'm guessing that uuid_generate_v1() is=20 > simply quite slow. >=20 > The upcoming PostgreSQL 9.4 will contain a new method for generating=20 > UUIDs: the pgcrypto contrib module will include a gen_random_uuid()=20 > function=2C which creates v4 random UUIDs. In a quick test=2C that's a lo= t=20 > faster than the UUID-OSSP based functions. >=20 > If you need it bad enough and can't wait for 9.4=2C you could extract tha= t=20 > into a stand-alone module for older version. It's not a lot of code. Or=20 > you could implement such a function in PL/pgSQL using pgcrypto's=20 > get_random_bytes() function. >=20 > - Heikki = --_5d561c7e-6ea8-4338-af89-cc8970696d85_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks for the info Heikki. Howe= ver=2C my concern is the fact that the same insert when ran inside PgAdmin = executes at 2000 inserts per second whereas through ODBC it is at 625 inser= ts per second. It seems that if uuid_generate_v1() was the only bottleneck = it would occur inside PgAdmin. Same information=2C same uuid_generate_v1() = default. Any thoughts on why the performance difference between the two?
- Jeremy

>=3B Date: Fri=2C 28 Feb 2014 19:25= :17 +0200
>=3B From: hlinnakangas@vmware.com
>=3B To: consolity@o= utlook.com
>=3B CC: pgsql-bugs@postgresql.org=3B pgsql-odbc@postgresql= .org
>=3B Subject: Re: [ODBC] UUID=2C UUID-OSSP extension=2C and ODBC = issue
>=3B
>=3B On 02/28/2014 06:31 PM=2C Jeremy Thornton wrote:=
>=3B >=3B ODBC: pgsql 09.03.0200=3BOS: Windows 8.1 Pro=3BPostgres v= ersion: 9.3.3=3B
>=3B >=3B In using pgsqlODBC 09.03.0200
>=3B &= gt=3B or any version prior that we have tested we seem to be having = a
>=3B >=3B performance decrease to only 625 inserts per seco= nd when
>=3B >=3B using UUID as the primary key and using the U= UID-OSSP to generate
>=3B >=3B the default value of uuid_genera= te_v1() whereas if we generate the
>=3B >=3B UUID client side f= or the primary key and send it with the values in
>=3B >=3B the= insert transaction we can increase it to 1500 inserts per second
>=3B= >=3B bypassing the UUID-OSSP extension. This is consistent and
&= gt=3B >=3B repeatable. The only change being made is Postgres genera= ting the
>=3B >=3B UUID using the extension or us passing the v= alue in the insert
>=3B >=3B statement. If Postgres generates i= t internally while inserting using a script through PgAdmin then it can gen= erate at near 2000 inserts per second so
>=3B >=3B uuid-ossp sh= ouldn't be the problem since it can keep up inside PgAdmin=2C but when
&= gt=3B >=3B used over default settings in ODBC it is 2/3 slower. The = data being
>=3B >=3B tested is the same in all cases. I am usin= g a default System DSN on
>=3B >=3B Windows 8.1 Pro (no special= settings). Is this a bug=2C expected behavior=2C or a settings
>=3B &= gt=3B adjustment that needs to be made?
>=3B
>=3B I doubt t= his is an ODBC issue. I'm guessing that uuid_generate_v1() is
>=3B si= mply quite slow.
>=3B
>=3B The upcoming PostgreSQL 9.4 will cont= ain a new method for generating
>=3B UUIDs: the pgcrypto contrib modu= le will include a gen_random_uuid()
>=3B function=2C which creates v4= random UUIDs. In a quick test=2C that's a lot
>=3B faster than the U= UID-OSSP based functions.
>=3B
>=3B If you need it bad enough an= d can't wait for 9.4=2C you could extract that
>=3B into a stand-alon= e module for older version. It's not a lot of code. Or
>=3B you could= implement such a function in PL/pgSQL using pgcrypto's
>=3B get_rand= om_bytes() function.
>=3B
>=3B - Heikki
= = --_5d561c7e-6ea8-4338-af89-cc8970696d85_--