Re: Index

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Sat, 20 Jul 2019 04:57:47 +0100
Message-ID: <qgu3fs$7ro$1_at_dont-email.me>


[Quoted] On 19/07/2019 22:25, mmmmvh_at_gmail.com wrote:
> Good evening.
>
> This query
>
> select * from table where name = "Erick" and month = "10"
>
> Is it faster if I have an index to name and another index to month?
> Is it more convenient to have a single index (name, month)?
>
> Thanks.
>
easy answer.

Try each combination.

Reboot mysqld between changes to ensure no cached queries.

My limited experience is that indices always improve searches on 'where' clauses, and the downside is speed of insertion, but many applications are 'write once/read many', so thats a optimal tradeoff.

-- 
The New Left are the people they warned you about.
Received on Sat Jul 20 2019 - 05:57:47 CEST

Original text of this message