Page 1 of 1

[30]optimize your DataBase in Tools menu

Posted: Sat Mar 22, 2008 12:03 pm
by newart
A simple and tricky useful featurein administration in 1.6 version:

in Tools menu, we have:
Read Messages
Write Message
Mass Mail
Global Check-in
Clean Cache

to add --> optimize your DataBase

a tool menu very important and easy for everybody for maintaining your DB directly by joomla!

NO PROBLEM for developping that, useful for admins (without using a phpmyadmin for that simple & useful action) and very easy for all joomlers...

Re: optimize your DataBase in Tools menu

Posted: Sat Mar 22, 2008 12:30 pm
by newart
Just for explaining the small work to be made in the admin menu, Here is the query SQL action to be done in the DB by pression in that menu:
OPTIMIZE TABLE `jos_banner` , `jos_bannerclient` , `jos_bannertrack` , `jos_categories` , `jos_components` , `jos_contact_details` , `jos_content` , `jos_content_frontpage` , `jos_content_rating` , `jos_core_acl_aro` , `jos_core_acl_aro_groups` , `jos_core_acl_aro_map` , `jos_core_acl_aro_sections` , `jos_core_acl_groups_aro_map` , `jos_core_log_items` , `jos_core_log_searches` , `jos_groups` , `jos_menu` , `jos_menu_types` , `jos_messages` , `jos_messages_cfg` , `jos_modules` , `jos_modules_menu` , `jos_newsfeeds` , `jos_plugins` , `jos_polls` , `jos_poll_data` , `jos_poll_date` , `jos_poll_menu` , `jos_sections` , `jos_session` , `jos_stats_agents` , `jos_templates_menu` , `jos_users` , `jos_weblinks`

Re: optimize your DataBase in Tools menu

Posted: Sat Mar 22, 2008 12:34 pm
by newart
so The php code could be built as follows...
$sql = 'OPTIMIZE TABLE `jos_banner`, `jos_bannerclient`, `jos_bannertrack`, `jos_categories`, `jos_components`, `jos_contact_details`, `jos_content`, `jos_content_frontpage`, `jos_content_rating`, `jos_core_acl_aro`, `jos_core_acl_aro_groups`, `jos_core_acl_aro_map`, `jos_core_acl_aro_sections`, `jos_core_acl_groups_aro_map`, `jos_core_log_items`, `jos_core_log_searches`, `jos_groups`, `jos_menu`, `jos_menu_types`, `jos_messages`, `jos_messages_cfg`, `jos_modules`, `jos_modules_menu`, `jos_newsfeeds`, `jos_plugins`, `jos_polls`, `jos_poll_data`, `jos_poll_date`, `jos_poll_menu`, `jos_sections`, `jos_session`, `jos_stats_agents`, `jos_templates_menu`, `jos_users`, `jos_weblinks`';

Re: [30]optimize your DataBase in Tools menu

Posted: Wed Mar 26, 2008 2:26 pm
by ircmaxell
I STRONGLY disagree with doing this... Optimizing tables should always be done ONLY after a backup. It CAN corrupt data (it's rare, but it's possible). Plus, there's generally not much to gain by running optimize table... Right from MySQL's manual:
In most setups, you need not run OPTIMIZE TABLE at all. Even if you do a lot of updates to variable-length rows, it is not likely that you need to do this more than once a week or month and only on certain tables.

Re: [30]optimize your DataBase in Tools menu

Posted: Wed Mar 26, 2008 9:14 pm
by newart
I regurarly use the OPTIMIZE and never seen any DB crash. The tables need to be optimized regularly (as data is added, edited, and deleted) and doing that twice a week. Maybe you can save the DB before OPTIMIZE in the same tools menu... maybe it can be just an idea...