Bug #93827 dict_index_has_desc() is not efficient

Submitted: 7 Jan 2019 4:45 Modified: 8 Jan 2019 13:35
Reporter: zhai weixiang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[7 Jan 2019 4:45] zhai weixiang
Description:
In function dict_index_has_desc, it will check user defined columns on index until it found a desc column. and will check all if there's no descending column. This is not efficient (especailly when change buffer is frequently used) ,  actually we don't need to check it every time because the attribute is only changed when modifying index... 

How to repeat:
Read the code 

Suggested fix:
Add a flag to dict_index_t which indicates if it's descending index, and update it while loading index or altering index.
[8 Jan 2019 13:35] MySQL Verification Team
Hi,

I actually fully agree with your analysis and find that this is a useful performance bug.

Verified as reported.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.037 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.