Creating and Indexing Email Database using SqlCe
- by Anindya Chatterjee
I am creating a simple email client program. I am using MS SqlCe as a storage of emails. The database schema for storing the message is as follows:
StorageId int IDENTITY NOT NULL PRIMARY KEY,
FolderName nvarchar(255) NOT NULL,
MessageId nvarchar(3999) NOT NULL,
MessageDate datetime NOT NULL,
StorageData ntext NULL
In the StorageData field I am going to store the MIME message as byte array. But the problem arises when I am going to implement search on the stored messages. I have no idea how I am going to index the messages on top of this schema.
Can anyone please help me in suggesting a good but simple schema, so that it will be effective in terms of storage space and search friendliness as well?
Regards,
Anindya Chatterjee