Pregunta

Is there a way to force index into cache for InnoDB tables?

The problem is I don't have enough memory to load all indexes into memory, so I want to cache particular ones.

¿Fue útil?

Solución

Loading the primary key (clustered) index:

SELECT COUNT(*) FROM tbl_name

Loading secondary index:

SELECT COUNT(*) FROM tbl_name FORCE INDEX(key_name)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top