Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 38759650101 for ; Mon, 11 Aug 2008 07:17:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17431-09 for ; Mon, 11 Aug 2008 07:17:32 -0300 (ADT) X-Greylist: delayed 00:10:09.7206 by SQLgrey-1.7.6 Received: from smtp.alibaba-inc.com (smtp.alibaba-inc.com [121.0.17.65]) by postgresql.org (Postfix) with ESMTP id A713D650040 for ; Mon, 11 Aug 2008 07:17:35 -0300 (ADT) X-IronPort-AV: E=Sophos;i="4.31,341,1215360000"; d="scan'208";a="25431104" From: "jay" To: "'Jay'" , References: <9e3be050-8b96-45d9-9bf3-b333bdee0405@i24g2000prf.googlegroups.com> Subject: =?gb2312?B?tPC4tDogW1BFUkZPUk1dIFVzaW5nIFBLIHZhbHVlIGFzIGEgU3RyaW5n?= Date: Mon, 11 Aug 2008 18:05:11 +0800 Message-ID: <008b01c8fb99$bddb67e0$4344000a@hz.ali.com> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <9e3be050-8b96-45d9-9bf3-b333bdee0405@i24g2000prf.googlegroups.com> Thread-Index: Acj7iPoXw5R2C3QtQ72tGxO+e1pQlwAECqTg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.5 tagged_above=0 required=5 tests=NORMAL_HTTP_TO_IP=0.001, WEIRD_PORT=1.499 X-Spam-Level: * X-Archive-Number: 200808/101 X-Sequence-Number: 30982 If UserID just be unique internal key and the unique id of other tables, = I'd like sequence, which is unique and just use 8 bytes(bigint) When it = querying other tables, it will faster , and disk space smaller than UUID(40 = bytes). =C4=AA=BD=A8=CF=E9=09 =B0=A2=C0=EF=B0=CD=B0=CD=C8=ED=BC=FE(=C9=CF=BA=A3)=D3=D0=CF=DE=B9=AB=CB=BE= =D1=D0=B7=A2=D6=D0=D0=C4=A3=ADIM=B7=FE=CE=F1=B6=CB=BF=AA=B7=A2=B2=BF=20 =C1=AA=CF=B5=B7=BD=CA=BD:86-0571-85022088-13072 =C3=B3=D2=D7=CD=A8ID:jaymo =CC=D4=B1=A6ID:jackem =B9=AB=CB=BE=CD=F8=D5=BE:www.alisoft.com wiki:http://10.0.32.21:1688/confluence/pages/viewpage.action?pageId=3D103= 38 -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] =B4=FA=B1=ED Jay =B7=A2=CB=CD=CA=B1=BC=E4: 2008=C4=EA8=D4=C211=C8=D5 15:35 =CA=D5=BC=FE=C8=CB: pgsql-performance@postgresql.org =D6=F7=CC=E2: [PERFORM] Using PK value as a String I have a table named table_Users: CREATE TABLE table_Users ( UserID character(40) NOT NULL default '', Username varchar(256) NOT NULL default '', Email varchar(256) NOT NULL default '' etc... ); The UserID is a character(40) and is generated using UUID function. We started making making other tables and ended up not really using UserID, but instead using Username as the unique identifier for the other tables. Now, we pass and insert the Username to for discussions, wikis, etc, for all the modules we have developed. I was wondering if it would be a performance improvement to use the 40 Character UserID instead of Username when querying the other tables, or if we should change the UserID to a serial value and use that to query the other tables. Or just keep the way things are because it doesn't really make much a difference. We are still in development and its about half done, but if there is going to be performance issues because using PK as a String value, we can just take a day change it before any production as been started. Anyway advice you can give would be much appreciated. Postgres performance guru where are you? --=20 Sent via pgsql-performance mailing list = (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance