I have a simple but huge table called ‘dictionary’ which has 2 columns. Id and word.
I have a php anagram algorithm tha creates all possible combinations of a given word. I want to chech if that word exists in my dictionary and if yes display it. But i have to use too many queries. For example a 9 letter word is 362880 combinations. Any idea of how to make fewer db calls?
I have a simple but huge table called ‘dictionary’ which has 2 columns. Id
Share
Try something like this for only one query, although I don’t know how efficient such a query will be:
This will generate the SQL query:
The upside is that the query is dynamic, so no matter how many
$possibilitiesthere are, this would theoretically work. For efficiency, I would definitely index thewordcolumn.