You can provide a certain index for database server to use in some cases. This feature is only supported in MySQL.
const users = await dataSource
.getRepository(User)
.createQueryBuilder("user")
.useIndex("my_index") // name of index
.getMany()