Two different tables or just one with bool column?

前端 未结 7 2346
自闭症患者
自闭症患者 2021-02-19 15:06

We have two tables: OriginalDocument and ProcessedDocument. In the first one we put an original, not processed document. After it\'s validated and processed (converted to our XM

7条回答
  •  情歌与酒
    2021-02-19 15:30

    Whether the document is valid or invalid, it is still a document so it makes inital sense for them all to be in the same table.

    However, if an invalid document is treated differently by your application to the point where it is almost forgotten (not queried, updated etc.) then split the tables. Having the two types of document together in the same table will do nothing but slow down your queries for no immediate benefit.

    I have a document table where valid and invalid documents are kept together but only because the app re-presents the bad document to the user and asks them to fix it.

提交回复
热议问题