Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MySQL 8 Administrator???s Guide

You're reading from   MySQL 8 Administrator???s Guide Effective guide to administering high-performance MySQL 8 solutions

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781788395199
Length 510 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Chintan Mehta Chintan Mehta
Author Profile Icon Chintan Mehta
Chintan Mehta
Hetal Oza Hetal Oza
Author Profile Icon Hetal Oza
Hetal Oza
Subhash Shah Subhash Shah
Author Profile Icon Subhash Shah
Subhash Shah
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. An Introduction to MYSQL 8 FREE CHAPTER 2. Installing and Upgrading MySQL 8 3. MySQL 8 – Using Programs and Utilities 4. MySQL 8 Data Types 5. MySQL 8 Database Management 6. MySQL 8 Storage Engines 7. Indexing in MySQL 8 8. Replication in MySQL 8 9. Partitioning in MySQL 8 10. MySQL 8 – Scalability and High Availability 11. MySQL 8 – Security 12. Optimizing MySQL 8 13. Extending MySQL 8 14. MySQL 8 Best Practices and Benchmarking 15. Troubleshooting MySQL 8 16. Other Books You May Enjoy

Index extension

Index extension is the feature by which MySQL 8 extends a secondary index by appending the primary key. The InnoDB engine automatically extends a secondary index if it is required. To control the behavior of index extensions, MySQL 8 has defined a use_index_extensions flag in the optimizer_switch system variable. By default, this option is enabled, but the user is allowed to change it at runtime by using the following command:

SET optimizer_switch = 'use_index_extensions=off';

Let's look at one example to understand the index extension in detail. Let's create a table and insert the following values:

CREATE TABLE table1 (
c1 INT NOT NULL DEFAULT 0,
c2 INT NOT NULL DEFAULT 0,
d1 DATE DEFAULT NULL,
PRIMARY KEY (c1, c2),
INDEX key1 (d1)
) ENGINE = InnoDB;

--Insert values into table
INSERT INTO table1 VALUES
(1, 1, '1990-01-01'), (1, 2, &apos...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime