Will inserting multiple rows in 'Notifications' table slow down the query?
<p>I'm making a website with a 'following' concept. Whenever a user uploads a picture or a video, I query the 'following' table to get everyone who follows the uploader, and then using a loop to append their name to an INSERT query and then executing it on the 'notifications' table, like is suggested here <a href="http://www.w3schools.com/php/php_mysql_insert_multiple.asp" rel="nofollow">http://www.w3schools.com/php/php_mysql_insert_multiple.asp</a>. </p>

<p>Trouble is, if the person has, say, 2000 followers, this can result in a massive query, along with 2000 entries in the 'notifications' table. Is this an optimal algorithm, or is there a better way to do this? How do bigger websites like Quora handle this?</p>