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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)