Feb 06 2023 07:24 AM
I was reading this article from MSDN but I didn't found the difference between using:
OPTION(OPTIMIZE FOR (@dtini UNKNOWN, @dtfim UNKNOWN))
OR
OPTION(OPTIMIZE FOR (@dtini = '2023-01-06', @dtfim = '2023-01-06'))
How SQL gonna works in each case?
In some cases my range of data will return 1kk and other time will return 200 rows. Not always my first execution plan will be the best for differents parameters. Now my problem is with high CPU.
Feb 18 2023 10:20 AM