Closed (fixed)
Project:
Bad Behavior
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2006 at 10:24 UTC
Updated:
2 Jan 2010 at 20:50 UTC
on every page, that is called on drupal when running bad behavior, there is code that checks to see if the bad behavior table exists.
I feel this should'nt be done h.ere and should only be done during the install, it is simply an unnessecary db call.
Cheers, Nick
Comments
Comment #1
NGRhodes commentedIn the file bad-behavior-database.php line 12: if (defined("WP_BB_NO_CREATE")) ...
Maybe if we could define this variable we could prevent this happening every time.
In the file bad-behavior-mediawiki.php there is this:
Putting
define('WP_BB_NO_CREATE', true);in the function badbehavior_init() in badbehavior.module does stop the CREATE TABLE IF NOT EXISTS query being fired which is always a slow query on my server (above 5ms according to devel module).
Obviously for this to work we need to make sure the tables are created, which I guess could be done via an install file, which bypasses
define('WP_BB_NO_CREATE', true);. This is beyond my understanding of drupal as I have only been looking at drupal code for a week.I think this is a useful optimisation as it would save a few ms on every page presented to the end user.
Comment #2
dave reid