11

Does SQL CE support clustered indexes?

3 Answers 3

9

MSDN says about the NONCLUSTERED argument:

This is the only supported index type
5

Judging by CREATE INDEX syntax for SQL Server Compact Edition, the only supported index type is NONCLUSTERED.

4

Most file based databases do not support clustered indexes. It would require a rewrite of the entire index if you inserted a new row out of order. Since this is expensive (and a blocking operation) most file databases do not allow it.

BUT, you do normally gain a notion of natural order. The order you insert in is the order they are on disk. This is something you do not have with full SQL Server which is always reclaiming free space from previous pages.

1
  • Modern file based databases also automatically reclaim space, so their tables fragment just like tables of a database server. Also you don't have to rewrite the whole index -- it's exactly the same as inserting a new entry into a normal index.
    – Paul Groke
    May 12, 2015 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.