Sublime directory Surf the web anonymous Pagerank Monitor


UNIQUE and INDEX keys should not both be set for column ...

olaf
Fri 28 July 2006, 03:42 pm GMT +0200
Hello,

I have a table with the domain tld as key and the unique key to prevent double entries.

but phpmyadmin (and maybe also mysql) is giving this warning:

UNIQUE and INDEX keys should not both be set for column `tld`

why? it works well (I think)

Nikolas
Fri 28 July 2006, 03:47 pm GMT +0200
This is because a UNIQUE key is actually an extension to a INDEX.

In other words it is an index that doesn't allow the same records to reappear.

olaf
Fri 28 July 2006, 03:53 pm GMT +0200
This is because a UNIQUE key is actually an extension to a INDEX.

In other words it is an index that doesn't allow the same records to reappear.
that will say the index key is enough to prevent double values?

Nikolas
Fri 28 July 2006, 04:55 pm GMT +0200
No. The unique key is for that, but both are indexing the table.

olaf
Fri 28 July 2006, 07:32 pm GMT +0200
that will say I have to use them both and I have to ignore the warning...

Nikolas
Sat 29 July 2006, 01:04 am GMT +0200
No. You only need a unique, because a unique index is still an index.

By having them both you will not have better performance, and the table will get more HD space.

olaf
Sat 29 July 2006, 01:08 am GMT +0200
No. You only need a unique, because a unique index is still an index.

By having them both you will not have better performance, and the table will get more HD space.
Ok, I understand thank you.

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional