Improving WP_Query for performance when random posts are ordered

The problem with orderby rand is that on most setups the database will load all posts into memory, then randomly order them, and return what you asked for. It’s that loading into memory that makes the query super slow/expensive

Also yes, terms are individual categories and tags, where category is a taxonomy, and the ‘development’ category is a term in that taxonomy.

Finally, your initial code snippet implies you’re using a page template or attempting to override what’s shown on the page. This is bad as it discards the main query and launches a second query. The cost of the first query still occurs, but it’s discarded so it’s a waste of time. This is why query_posts is considered harmful, replacing it with a custom WP_Query loop doesn’t fix that. Consider using pre_get_posts instead to intercept the main query and change it