How can I restore / reorganize my indexes on Sql Compact 3.5 SP1?

I have a large (40 Mo) SDF database.

Some queries are very long, but after a while they can become fast.

I would like to try to arrange my indexes, but I only find information for SQL Server, not SQL CE.

+3
source share
2 answers

Not quite sure what type of “cleanup” you think is necessary — the index will not contain unnecessary entries or anything in it. If you just want to restore potentially empty space in the database (indexes and tables), you can use either Compact or Shrink in the SqlCeEngine class.

+1
source

When you first run the SqlCeCommand instance, the SQL CE engine needs to create a query plan for this query. The first execution will always be slower than subsequent executions. You can also reuse command instances and invoke Prepare on SqlCeCommand to flag the query plan generation command.

+1
source

Source: https://habr.com/ru/post/1743013/


All Articles