pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jay <jackem.mojx@alibaba-inc.com>
To: 'Jay' <arrival123@gmail.com>
To: pgsql-performance@postgresql.org
Subject: 答复: [PERFORM] Using PK value as a String
Date: Mon, 11 Aug 2008 18:05:11 +0800
Message-ID: <008b01c8fb99$bddb67e0$4344000a@hz.ali.com> (raw)
In-Reply-To: <9e3be050-8b96-45d9-9bf3-b333bdee0405@i24g2000prf.googlegroups.com>
References: <9e3be050-8b96-45d9-9bf3-b333bdee0405@i24g2000prf.googlegroups.com>

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).

	 莫建祥	
阿里巴巴软件(上海)有限公司
研发中心-IM服务端开发部 
联系方式:86-0571-85022088-13072
贸易通ID:jaymo 淘宝ID:jackem
公司网站:www.alisoft.com
wiki:http://10.0.32.21:1688/confluence/pages/viewpage.action?pageId=10338

-----邮件原件-----
发件人: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] 代表 Jay
发送时间: 2008年8月11日 15:35
收件人: pgsql-performance@postgresql.org
主题: [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?

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




Message-ID: <008b01c8fb99$bddb67e0$4344000a@hz.ali.com>
Permalink:  ../008b01c8fb99$bddb67e0$4344000a@hz.ali.com/
Also on:    postgresql.org/message-id/008b01c8fb99$bddb67e0$4344000a@hz.ali.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jackem.mojx@alibaba-inc.com, arrival123@gmail.com
  Subject: Re: 答复: [PERFORM] Using PK value as a String
  In-Reply-To: <008b01c8fb99$bddb67e0$4344000a@hz.ali.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