@Laraib in general I wouldn't recommend making changes to the appDB. This could cause issues with migrations down the line if the migration makes an assumption that's not true (though indexes are a little less risky than schema changes, etc).
What query is it that you're concerned with improving performance on? Is this related to data replication, behavior within Metabase itself, etc?