Using Regex In Postgresql Query Optimization