populate hash for unique text with trigger?
Ok, so I [see][1] that this the wrong approach:

    mysql> 
    mysql> show tables;
    +---------------------+
    | Tables_in_nntp      |
    +---------------------+
    | articles            |
    | newsgroups          |
    | newsgroups_articles |
    +---------------------+
    3 rows in set (0.00 sec)
    
    mysql> describe newsgroups;
    +-----------+----------+------+-----+---------+----------------+
    | Field     | Type     | Null | Key | Default | Extra          |
    +-----------+----------+------+-----+---------+----------------+
    | id        | int(11)  | NO   | PRI | NULL    | auto_increment |
    | newsgroup | longtext | NO   |     | NULL    |                |
    +-----------+----------+------+-----+---------+----------------+
    2 rows in set (0.00 sec)
    
    mysql> show create table newsgroups;
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table      | Create Table                                                                                                                                                                      |
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | newsgroups | CREATE TABLE `newsgroups` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `newsgroup` longtext NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 |
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> ALTER TABLE newsgroups ADD UNIQUE (newsgroup);
    ERROR 1170 (42000): BLOB/TEXT column 'newsgroup' used in key specification without a key length
    mysql> 


now, if I make this a hash, **how do I populate it**?  With a [trigger][2]?  and then make the hash unique?


now, should the **hash** perhaps be the primary key, or just leave the PK alone?


  [1]: http://stackoverflow.com/a/4744926/262852
  [2]: http://stackoverflow.com/a/11024249/262852
populate hash for unique text with trigger?
===

Ok, so I [see][1] that this the wrong approach:

    mysql> 
    mysql> show tables;
    +---------------------+
    | Tables_in_nntp      |
    +---------------------+
    | articles            |
    | newsgroups          |
    | newsgroups_articles |
    +---------------------+
    3 rows in set (0.00 sec)
    
    mysql> describe newsgroups;
    +-----------+----------+------+-----+---------+----------------+
    | Field     | Type     | Null | Key | Default | Extra          |
    +-----------+----------+------+-----+---------+----------------+
    | id        | int(11)  | NO   | PRI | NULL    | auto_increment |
    | newsgroup | longtext | NO   |     | NULL    |                |
    +-----------+----------+------+-----+---------+----------------+
    2 rows in set (0.00 sec)
    
    mysql> show create table newsgroups;
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table      | Create Table                                                                                                                                                                      |
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | newsgroups | CREATE TABLE `newsgroups` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `newsgroup` longtext NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 |
    +------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> ALTER TABLE newsgroups ADD UNIQUE (newsgroup);
    ERROR 1170 (42000): BLOB/TEXT column 'newsgroup' used in key specification without a key length
    mysql> 


now, if I make this a hash, **how do I populate it**?  With a [trigger][2]?  and then make the hash unique?


now, should the **hash** perhaps be the primary key, or just leave the PK alone?


  [1]: http://stackoverflow.com/a/4744926/262852
  [2]: http://stackoverflow.com/a/11024249/262852