首页 新闻 会员 周边

这名英语什么意思啊,

0
[已解决问题] 解决于 2009-08-28 21:57

The automatic index on the primary key takes care of the

index required by AUTO_INCREMENT.

pboyin的主页 pboyin | 初学一级 | 园豆:199
提问于:2009-08-25 22:56
< >
分享
最佳答案
0

这句话应该是摘自 《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

);

 

从整个上下文的意思来看

这句话应该理解为 主键的自动索引可以支持自增长类型的索引。或者直接从字面翻译就是

主键的自动索引已经考虑到(照顾到)了对自增长类型的索引的支持

 

 

eaglet | 专家六级 |园豆:17139 | 2009-08-26 08:01
呵呵 eaglet 太专业了,赞,超赞。
winzheng | 园豆:8797 (大侠五级) | 2009-08-26 13:28
呵呵我就是从这本书里弄来的,你好强啊原文都弄上来,同时也谢谢其它几位的热心帮助
pboyin | 园豆:199 (初学一级) | 2009-08-28 21:56
其他回答(3)
0

主键的自动索引的前提是索引字段自增长。

大意是:你要设置主键为自动索引,则必须这个主键是自增长字段,而不能是随机字段。

邀月 | 园豆:25475 (高人七级) | 2009-08-25 23:02
0

主键上自动索引要求是自增的。  探讨一下,没怎么用过MySql,呵呵

winzheng | 园豆:8797 (大侠五级) | 2009-08-25 23:12
0

从楼上的话来看,应该是鉴于自增长的主键的索引需求,会自动在其上建索引。

不能飚车 | 园豆:453 (菜鸟二级) | 2009-08-26 12:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册