1

My situation is that I currently have a list of images. I want to store tags with an X/Y position and a person id for each image.

I was looking at doing this via three tables. One table the images, the second table the tags, and the third table the persons name.

  • Is this the right way to do it or is there a better way?
  • How would I go about searching for images that contain specific people (eg return images that have tags of key 1,2 and 3)

I was thinking that when the user searches through the table of images I could create a new column dynamically, which would be an array of the person tag keys that would then be checked for all the values.

enter image description here

Dale K
  • 25,246
  • 15
  • 42
  • 71
Christopher Vickers
  • 1,773
  • 1
  • 14
  • 18
  • If a picture has multiple tags (i.e more than one person in it), will tag table have multiple records for single image kye and different person keys? – Pratik Bhavsar Jul 31 '19 at 11:30
  • Givn the above structure, if you're trying to find an image that contains all three persons together: https://stackoverflow.com/questions/15977126/select-group-of-rows-that-match-all-items-in-a-list – Salman A Jul 31 '19 at 11:31
  • Thank you very much but would that be extreme slow once I have hundreds of thousands of images, hundreds of thousands of tags and hundreds of people? If there is any quicker way. – Christopher Vickers Jul 31 '19 at 12:07
  • The structure here seems to be a reasonable design for what you are explaining. If you start using a non-standard design to deal with a performance problem that doesn't actually exists you are participating in what is known as premature optimization. And that is pure evil. Design your database to properly hold the data and deal with performance issues when they happen. – Sean Lange Jul 31 '19 at 13:35

0 Answers0