Title: SQL Issues
Last modified: October 6, 2021

---

# SQL Issues

 *  Resolved [nwr91](https://wordpress.org/support/users/nwr91/)
 * (@nwr91)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/sql-issues/)
 * Had an email from our hosting provider that they are at the point of having to
   suspend 2 sites that use the Salesforce Sync plugin.
 * They say they are consistently running 100’s of DELETE SQL queries of the same
   action_id, and a long-running query that takes 3+ hours to complete.
 * The issues are listed below.
 * `DELETE FROM`wp_actionscheduler_actions`WHERE`action_id`= 1353679`
 *     ```
       SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  LEFT JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id AND mt1.meta_key = 'associated_review' ) WHERE 1=1  AND (
         ( wp_postmeta.meta_key = 'associated_review' AND wp_postmeta.meta_value = '' )
         OR
         mt1.post_id IS NULL
       ) AND wp_posts.post_type = 'film' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 200
       ```
   
 * Both sites are fully up-to-date with WP and plugins. Please resolve urgently.
    -  This topic was modified 4 years, 7 months ago by [nwr91](https://wordpress.org/support/users/nwr91/).

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

 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/sql-issues/#post-14944988)
 * Well, I can tell you that the `DELETE FROM` SQL statement is related to the [ActionScheduler library](http://actionscheduler.org/),
   which this plugin does include. It’s also included with Woocommerce (they develop
   it) and many other plugins.
 * But in general, if it’s an urgent issue, you may need to set up a staging site,
   disable all other plugins and themes, turn on debug logging, etc. and see if 
   it’s still happening.
 * If it does turn out to be an urgent issue, I would greatly welcome pull requests
   that could fix it for anyone else who might encounter it. But to be clear, unless
   you can specify that it is caused by this plugin and how exactly it can be reproduced
   I’m not sure that it’s something I can resolve for you.
 *  Thread Starter [nwr91](https://wordpress.org/support/users/nwr91/)
 * (@nwr91)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/sql-issues/#post-14945095)
 * We have already narrowed it down to the Salesforce Sync plugin. The site is not
   using any other plugin that uses the ActionScheduler library.
 * The long-running SELECT is probably unrelated, but that still doesn’t explain
   the multi-100 DELETE FROM statements.
 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/sql-issues/#post-14945115)
 * Okay, to give some more detail then: I realize the query is related to this plugin.
   But there’s clearly a reason your site is not deleting actions that Action Scheduler
   runs in smaller quantities on its own, as that library generally does, and I 
   can’t speak to what that reason is. It might be caused by this plugin, it might
   be caused by a conflict with another plugin or theme, it might be caused by limitations
   your host has, it might be caused specifically by your fieldmap configurations–
   by fields or objects you’re trying to work with that don’t work well – or by 
   issues with your Salesforce, by Action Scheduler itself, or by some combination
   of those things. In any case, there isn’t enough information for me to know whether
   there is an issue with this plugin specifically, much less to resolve it, without
   knowing how to reproduce it.
 * Figuring that out may be something that you need to hire out, if you don’t have
   the capacity, and again, I would welcome pull requests or knowledge of how to
   reproduce it if it does become clear that there’s an issue with this plugin. 
   I’m sure the Action Scheduler people would as well, if there’s an issue with 
   their library.

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

The topic ‘SQL Issues’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/object-sync-for-salesforce.svg)
 * [Object Sync for Salesforce](https://wordpress.org/plugins/object-sync-for-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/object-sync-for-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/object-sync-for-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-sync-for-salesforce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/sql-issues/#post-14945115)
 * Status: resolved