Title: Database Locking Issues
Last modified: August 21, 2016

---

# Database Locking Issues

 *  [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/)
 * my site is frozen sporadically due to the problems with this plugin locking up
   the database. my server admin identified the issue and sent me this:
 * The query that caused problems was this one:
 * SELECT pid , wp_options.option_value AS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘
   @@’, meta_key, meta_value)) AS ‘extras’ FROM wp_ngg_pictures LEFT OUTER JOIN 
   wp_options ON wp_options.option_name = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.
   pid) LEFT OUTER JOIN wp_postmeta ON wp_postmeta.post_id = wp_options.option_value
   WHERE (exclude = 0) GROUP BY wp_ngg_pictures.pid ORDER BY rand()
 * i have paying members and this plugin will make me lose them at this rate 🙁 _(
   posted this in ‘reviews’, should’ve been posted here)_
 * [http://wordpress.org/plugins/nextgen-gallery/](http://wordpress.org/plugins/nextgen-gallery/)

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365012)
 * [@shake](https://wordpress.org/support/users/shake/) Girl – Please submit this
   as a Bug Report ([http://www.nextgen-gallery.com/report-bug/](http://www.nextgen-gallery.com/report-bug/)…
   please reference this topic) with your site specifics.
 * We will likely need log in, FTP, and database access credentials for your WordPress
   installation as well, please include those with the Bug Report, too.
 * Thanks!
 * – Cais.
 *  Thread Starter [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365040)
 * done – thanks
 *  [Lhemmerich](https://wordpress.org/support/users/lhemmerich/)
 * (@lhemmerich)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365041)
 * I have had the database lock also…4 times…Just had to reload from backup
    Today
   it is running OK but I have strayed away from next-Gen.. i will wait for answer…
 *  Thread Starter [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365073)
 * it’s causing some serious database issues. stopping the process means possibly
   causing corrupted tables and they’ve had to run a repair several times. now i
   can only wait for the fix…this is serious as it basically shuts down a wordpress
   site running this plugin :-/
 *  [JasonTM13](https://wordpress.org/support/users/jasontm13/)
 * (@jasontm13)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365126)
 * I just had the database lock issue as well. Hopefully there is a fix for this
   issue soon.
 *  [acusti](https://wordpress.org/support/users/acusti/)
 * (@acusti)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365130)
 * I have the same issue. On most requests, the plugin does two similar looking 
   requests that take anywhere from 10 to 35 seconds each, which is bananas. Here
   are actual queries from a page I just visited with the execution time above (
   via the blackbox debug bar):
 *     ```
       35,091.8539 [ms]
       SELECT pid , \<code>wp_options\</code>.\<code>option_value\</code> AS 'custom_post_id', GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras' FROM \<code>wp_ngg_pictures\</code>
       LEFT OUTER JOIN \<code>wp_options\</code> ON \<code>wp_options\</code>.option_name = CONCAT('wp_ngg_pictures_', wp_ngg_pictures.pid) LEFT OUTER JOIN \<code>wp_postmeta\</code> ON
       \<code>wp_postmeta\</code>.\<code>post_id\</code> = \<code>wp_options\</code>.\<code>option_value\</code>  WHERE (\<code>exclude\</code> = 0) AND (\<code>galleryid\</code> IN (2)) GROUP BY wp_ngg_pictures.pid ORDER BY rand();
   
       13,842.9251 [ms]
       SELECT wp_ngg_pictures.* , \<code>wp_options\</code>.\<code>option_value\</code> AS 'custom_post_id', GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras' FROM
       \<code>wp_ngg_pictures\</code> LEFT OUTER JOIN \<code>wp_options\</code> ON \<code>wp_options\</code>.option_name = CONCAT('wp_ngg_pictures_', wp_ngg_pictures.pid) LEFT OUTER JOIN
       \<code>wp_postmeta\</code> ON \<code>wp_postmeta\</code>.\<code>post_id\</code> = \<code>wp_options\</code>.\<code>option_value\</code>  WHERE (\<code>exclude\</code> = 0) AND (\<code>galleryid\</code> IN (2)) GROUP BY wp_ngg_pictures.pid
       ORDER BY rand() LIMIT 3;
       ```
   
 * Those particular queries seem to be produced from the `get_generated_query` method
   of the `Mixin_NextGen_Table_Extras` class in `/nextgen-gallery/products/photocrati_nextgen/
   modules/nextgen_data/mixin.nextgen_table_extras.php`, and I believe they are 
   called from the NextGEN Widget.
 * Here’s hoping a solution is soon found.
 *  [pfranke](https://wordpress.org/support/users/pfranke/)
 * (@pfranke)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365143)
 * I have the issue as well:
    `| 1566 | localhost | database | Query | 3| Copying
   to tmp table | SELECT pid ,`wp_options`.`option_value`AS 'custom_post_id', GROUP_CONCAT(
   CONCAT_WS('@@', meta_key, |`
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365144)
 * All – Please create your own separate topic regarding database issues as they
   may appear similar but they most likely are not the exact same issue.
 * Thanks!
 * – Cais.
 *  Thread Starter [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365146)
 * i have paid for a license to get premium support for this. it is now 17 days 
   after i submitted a premium support request to fix this problem and i still don’t
   have a reply from anyone telling me when or IF it can be fixed.
 * i was told to backup my database and allow them access to my server. done. i’ve
   stopped updating my website to allow time for this problem to be resolved without
   data loss. now, i’m just losing paying customers. can someone PLEASE get back
   to me now?? 2+ weeks for this is ridiculous.
 * note: i’m only coming to this public forum now because your ‘premium’ support
   people aren’t replying to inquiries or giving me an updates on progress.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365148)
 * [@shake](https://wordpress.org/support/users/shake/) Girl – Becoming a NextGEN
   Pro subscriber did not, and would not, change the priority with which we are 
   reviewing this issue and how your site is being affected by it. We were already
   reviewing your concerns prior to you taking our a subscription.
 * Generally speaking, although many users believe they have a similar or the exact
   same issue, this is almost entirely not the case as they are rarely using the
   same web host with the same server environment, the same theme and the same active
   plugins … and in some extremely rare cases the same content.
 * We do appreciate you would like to have your issue sorted out and resolved immediately
   and we are working very hard to accomplish that exactly the same goal for all
   of our users.
 * Please be patient, and please feel free to bring any additional concerns or issues
   you have with NextGEN Pro to your member’s area at [http://nextgen-gallery.com/](http://nextgen-gallery.com/)
 * Thanks!
 * – Cais.
 *  Thread Starter [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365151)
 * more than 1 month since my initial submission for (premium) support on this problem.
   my site has not been updated while waiting for you to simply take a look and 
   either fix the issue or let me know it CAN’T be fixed so that i can move on to
   another solution for images management. it is now comfortably AFTER the holiday
   and i would appreciate some sort of movement towards a resolution.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365152)
 * [@shake](https://wordpress.org/support/users/shake/) Girl – We hope to have this
   sorted out in our next (beta) release. Please feel free to watch this page for
   more details: [http://www.nextgen-gallery.com/nextgen-gallery-latest-beta/](http://www.nextgen-gallery.com/nextgen-gallery-latest-beta/)
 * Thanks!
 * – Cais.
 *  Thread Starter [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * (@nanotrax)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365161)
 * 2+ months later, still no beta and no resolution? 🙁

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

The topic ‘Database Locking Issues’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 13 replies
 * 6 participants
 * Last reply from: [Shake Girl](https://wordpress.org/support/users/nanotrax/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/database-locking-issues-1/#post-4365161)
 * Status: not resolved