Force index not working in Aurora MySQL 8
1
vote
0
answers
144
views
I have recently upgraded to
Aurora MySQL engine version 8.0.mysql_aurora.3.05.2
from Aurora MySQL 5.7. I see huge performance issue after upgrading. Recently I found that I have queries whose indexes are being ignored and doing full table scan
My orders
table row count is 20 million
Here is the query
select *
from orders
FORCE INDEX (PRIMARY)
where orders
.id
in (/* almost 64000 comma separated ids which are primary keys */)
When I do EXPLAIN
on this it says that it is doing full table scan with `type = ALL
show create table orders
show this
CREATE TABLE orders
(
id
bigint unsigned NOT NULL AUTO_INCREMENT,
... other columns,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=24105494 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
I checked on some blog and put optimizer_switch
to index_condition_pushdown=on
in parameter groups but it doesn't work
How can I force the index it so that query is fast
Asked by Ali Mehdi
(11 rep)
Feb 14, 2024, 01:53 PM
Last activity: Feb 14, 2024, 02:02 PM
Last activity: Feb 14, 2024, 02:02 PM