It is a myth that Google is indexing all posts on social media. On the contrary, search engines are becoming increasingly choosy about the content that they are indexing. It is more likely that Google is indexing social media accounts having higher authority and larger number of followers.
If your social media content is valuable or informative, in all likelihood people will share your posts. This kind of engagement is noticeable to the search engines. Therefore, social media is known to indirectly affect your search engine rankings.