I’ve got an object, say a person. I’ve also have a class called personList. Which is an array of persons.
When I initiate the list it calls a database query and builds an array of objects (person).
Elsewhere in other objects I need to reference a particular person.
What I currently do is declare my personList and call a method called getID which returns the person with the ID passed in by looping through and matching it with the property of the person object in the full array.
It’s works well. But my question is.
My person database is now over 5,000 rows long.
Is initiating this list and building an array of over 5,000 bad in terms of performance? Or is this something easily managed by MySQL
should my getID be doing a database lookup and building the person as a one off person?