1. A database table can handle millions of rows easily.
2. Proper indexing will also help any potential slow down when fetching data.
I will also add on, that if you are the developer, you can just... not allow a user to have 50k pets If there is a worry about table size, you could just limit the max number of pets a user can have.