Improve table name queries