Foreign Key Array Columns
Hi, I'm having trouble understanding or finding resources on columns of foreign key arrays. Say I have a post that people can comment on. So, I would think that I could add an array of the primary id's of comments to a post. However, this would run 2 dabatase functions (one to create each comment and the other to add the comments primary id to the post). The alternative would be to add the primary id of the post to the comment (and get rid of the comment array in the post). However, this method would require 2 database functions to obtain all of the data from a post (one to get the post itself and one to query all comments with the appropriate post id (as opposed to the first method which would require only one query with joins)). Is there a better way, where it only requires 1 database function to create the comment and 1 database function to get the post with its comments? If not, which method (1st or 2nd) is more popular or would you recommend? Thanks in advance!