Title: Large sites performance issue
Last modified: October 4, 2018

---

# Large sites performance issue

 *  [tonyps47](https://wordpress.org/support/users/tonyps47/)
 * (@tonyps47)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/large-sites-performance-issue/)
 * Hello,
 * Thanks for your work on this plugin.
 * We are running several heavy loaded sites with more than 2 million rows in wp_postmeta.
 * Function `tcs3_wp_media::s3_sync_count()` is being called every request WordPress
   receives (as it is needed to populate `tcs3_wp_options` options fields, which
   is indirectly hooked to `init` WP hook).
 * The query that function is doing is this one:
 * `SELECT count(*) as num FROM {$wpdb->posts} p JOIN {$wpdb->postmeta} pm ON p.
   ID = pm.post_id AND meta_key = 'is_on_s3' AND meta_value = '1' WHERE post_type
   = 'attachment'`
 * which takes almost a second to execute.
 * As this information is only needed at `/wp-admin/admin.php?page=tcs3-admin&tab
   =sync` page, how difficult would it be to only load that data there, and not 
   in every request?
 * Thanks,
    Toni
    -  This topic was modified 7 years, 7 months ago by [tonyps47](https://wordpress.org/support/users/tonyps47/).

The topic ‘Large sites performance issue’ is closed to new replies.

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

 * 0 replies
 * 1 participant
 * Last reply from: [tonyps47](https://wordpress.org/support/users/tonyps47/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/large-sites-performance-issue/)
 * Status: not a support question