Reading many other posts, my understanding is that when you set the Optimizer settings to keep optmiized data up to date as of the start of every query, if you have a good base .OPT file, it should do the work for you of keeping up the Optimizer where needed.
I tested this with
SELECT sum(amountdue) from bill where vendorreffullname like 'L%' and ispaid = false
made a change to one record in the SELECT results in Qbooks
Re-connected with VBdemo, and ran it again, seeing the change. I assume at that point it updated the .OPT table.
Then I repeat the query with NOSYNC:
SELECT sum(amountdue) from bill NOSYNC where vendorreffullname like 'L%' and ispaid = false
The change is not reflected. Further, when I list the records with
SELECT vendorrefullname, amountdue from bill NOSYNC where vendorreffullname like 'L%' and ispaid = false
It lists the name, but the amount field is blank.
This isn't what I expected. I thought the optimizer was updated with the unqualified SELECT, so subsequent NOSYNC selects would include the most recent data.
SP_OptimizeUpdateSync does solve the problem, so I guess it's best to put that in your code if you are wishing the query speed of NOSYNC?
Where is it better to use the VERIFY keyword. I've seen that in one of your posts, but don't know when it should be used?
What concept am I missing?
Thank you. |