MySQL Forums
Forum List  »  Performance

Re: Best Index Strategy
Posted by: Rick James
Date: August 10, 2015 07:02AM

> telephone LIKE '%7600639533%'

If possible, change that to

soas.telephone = '7600639533'
so that you _could_ index that column.

In that case, INDEX(address_type, telephone) would be beneficial.

Don't blindly use VARCHAR(255). Use reasonable, but conservative, lengths.

> `cc_exp_year` varchar(255) DEFAULT NULL COMMENT 'Cc Exp Year',

Is that a "year"? There is a datatype YEAR.

Are you storing Credit card info? I really, really, hope your security is very, very, tight.

> `cc_type` varchar(255) DEFAULT NULL COMMENT 'Cc Type',

Consider ENUM.

> `cc_last4` varchar(255) DEFAULT NULL COMMENT 'Cc Last4',

4 is a lot less than 255.

> KEY `IDX_SALES_FLAT_ORDER_GRID_STATUS` (`status`),

Low cardinality fields are rarely useful to index.

Options: ReplyQuote


Subject
Views
Written By
Posted
2177
August 09, 2015 11:35PM
Re: Best Index Strategy
859
August 10, 2015 07:02AM
813
August 10, 2015 07:17AM
801
August 10, 2015 11:30PM
785
August 12, 2015 10:53PM
781
August 15, 2015 04:34PM
770
August 16, 2015 11:53PM


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.