Why is it profitable to put questions and answers in one database table?

I found out that SO put the questions and answers in one table. They say that the question will not have a parent identifier, and the answers will have parent identifiers. Why is it better to do it this way instead of asking questions and answers in separate tables?

+3
source share
2 answers

A few reasons:

  • Conceptually, the questions and answers do not really differ from the modeling perspective;
  • This simplifies the search (one table instead of two);
  • - ​​ ( , , ), , SQL .

- .

: (, ..). - , . , . , - , (, WHERE parentID IS NULL ).

+2

, , , , , , , , , . , One Question , - . /, , :-) , , , , , .

+1

Source: https://habr.com/ru/post/1723944/


All Articles