幫客之家(Bkjia.Com)教程 請教以下MYSQL英文的意思是什麼?
以下為引用的內容:
The automatic index on the primary key takes care of the index required by AUTO_INCREMENT.
最佳答案:
這句話應該是摘自 《PHP and MySQL Web development》 這本書
樓主之把其中一句單獨取出來,讓人很難理解。上下文是這樣的
PRIMARY KEY after a column name specifies that this cloumn is the primary key for the table. Entries in this column have to be unique. MySQL will automatically index this column. Notice that where we've used it above with customerid in the customers table we've used it with AUTO_INCREMENT. The automatic index on the primary key takes care of the index required by AUTO_INCREMENT.
customers 的表結構是這樣的
create table customers
(
customerid int unsigned not null auto_increment primary key,
name char(30) not null,
address char(40) not null,
city char(20) not null
);
從整個上下文的意思來看
這句話應該理解為 主鍵的自動索引可以支持自增長類型的索引。或者直接從字面翻譯就是
主鍵的自動索引已經考慮到(照顧到)了對自增長類型的索引的支持