What's the use of key when you build a table in Wordpress/emlog?

Source: Internet
Author: User
CREATE TABLE $wpdb->blogs (blog_id bigint () not NULL auto_increment, site_id bigint (+) NOT null default ' 0 ', Dom Ain varchar (+) NOT null default ' ', path varchar (+) NOT null default ' ', registered datetime NOT NULL default ' 0000-  00-00 00:00:00 ', last_updated datetime NOT NULL default ' 0000-00-00 00:00:00 ', Public tinyint (2) NOT null default ' 1 ',  Archived tinyint (2) NOT null default ' 0 ', mature tinyint (2) is not null default ' 0 ', spam tinyint (2) is not null default ' 0 ', Deleted tinyint (2) NOT null default ' 0 ', lang_id Int (one) not null default ' 0 ', PRIMARY key (blog_id), key domain (DOM Ain (+), path (5)), KEY lang_id (lang_id)) $charset _collate;   CREATE TABLE {$db _prefix}reply (id int (TEN) unsigned not NULL auto_increment, Tid int (ten) unsigned NOT null default ' 0 ', Date bigint NOT NULL, name varchar (+) NOT null default ' ', content text not NULL, hide enum (' n ', ' Y ') is not null de Fault ' n ', IP varchar (+) not NULL default ' ', PRIMARY key (ID), key gid (TID), KEY Hide (hide) 

What does it mean, especially in the latter section of the code KEY gid (tid) ?

Reply content:

CREATE TABLE $wpdb->blogs (blog_id bigint () not NULL auto_increment, site_id bigint (+) NOT null default ' 0 ', Dom Ain varchar (+) NOT null default ' ', path varchar (+) NOT null default ' ', registered datetime NOT NULL default ' 0000-  00-00 00:00:00 ', last_updated datetime NOT NULL default ' 0000-00-00 00:00:00 ', Public tinyint (2) NOT null default ' 1 ',  Archived tinyint (2) NOT null default ' 0 ', mature tinyint (2) is not null default ' 0 ', spam tinyint (2) is not null default ' 0 ', Deleted tinyint (2) NOT null default ' 0 ', lang_id Int (one) not null default ' 0 ', PRIMARY key (blog_id), key domain (DOM Ain (+), path (5)), KEY lang_id (lang_id)) $charset _collate;   CREATE TABLE {$db _prefix}reply (id int (TEN) unsigned not NULL auto_increment, Tid int (ten) unsigned NOT null default ' 0 ', Date bigint NOT NULL, name varchar (+) NOT null default ' ', content text not NULL, hide enum (' n ', ' Y ') is not null de Fault ' n ', IP varchar (+) not NULL default ' ', PRIMARY key (ID), key gid (TID), KEY Hide (hide) 

What does it mean, especially in the latter section of the code KEY gid (tid) ?

From http://m.blog.csdn.net/article/details?id=51778816
Key (Sid,tid) represents the Federated primary key, and the whole of the two fields is unique

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.