go-mysql-server icon indicating copy to clipboard operation
go-mysql-server copied to clipboard

Indexes on tables in non-current database aren't used

Open zachmu opened this issue 5 years ago • 0 comments

This means that joins between tables in two databases are not indexed unless the current DB has an index that can be used. The problem is that every call to the index driver to look up indexes looks like this:

	idx := ctx.IndexByExpression(ctx, ctx.GetCurrentDatabase(), ...)

Instead of using the current database, we need to get the relevant database from the expression being examined. This is a little work, since most qualified nodes only record the table name, not the database.

zachmu avatar May 06 '20 17:05 zachmu