Simplify database query when looking up an alias