Re: "Keys should not both be set for column..."

2006-09-30 Thread Pat Adams
On Sat, 2006-09-30 at 12:51 -0700, Brian Dunning wrote:
> phpMyAdmin is giving me the following warning:
> PRIMARY and INDEX keys should not both be set for column `referer`
> 
> Here is what the table looks like:
> CREATE TABLE `myspacemap_visitors_2` (
>`creation` timestamp NOT NULL default CURRENT_TIMESTAMP on update  
> CURRENT_TIMESTAMP,
>`lat` double NOT NULL default '0',
>`lon` double NOT NULL default '0',
>`referer` int(12) NOT NULL default '0',
>PRIMARY KEY  (`referer`,`lat`,`lon`),
>KEY `creation` (`creation`,`referer`),
>KEY `referer` (`referer`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
> 
> 
> What does this warning mean, and should I do anything about it or  
> just ignore it? Everything is working fine.

MySQL is trying to tell you that you've got the same index defined
twice. Since the leftmost column in your primary key is referer, you do
not need it as its own index.

-- 
Pat Adams
Digital Darkness Promotions
Check out the Dallas Music Wiki http://digitaldarkness.com


signature.asc
Description: This is a digitally signed message part


"Keys should not both be set for column..."

2006-09-30 Thread Brian Dunning

phpMyAdmin is giving me the following warning:
PRIMARY and INDEX keys should not both be set for column `referer`

Here is what the table looks like:
CREATE TABLE `myspacemap_visitors_2` (
  `creation` timestamp NOT NULL default CURRENT_TIMESTAMP on update  
CURRENT_TIMESTAMP,

  `lat` double NOT NULL default '0',
  `lon` double NOT NULL default '0',
  `referer` int(12) NOT NULL default '0',
  PRIMARY KEY  (`referer`,`lat`,`lon`),
  KEY `creation` (`creation`,`referer`),
  KEY `referer` (`referer`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


What does this warning mean, and should I do anything about it or  
just ignore it? Everything is working fine.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]