FBDatabaseMetaData.Clause builds this : "CAST(" + columnName + " AS VARCHAR(" + (OBJECT_NAME_LENGTH + 10) + ")) = ? and ";
Because of the CAST() Firebird does not use index in this case, it reads tables NATURAL.
What is the reason to this strange condition? Index using SQL should be build : columnName + " = ? and ". If you want support special cases, please detect it and use a dedicated SQL for that.