9

I'm working on a project that uses a SQL Server Express database that is decently large already and I know indexing specific columns / tables can take up quite a bit of space.

What I don't know is whether the space used by the index counts against the total size limit of the database. If anyone has any insight let me know.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PorcupineRending
  • 1,245
  • 1
  • 11
  • 16

3 Answers3

3

relational data counts towards the limit. This actually includes indexes, but not FILESTREAM data.

The full list of limitations can be found on MSDN. This includes the note on relational data.

Fenton
  • 241,084
  • 71
  • 387
  • 401
  • 1
    Indexes do not use FILESTREAM columns. Nor does the site you link to say anything like that. Indexes on relational data definitely count as relational data themselves. – RBarryYoung Feb 06 '13 at 22:35
  • 1
    Apologies, Full-Text indexing uses FILESTREAM. – Fenton Feb 06 '13 at 22:41
3

The limit is really for the size of the database's MDF file, so yes it will include your indexes, as well as other database objects, like SQLCLR code, etc. Starting with SQL Server 2008 the full text indexes are also part of the database, so they will count towards the limit.

What is excluded is the data stored in FILESTREAM data type, mentioned by Steve, since FILESTREAM data is stored in separate files, and not in MDF file.

Krzysztof Kozielczyk
  • 5,887
  • 37
  • 28
2

I have written a detail blogpost about the 10GB size limit in SQL Express and how you can try to keep your database size below the limit. As mentioned by others in the answers above, indexes do add to the size of your database.

Take a look at my blogpost and the standard SQL Server reports (available from SQL Server Management Studio) to find the size of your indexes. They can be huge if you use a lot of indexes.

Tom Mayfield
  • 6,235
  • 2
  • 32
  • 43
Ramon de Klein
  • 5,172
  • 2
  • 41
  • 64