Does wp_query and query_posts affect website performance? [duplicate]

The question was answered a few times on this site. Have a look at this answer