[tpop3d-discuss] primary keys too short

Chris Elsworth chris at shagged.org
Sun, 5 Aug 2001 16:34:53 +0100


On Sun, Aug 05, 2001 at 05:32:46PM +0200, Marcin Sochacki wrote:

> In db/init-db.sql for vmail-sql-0.4 I've found, the following SQL code:
> 
> # local POP boxes (virtual)
> create table popbox (
>         domain_name varchar(255) not null,      # domain this refers to
>         local_part varchar(255) not null,       # username for this POP box
>         password_hash varchar(255),             # hash of this user's password
>         mbox_name varchar(255),                 # appended to domain.path
>         primary key (domain_name(8), local_part(8))
> ) ;
> 
> What are those keys used for, anyway? In previous versions they were
> unavailable and everything seemed to work ok.

MySQL keys are used for indexed lookups - they make queries faster. 
They're not needed, just helpful. You could get rid of it completely and 
the entire thing would still work - you wouldn't notice the performance 
loss unless you're under really heavy load, either.

-- 
Chris Elsworth  -  Software & Systems Developer  /  Systems Administrator 
girls = time x money (and time is money)         .       chrise@demon.net
      = money^2 (money is root of all evil)     . .    tel: 020 8371 1041 
      = _/(evil^2) = evil                   t h u s    mob: 07968 324 693