Using PK value as a String - Mailing list pgsql-performance

From Jay
Subject Using PK value as a String
Date
Msg-id 9e3be050-8b96-45d9-9bf3-b333bdee0405@i24g2000prf.googlegroups.com
Whole thread Raw
Responses Re: Using PK value as a String  (Gregory Stark <stark@enterprisedb.com>)
答复: [PERFORM] Using PK value as a String  ("jay" <jackem.mojx@alibaba-inc.com>)
List pgsql-performance
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?

pgsql-performance by date:

Previous
From: "Sabin Coanda"
Date:
Subject: Re: long transaction
Next
From: Henrik
Date:
Subject: Re: Filesystem benchmarking for pg 8.3.3 server