{"id":302,"date":"2016-08-07T03:45:59","date_gmt":"2016-08-07T00:45:59","guid":{"rendered":"https:\/\/community.virtono.com\/?p=302"},"modified":"2023-06-21T09:13:14","modified_gmt":"2023-06-21T06:13:14","slug":"how-to-create-an-index","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-an-index\/","title":{"rendered":"How to create an Index"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-an-index\/#This_article_is_a_fraction_of_a_Number_of_Articles_on_MySQL_to_access_them_click_here\" title=\"This article is a fraction of a Number of Articles on MySQL, to access them click here.\">This article is a fraction of a Number of Articles on MySQL, to access them click here.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-an-index\/#SQL_CREATE_INDEX_Syntax\" title=\"SQL CREATE INDEX Syntax\">SQL CREATE INDEX Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-an-index\/#SQL_CREATE_UNIQUE_INDEX_Syntax\" title=\"SQL CREATE UNIQUE INDEX Syntax\">SQL CREATE UNIQUE INDEX Syntax<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-an-index\/#CREATE_INDEX_Example\" title=\"CREATE INDEX Example\">CREATE INDEX Example<\/a><\/li><\/ul><\/nav><\/div>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"This_article_is_a_fraction_of_a_Number_of_Articles_on_MySQL_to_access_them_click_here\"><\/span>This article is a fraction of a Number of Articles on MySQL, to access them click <a href=\"https:\/\/virtono.com\/community\/knowledgebase\/articles-on-mysql\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"SQL_CREATE_INDEX_Syntax\"><\/span>SQL CREATE INDEX Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Creates an index on a table. Duplicate values are allowed:<\/p>\n<p>CREATE INDEX index_name<br \/>\nON table_name (column_name)<\/p>\n<h3><span class=\"ez-toc-section\" id=\"SQL_CREATE_UNIQUE_INDEX_Syntax\"><\/span>SQL CREATE UNIQUE INDEX Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Creates a unique index on a table. Duplicate values are not allowed:<\/p>\n<p>CREATE UNIQUE INDEX index_name<br \/>\nON table_name (column_name)<\/p>\n<p><strong>Note:<\/strong>\u00a0The syntax for creating indexes varies amongst different databases. Therefore: Check the syntax for creating indexes in your database.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"CREATE_INDEX_Example\"><\/span><strong>CREATE INDEX Example<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The SQL statement below creates an index named &#8220;PIndex&#8221; on the &#8220;LastName&#8221; column in the &#8220;Persons&#8221; table:<\/p>\n<p>CREATE INDEX PIndex<br \/>\nON Persons (LastName)<\/p>\n<p>If you want to create an index on a combination of columns, you can list the column names within the parentheses, separated by commas:<\/p>\n<p>CREATE INDEX PIndex<br \/>\nON Persons (LastName, FirstName)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a fraction of a Number of Articles on MySQL, to access them click here. SQL CREATE INDEX Syntax Creates an index on a table. Duplicate values are allowed: CREATE INDEX index_name ON table_name (column_name) SQL CREATE UNIQUE INDEX Syntax Creates a unique index on a table. Duplicate<\/p>\n","protected":false},"author":3,"featured_media":303,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[],"class_list":["post-302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-4.png?fit=731%2C266&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-4S","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":297,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/mysql-indexing\/","url_meta":{"origin":302,"position":0},"title":"MySQL Indexing","author":"Daniel Draga","date":"August 7, 2016","format":false,"excerpt":"This article is a fraction of a Number of Articles on MySQL, to access them click here. MySQL Indexing \u00a0 MySQL documentation says: The best way to improve the performance of SELECT operations is to create indexes on one or more of the columns that are tested in the query.\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-3.png?fit=715%2C262&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-3.png?fit=715%2C262&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-3.png?fit=715%2C262&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-3.png?fit=715%2C262&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":294,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/mysql-performance-tuning-the-stages-of-tuning\/","url_meta":{"origin":302,"position":1},"title":"MySQL Performance Tuning: The stages of Tuning","author":"Daniel Draga","date":"August 7, 2016","format":false,"excerpt":"This article is a fraction of a Number of Articles on MySQL, to access them click here. Why Tune a Database? Cost-effectiveness A system that is tuned can minimize the need to buy additional hardware and other resources to meet the needs of the end users. Tuning may demonstrate that\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3746,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-create-a-user-and-grant-permissions-in-mysql\/","url_meta":{"origin":302,"position":2},"title":"How to create a user and grant permissions in MySQL","author":"George B.","date":"August 17, 2023","format":false,"excerpt":"Managing users is an integral part of database administration. It involves adding new users, giving them access, and, if necessary, deleting them. In this tutorial, we'll examine MySQL's user management procedure, which makes it the most widely used relational database management system available as open-source software. Creating a New User\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Create-a-user-and-grant-permissions-in-MySQL.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3195,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/install-elasticsearch-with-kibana-and-logstash-on-ubuntu\/","url_meta":{"origin":302,"position":3},"title":"Install Elasticsearch with Kibana and Logstash on Ubuntu","author":"George B.","date":"April 9, 2023","format":false,"excerpt":"Elasticsearch is an open-source, distributed search and analytics engine that is designed to handle large amounts of data. It is built on top of the Apache Lucene search engine library and is part of the Elastic Stack (formerly known as the ELK Stack), which includes Kibana and Logstash. It comes\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Elasticsearch-with-Kibana-and-Logstash-on-Ubuntu.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Elasticsearch-with-Kibana-and-Logstash-on-Ubuntu.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Elasticsearch-with-Kibana-and-Logstash-on-Ubuntu.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":338,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/articles-on-mysql\/","url_meta":{"origin":302,"position":4},"title":"Articles on MySQL","author":"Daniel Draga","date":"August 7, 2016","format":false,"excerpt":"MySQL:\u00a0 Introduction and How it Works MySQL Installation MySQL replication The Top MySQL 10 Design Tips MySQL Performance Tuning: The stages of Tuning MySQL Indexing How to create an index How MySQL and PHP Work Together How to handle MySQL errors Constraints in SQL and How to Specify Them","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL-Foreign-Key-EXAMPLE-2-1.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL-Foreign-Key-EXAMPLE-2-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL-Foreign-Key-EXAMPLE-2-1.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL-Foreign-Key-EXAMPLE-2-1.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL-Foreign-Key-EXAMPLE-2-1.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2711,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-find-and-replace-in-phpmyadmin\/","url_meta":{"origin":302,"position":5},"title":"How to Find and replace in phpMyAdmin","author":"George B.","date":"June 24, 2022","format":false,"excerpt":"Find and replace in phpMyAdmin Start by logging into cPanel 1. Next, choose phpMyAdmin. 2. Next, choose the Database you want to use the search and replace function. 3. You will find on the left side all the tables of your MySQL database. Click on the table you wish to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/06\/PhpMyAdmin-Logo.wine_.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/06\/PhpMyAdmin-Logo.wine_.png?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/06\/PhpMyAdmin-Logo.wine_.png?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/06\/PhpMyAdmin-Logo.wine_.png?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/06\/PhpMyAdmin-Logo.wine_.png?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":3,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":3532,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/302\/revisions\/3532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/303"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}