MySQL indexing, different types and when to use them?

Well, that’s why I searched many times regarding MySQL indexes and their importance, and I understand that I have to use it to speed up database queries.

And I know that the syntax adds an index to any filed.

But here is what I don’t understand (I use Heidi SQL for local database management)

I have a table with the following fields

id
company_id
author_id
client_id
project_id
title
description
status
date

Here idit is primary key, auto incrementedand already indexed.

I want to add an index to the company_id, author_id, client_id, project_id, but I have a few different options here (Heidi SQL: select a field, right-click to create a new index) Key, Unique, Full Text,Spatial

() Key , Unique , , Full Text , .

Question 1: Spatial, .

Question 2: : , (, ).

? . / .

.

+4
1

Key. Unique, , , , company_id, ( company_id).

( /), . , , , . , Fulltext MyISAM, INNODB, , - , .

, "" . , , , . , : company_id + id . , .

KEY , . MySQL , , , EXPLAIN. , , .

+4

Source: https://habr.com/ru/post/1541091/


All Articles