Title: Checking table every time is performance issue
Last modified: February 21, 2018

---

# Checking table every time is performance issue

 *  Resolved [Radovan Smitala](https://wordpress.org/support/users/adorei/)
 * (@adorei)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/checking-table-every-time-is-performance-issue/)
 * Hi,
 * i like DynamicWidgets because it helps me a lot of times.
 * Currently i tried to optimize performance of client site and it looks like dynamic
   widgets has performance issue with database query.
 * Every time is DynamicWidget initialized it’s checks for database table if exists.
   
   I think this is not neccessary bottle neck, because this process should be moved
   into installation hook or enabling plugin hook.
 * This piece of code:
    classes/dynwid_class.php#59
 *  $query = “SHOW TABLES LIKE ‘” . $this->dbtable . “‘”;
    $result = $this->wpdb-
   >get_var($query);
 *  $this->enabled = ( is_null($result) ) ? FALSE : TRUE;
 * Should be only checked on install / enabling. Not every page load. Big performance
   issue then.
    What do you think?

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Qurl](https://wordpress.org/support/users/qurl/)
 * (@qurl)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/checking-table-every-time-is-performance-issue/#post-10011295)
 * I don’t agree. It should be checked every time. This makes sure Dynamic Widgets
   does not run into a fatal error when the table got (suddenly) missing breaking
   a complete website.

Viewing 1 replies (of 1 total)

The topic ‘Checking table every time is performance issue’ is closed to new replies.

 * ![](https://ps.w.org/dynamic-widgets/assets/icon-256x256.png?rev=2968917)
 * [Dynamic Widgets](https://wordpress.org/plugins/dynamic-widgets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dynamic-widgets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dynamic-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/dynamic-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dynamic-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dynamic-widgets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Qurl](https://wordpress.org/support/users/qurl/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/checking-table-every-time-is-performance-issue/#post-10011295)
 * Status: resolved