1

I am peformance-testing queries and alternative schemas in an SQL Compact database. I can very easily observe the repeated execution performance of particular queries; however, I also need a way to accurately measure the first-time execution performance. To do so, I think I should clear the query cache from the database.

This question has been asked multiple times before for standard SQL Server:

Or there's always the WITH RECOMPILE option.

However, none of these options appear to have support in the SQL CE world.

I am accessing the database via a C# application, using the SqlCeCommand class, so I am looking for either a code hack or an SQL command to clear the execution plan cache from the database between calls.

Community
  • 1
  • 1
nicholas
  • 2,969
  • 20
  • 39

1 Answers1

1

There is no execution plan cache between calls, but the first access to the database will load the database file, and the engine dll files into memory from disk, and this is costly.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115