High-available virtual servers
Elastic bare metal computing service
Featured stable and capable
Distribute secure and stable traffic
One-stop E-certificate management
Protect your application from CC and DDoS Attacks
The decimal field size of apsaradb RDS for MySQL is too large and the query cannot be accurate, which is caused by a BUG in the MySQL database.
You can solve the problem by adding an index. The SQL statement for optimization is as follows:
create table mlgtestdecimal(`campaign_id` decimal(24, 0) NOT NULL, name VARCHAR(50));
insert into mlgtestdecimal(campaign_id, name)
VALUES('XXXXXXX','XXXXXX');
insert into mlgtestdecimal(campaign_id, name)
VALUES('XXXXXXX','XXXXXX');
SELECT *
from mlgtestdecimal
where campaign_id='XXXXXXX'
and name='XXXXXX'
alter table mlgtestdecimal add index ind_decimal (`campaign_id`);
ApsaraDB RDS for MySQL
Yisu Cloud Ltd.
E-mail : support@yisu.com
Copyright © Yisu Cloud Ltd. All Rights Reserved. 2022