Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom table inside my wordpress database called test.

What if i query this table using mysql_query() instead of using for example $wpdb->get_results()

Will this affect my performance?

Ty very much:)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Simple and short:

  • mysql_query() = Faster!
  • $wpdb->get_results() = Safer!

But in most cases since $wpdb is a global object and already in the memory using it will be be as fast as mysql_query().

Will this affect my performance?

It can affect for better performance changes but they would be minor changes that its just not worth it.

share|improve this answer

Plugins caching DB queries hook into the WordPress API. If you don’t use the API your queries aren’t cached. The result is a slower site.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.