MySQL Forums :: Performance :: Reg table design and query performances


Advanced Search

Re: Reg table design and query performances
Posted by: Øystein Grøvlen ()
Date: April 26, 2016 07:04AM

Øystein Grøvlen Wrote:
-------------------------------------------------------
> For the given query, an index on (value, name) is
> probably be better since then all brokers can
> easily be skipped.

Sorry, forget the above.
An index of (name, value) is of course best since that means that one can split the range scan in two ranges, one for (name='role', value<'broker') and one for (name='role', value>'broker').

Hopefully, the optimizer will pick table b as the first table of the join since the (name, value) index should provide direct lookup on (name, value, user_id) to tables a and c. Due to the in-equality expression, look-ups into b will be less efficient since only the first part of the index can be used.

Sorry for the confusion,

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject Views Written By Posted
Reg table design and query performances 659 Devrishi Shandilya 04/26/2016 03:02AM
Re: Reg table design and query performances 356 Øystein Grøvlen 04/26/2016 06:02AM
Re: Reg table design and query performances 473 Devrishi Shandilya 04/26/2016 06:16AM
Re: Reg table design and query performances 352 Øystein Grøvlen 04/26/2016 06:35AM
Re: Reg table design and query performances 375 Devrishi Shandilya 04/26/2016 06:50AM
Re: Reg table design and query performances 351 Øystein Grøvlen 04/26/2016 07:04AM
Re: Reg table design and query performances 357 Rick James 04/30/2016 11:46PM
Re: Reg table design and query performances 311 Øystein Grøvlen 05/02/2016 01:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.