Hi All,

        Just a quick question on whether I need both fields to be indexed.

The table is as below.. I'm wondering if I need to have these 2 fields ->
fa_id & serial_no

fa_id would be a 7 character int like "0000001", "0000002"
serial_no would be like "WMACK0000001", "WMACM0000121"

most of the time, we'll be referencing the serial_no more as it's what's
being used most often in my nature of work. Initially I thought that I could
index or make serial_no my primary key but as it's not fully numeric, I'm
not sure if this is advisable.

Can anyone help me out? Do I need the fa_id field? If I were to use mysql to
query for data, most likely I'll be using the Serial_no as the reference and
not fa_id. 

Comments....Thanks.

CREATE TABLE fa_tracker (
  fa_id int(7) unsigned NOT NULL auto_increment,
  serial_no varchar(12) NOT NULL default '',
  dcm varchar(13) NOT NULL default '',
  family_id smallint(3) unsigned NOT NULL default '0',
  dcm_id smallint(3) unsigned NOT NULL default '0',
  media_id smallint(3) unsigned NOT NULL default '0',
  headers enum('1','2','3','4','5','6') default NULL,
  fail_heads enum('0','1','2','3','4','5') default NULL,
  source_id smallint(3) unsigned NOT NULL default '0',
  drive_cat_id smallint(3) unsigned NOT NULL default '0',
  drive_fa text NOT NULL,
  hm_cat_id smallint(3) unsigned NOT NULL default '0',
  hm_fa text NOT NULL,
  supplier_cat_id smallint(3) unsigned NOT NULL default '0',
  supplier_as_lab_fa text NOT NULL,
  date_submitted datetime NOT NULL default '1970-01-01 00:00:01',
  date_received datetime NOT NULL default '1970-01-01 00:00:01',
  date_sent datetime NOT NULL default '1970-01-01 00:00:01',
  dept_id smallint(3) unsigned NOT NULL default '0',
  user_id int(7) unsigned NOT NULL default '0',
  PRIMARY KEY  (fa_id),
  UNIQUE KEY serial_no (serial_no)
) 



Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168

Reply via email to