@j0va
If you need to get random lines in 1M+ rows table with regex, I recommend to use nosql solution.
For example; You might have a big table and you want to get a random line with user-agent filter. If you do this frequently you see high CPU usage.
Thats why I switched my part of database from Postgresql to Mongo.