Title: Having performance issue with posts-to-posts plugin
Last modified: September 13, 2022

---

# Having performance issue with posts-to-posts plugin

 *  Resolved [ashimasukhija1](https://wordpress.org/support/users/ashimasukhija1/)
 * (@ashimasukhija1)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/)
 * Hi
 * I have been experiencing intermittent issues where generated mysql statements
   are causing performance problems. I think this is due to them deadlocking each
   other while waiting for the statements to complete.
 * The start of the statement looks like this:
    `SELECT`dmg_posts`. * ,`dmg_p2p`.*
   FROM`dmg_posts`INNER JOIN`dmg_p2p`WHERE ? = ? AND`dmg_posts`.`post_type`= ? AND(`
   dmg_posts`.`post_status`= ? OR`dmg_posts`.`post_status`= ? ) AND`dmg_posts`.`
   post_status`= ? AND (`dmg_p2p`.`p2p_type`= ? AND ( (`dmg_posts`.`ID`=`dmg_p2p`.`
   p2p_to`AND`dmg_p2p`.`p2p_from`IN ( SELECT`dmg_posts`.`ID`FROM`dmg_posts`WHERE?
   = ? AND`dmg_posts`.`ID`IN (...) AND`dmg_posts`.`post_type`= ? AND (`dmg_posts`.`
   post_stat`
 * Please help me solve this. I have this issue from long time.

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

 *  Plugin Author [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16004459)
 * Hi,
 * Can you provide the whole query? And how many posts do you have in your DB?
 * FYI we took over this plugin for maintenance and security updates, we do not 
   intend to add new features or improve current features.
 * Thanks,
 * Stiofan
 *  Thread Starter [ashimasukhija1](https://wordpress.org/support/users/ashimasukhija1/)
 * (@ashimasukhija1)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16004838)
 * Hi
 * Thanks for the quick response, I have more than 11000 posts in my db.
 * Full query looks like this:
 *     ```
       SELECT   dmg_posts.*, dmg_p2p.* FROM dmg_posts  INNER JOIN dmg_p2p WHERE 1=1  AND dmg_posts.post_type = 'release' AND ((dmg_posts.post_status = 'publish')) AND dmg_posts.post_status = 'publish' AND (dmg_p2p.p2p_type = 'recommended_titles' AND (
                           (dmg_posts.ID = dmg_p2p.p2p_to AND dmg_p2p.p2p_from IN (SELECT   dmg_posts.ID FROM dmg_posts  WHERE 1=1  AND dmg_posts.ID IN (18000) AND ((dmg_posts.post_type = 'release' AND (dmg_posts.post_status = 'publish' OR dmg_posts.post_status = 'acf-disabled'
       OR dmg_posts.post_status = 'private'))) AND dmg_posts.post_status = 'publish'  ORDER BY dmg_posts.post_date DESC )) OR
                           (dmg_posts.ID = dmg_p2p.p2p_from AND dmg_p2p.p2p_to IN (SELECT   dmg_posts.ID FROM dmg_posts  WHERE 1=1  AND dmg_posts.ID IN (18000) AND ((dmg_posts.post_type = 'release' AND (dmg_posts.post_status = 'publish' OR dmg_posts.post_status = 'acf-disabled'
       OR dmg_posts.post_status = 'private'))) AND dmg_posts.post_status = 'publish'  ORDER BY dmg_posts.post_date DESC ))
                       ))  ORDER BY dmg_posts.post_date DESC;
       ```
   
 * As per [wphive.com](https://wphive.com/plugins/posts-to-posts/) this plugin has
   few points to take care of. Are you working on it? and when would be the possibility
   for the new version?
 *  Plugin Support [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * (@alexrollin)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16033360)
 * Hello,
 * we tried to recreate this and were unable to see this issue in our testing.
 * If you need further help please open a support ticket here: [https://wpgeodirectory.com/support/](https://wpgeodirectory.com/support/)
 *  Thread Starter [ashimasukhija1](https://wordpress.org/support/users/ashimasukhija1/)
 * (@ashimasukhija1)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16053777)
 * [https://i.ibb.co/4SvbrsT/wp-p2p.png](https://i.ibb.co/4SvbrsT/wp-p2p.png)
    The
   above screenshot is from single.php page where the posts-to-posts plugin creates
   bidirectional relationship between different custom posts which is created by
   the ACF plugin.
 * [https://i.ibb.co/bdbstvb/wp-p2p1.png](https://i.ibb.co/bdbstvb/wp-p2p1.png),
   code screenshot is also attached.
 *  Plugin Support [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * (@alexrollin)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16058384)
 * If you need further help please open a support ticket here: [https://wpgeodirectory.com/support/](https://wpgeodirectory.com/support/)

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

The topic ‘Having performance issue with posts-to-posts plugin’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/having-performance-issue-with-posts-to-posts-plugin/#post-16058384)
 * Status: resolved