A design question in a parent child relationship

  • I am not sure which is the best way to proceed. I have parent child relationship where I have to determine if every vendor completed a task (this is a fictitious example).

    I have a task record and typically 13 or fewer vendors who each have to complete that task. My application needs to know when all the vendors have completed the their task.

    I see two options:

    1. Every time I need to know if all the vendors completed the task I could loop thru the vendors assigned to that task
    2. I could add a flag to the Task table that lets me know if all the vendors completed the task. If the flag is True I wouldn't have to loop thru all the vendors anymore.

    Option 1 has performance issues. Option 2 feels wrong, but it does save database queries.

    Which option is the better option? Is there an option that I haven't thought about?

    Thanks

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply