We want to try new indexes and compare their performance with old indexes. But following executions after the first execution of a query returns much much faster then the first one.
So for testing these queries and indexes performance, is there any way to disable this mechanism?
Wouldn’t you want to compare the normal execution of the new vs old? Normally execution would have the indexes in-memory. Only the very first execution would be uncached.
I suppose if you wanted to measure the uncached performance, restarting the server before each test would work.
Is there any mechanism to invalidate the cache without a restart? In my environment we do not have access to do a restart like that and much less when there is production traffic reaching the servers
Because the goal is measure the raw performance of the queries without cache in between to see what query performs better for the worst case scenario where the cached data does not exist and the user is accessing the data for the first time
When the data is cached it gives a false sense of performance because it does not account for the cold access that the test is trying to measure