Title: Slow sql query in function
Last modified: May 10, 2018

---

# Slow sql query in function

 *  [winrilz](https://wordpress.org/support/users/winrilz/)
 * (@winrilz)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/slow-sql-query-in-function/)
 * Hello.
 * We have a store on vokomercer, there is also a responsive-lightbox plug-in, and
   in the latest updates, the plugin started to do a huge load on the bd, creating
   heavy queries.
 * file:/plugins/responsive-lightbox/includes/class-galleries.php:get_users
 * Could you, in the next release, change this method to use the native sql query,
   without using the wordpress function of get_users:
 * $users = get_users(
    array( ‘fields’ => array( ‘ID’, ‘user_login’ ) ) );
 * With large data of wordpress, this code creates a large load on the database.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/slow-sql-query-in-function/#post-10269540)
 * Hi,
    Thanks for your feedback – we’ll definitelly have a look at it and try to
   provide a fix in a next release of the plugin.
 *  [kakashigr](https://wordpress.org/support/users/kakashigr/)
 * (@kakashigr)
 * [8 years ago](https://wordpress.org/support/topic/slow-sql-query-in-function/#post-10281935)
 * I can confirm this behaviour.
 * On a site with more than 200k users, a post update takes around 20 seconds to
   complete with the plugin activated. When I deactivate the plugin, the same post
   takes no more than 10 seconds. I do see the slow get_users query too.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Slow sql query in function’ is closed to new replies.

 * ![](https://ps.w.org/responsive-lightbox/assets/icon-256x256.png?rev=3460874)
 * [Responsive Lightbox & Gallery](https://wordpress.org/plugins/responsive-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsive-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsive-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/responsive-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsive-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsive-lightbox/reviews/)

## Tags

 * [get_users](https://wordpress.org/support/topic-tag/get_users/)

 * 2 replies
 * 3 participants
 * Last reply from: [kakashigr](https://wordpress.org/support/users/kakashigr/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/slow-sql-query-in-function/#post-10281935)
 * Status: not resolved