This comparison is not very fair. Mysql is designed to return all matches while elasticsearch is designed to only return the top matches. For instance in this example, mysql will run the computation on all documents while elasticsearch will only do it on the top matches that are returned (10 by default).
Are you trying to choose between MySQL and Elasticsearch? Honestly, I think there's bigger considerations than whether or not this particular use case is going to be faster/slower.
Choose Elasticsearch if
You're ranking something (ie your formula factors into relevance ranking or some other kind of similarity)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.