This script will rebuild some of the indexes and tables within Magento. I find it useful if the GUI times out when performing cache management.
rebuild();
/*
rebuild catalog index
*/
Mage::getSingleton('catalog/index')->rebuild();
/*
rebuild search
*/
Mage::getSingleton( 'catalogsearch/fulltext' )->rebuildIndex();
/*
rebuild flat category
*/
Mage::getResourceModel('catalog/category_flat')->rebuild();
/*
rebuild flat catalog product
*/
Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();
/*
apply catalog rules
*/
Mage::getResourceSingleton('catalogrule/rule')->applyAllRulesForDateRange();
$t_end = microtime(true);
$diff = $t_end - $t_start;
echo "Refresh Complete in $diff seconds";
?>