I have around 250 content types for a total of 2000 nodes. What I have to do is finding a clone of each node and display those related clones below the node page in a block (just their titles).
So I'm finding clones on basis of same term reference field value.
For example, for the node with an ID of 6783, there is a field of type term reference (tags). This tag field contains 15 target IDs.
Now I will search all other 199999 nodes; if any node has exactly the same target IDs found in that particular tag field**, I will make all those titles populated below /node/6783.
I need to check on three stages: On first stage, check for all the nodes with the same target IDs; on second stage, check for 90% cloning, meaning looking for the nodes that have 90% of the target IDs; on third stage, check for 80% cloning.
If I will search 2000 nodes, it will exceed the query execution time limit.
What would be the best approach so that it will not affect the performance of website too.