SQL Server Efficiently dropping a group of rows with millions and millions of rows

前端 未结 13 580
遇见更好的自我
遇见更好的自我 2021-02-04 12:26

I recently asked this question: MS SQL share identity seed amongst tables (Many people wondered why)

I have the following layout of a table:

Table: Star

13条回答
  •  故里飘歌
    2021-02-04 13:28

    I didn't get an answer to my comment on the original post, so I am going under some assumptions...

    Here's my idea: use multiple databases, one for each category.

    You can use the managed ESE database that ships with every version of Windows, for free.

    Use the PersistentDictionary object, and keep track of the starid, starname pairs that way. If you need to delete a category, just delete the PersistentDictionary object for that category.

    PersistentDictionary starsForCategory = new PersistentDictionary("Category1");
    

    This will create a database called "Category1", on which you can use standard .NET dictionary methods (add, exists, foreach, etc).

提交回复
热议问题