{"id":39,"date":"2006-08-31T17:15:13","date_gmt":"2006-08-31T17:15:13","guid":{"rendered":"http:\/\/thenoyes.com\/littlenoise\/?p=39"},"modified":"2006-08-31T17:17:33","modified_gmt":"2006-08-31T17:17:33","slug":"auto_increment-indexing","status":"publish","type":"post","link":"https:\/\/thenoyes.com\/littlenoise\/?p=39","title":{"rendered":"Auto_increment Indexing"},"content":{"rendered":"<p>It&#8217;s so common to set the auto_increment column to primary key, it has become common belief that it&#8217;s required. Not true; an auto_increment column can use any index type. It doesn&#8217;t even have to be unique:<\/p>\n<pre>CREATE TABLE testTable (\r\n  id INT AUTO_INCREMENT,\r\n  INDEX(id)\r\n) ENGINE=MyISAM; -- Works for InnoDB too.\r\n\r\nINSERT INTO testTable VALUES (1), (1), (NULL);\r\n\r\nSELECT * FROM testTable;\r\n\r\n+----+\r\n| id |\r\n+----+\r\n|  1 |\r\n|  1 |\r\n|  2 |\r\n+----+<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s so common to set the auto_increment column to primary key, it has become common belief that it&#8217;s required. Not true; an auto_increment column can use any index type. It doesn&#8217;t even have to be unique: CREATE TABLE testTable ( id INT AUTO_INCREMENT, INDEX(id) ) ENGINE=MyISAM; &#8212; Works for InnoDB too. INSERT INTO testTable VALUES [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[],"class_list":["post-39","post","type-post","status-publish","format-standard","hentry","category-mysql-faq"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2IBF1-D","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":0,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions"}],"wp:attachment":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}