I have built a recursive code, which already run untill termination. The recursive code has resulted around 300.000.000 rows. At that time, it run about 8 hours untill termination.
Yesterday, I tried to run again the code, and it ended after 26 hours. But with exactly the same result.. All correct.
Is that normal? I am thinking, something must be run randomly, so that the comparing between the records sometimes luckily fast, sometimes unluckily slow.
Thank you for your comments for this optimization theme.
Some thoughts, where the conditions equal in both cases. I.e. did you run alone, or did someone else use the server/db/san etc? Where there any change to the data, i.e. is statistics relevant. If you have a plan from the first run you can compare it with the current plan and see if there is a difference