The search world is very big :) 5 mil records is nothing if you index logs (which is not Algolia typical use-cases) but for example this is big from an e-commerce perspective.
In term of relevance, we have developed a ranking algorithm specialized on that case that provide better results than traditional approach: http://blog.algolia.com/search-ranking-algorithm-unveiled/
SQL queries are not relevant for text query, for example you have no notion of tokenization or proximity between words.
We plan to write a blog post on limit of SQL based search.