Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying MariaDB Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
MariaDB Cookbook

MariaDB Cookbook

By : Daniel Bartholomew
4.2 (9)
close
close
MariaDB Cookbook

MariaDB Cookbook

4.2 (9)
By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
close
close
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using extended keys with InnoDB and XtraDB


When creating an execution plan for a query, the MariaDB optimizer makes a cost-based decision about whether or not to use one or more indexes instead of reading through a table row-by-row. Indexes are often, but not always the faster choice. The extended key's optimization improves the index lookups for InnoDB and XtraDB tables.

How to do it...

  1. Launch the mysql command-line client application and connect it to our MariaDB server as the root user or as a user with the SUPER privilege.

  2. Enable the extended keys optimization with the following command:

    SET GLOBAL optimizer_switch='extended_keys=on';
    
  3. Add the following code to our my.cnf or my.ini file (or to an existing [mysqld] section):

    [mysqld]
  4. optimizer_switch = 'extended_keys=on' verifies that extended_keys is set to on with the following command:

    SHOW VARIABLES LIKE 'optimizer_switch'\G
    

How it works...

In this recipe, we turn on the extended_keys optimization globally for the running server and we...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY