RSS

Magento database maintenance

Log cleaning

Magento maintains several tables for logging. These tables log things such as customer accesses and frequently-compared products. Magento has a mechanism for cleaning these logs regularly, but unfortunately, this feature is disabled by default and most customers do not enable it. There are three ways to clean out these tables: via log cleaning in the Magento Admin, via log.php in the ../shell directory, and manually via phpMyAdmin or MySQL client.

The following tables are managed by Magento’s log cleaning function:

log_customer

log_visitor log_visitor_info
log_url log_url_info
log_quote
report_viewed_product_index
report_compared_product_index
report_event catalog_compare_item
Log cleaning via administrator interface
  • From the Magento administrator interface, go to System > Configuration.
  • In the left menu under Advanced, click System.
  • Under Log Cleaning, change Enable Log Cleaning to Yes and configure the Save Log for 15 days:
log_cleaning01
  • Click Save Config

 

Manual cleaning via phpMyAdmin

This is the most efficient way to clean the logs for those more comfortable working with databases. It is faster than the built-in Magento tools and it allows you to clean other tables not included in those tools. This procedure will consolidate the data inside those tables, often decreasing database size by as much as 95% and greatly reducing query times.

  1. Open the database in phpMyAdmin via the SiteWorx control panel.
  2. In the right frame, select the check box for the following tables:
dataflow_batch_export
dataflow_batch_import
log_customer
log_quote log_summary
log_summary_type
log_url log_url_info
log_visitor log_visitor_info
log_visitor_online
report_viewed_product_index
report_compared_product_index
report_event
log_cleaning02
  • At the bottom of the page, click the drop-down box With Selected and select Empty.
  • A confirmation screen will appear. Click Yes. This will truncate all of the selected tables.
  • Click the Structure tab at the top of the page.
  • Select the same tables as you did in step 2, then under the With Selected drop-down menu, select Optimize.

Regular maintenance

It is not unusual to see 2GB+ databases decrease their size by 75% after cleaning the logs. It is therefore critical to regularly perform this sort of maintenance, particularly if your time-to-first-byte latency begins increasing and you have already implemented the other performance tweaks.

http://eaccelerator.net/

Advertisements
 
Leave a comment

Posted by on November 11, 2014 in magento

 

5 Star Rating plugin in PHP Script with Ajax

5 Star Rating plugin in PHP Script with Ajax

 
Leave a comment

Posted by on November 3, 2014 in Javascript

 

Fade In and Fade Out Effect Using css On main div

<style>
.main:hover .imgclass,.main:hover .left,.main:hover .right
{

opacity: 1.0;
transition: opacity .5s ease-in-out;
-moz-transition: opacity .5s ease-in-out;
-webkit-transition: opacity .5s ease-in-out;

}

.right
{
width:180px;
float:left;

opacity: 0.70;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
margin: 0px 0px 0px 10px;
/* right: 1000; */
text-align: right;}

.left
{
width:200px;
float:left;
opacity: 0.70;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
margin: 0 0 0 10px;}

.imgclass
{

opacity: 0.70;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
}

/*img {
opacity: 0.6;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
}
img:hover {
opacity: 1.0;
transition: opacity .55s ease-in-out;
-moz-transition: opacity .55s ease-in-out;
-webkit-transition: opacity .55s ease-in-out;
}*/

.main
{
width:430px;
}

</style>
<div class=”main”>

<a href=”#”><img class=”imgclass” src=”http://www.adworldsmedia.com/wp-content/themes/adworldmedia/img/p1.png&#8221; />
<div style=”border:2px solid #C5BDBE;width:430px;float:left;”>
<div class=”left”><h2>Test Here</h2></div> <div class=”right”><h2>right text Here</h2></div>
</div>
</a>

</div>

 
Leave a comment

Posted by on October 29, 2014 in css

 

Google Api Geo

https://code.google.com/p/gogeocode/

 

http://stackoverflow.com/questions/16375214/php-mysql-calculate-distance-between-2-points

http://stackoverflow.com/questions/9084410/using-php-and-mysql-to-calculate-geolocation-distance

http://www.codeofaninja.com/2014/06/google-maps-geocoding-example-php.html

 

http://www.nulledlistings.com/?p=7528

https://www.marketingtechblog.com/calculate-distance/

PHP and MySQL: Calculating Distance script

 

http://www.codeofaninja.com/2014/06/google-maps-geocoding-example-php.html

http://yourwebdesignshop.com.au/how-to-dynamically-geocode-an-address-using-google-maps-api-and-php/

MAin

https://github.com/swiecki/gogeocode

 

 

 
Leave a comment

Posted by on October 14, 2014 in Google Api

 

URL redirect through

http://www.a2zwebhelp.com/url-rewrite-htaccess

 

The following code will rewrite anyfile.php to anyfile.html

RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php

The following code will rewrite index.php to index

RewriteEngine on
RewriteRule ^index index.php

 

Few Example to create SEO friendly URL.

1. Rewrite product.php?id=1 to product-1.html

RewriteEngine on
RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1

 

2. Rewrite product.php?id=12 to product/cat/12.html

RewriteEngine on
RewriteRule ^product/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ product.php?id=$2

 

3. Rewrite domain.com/member.php?username=arup to domain.com/arup

RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1

 

4. Rewrite domain.com/users.php?id=username&page=2 to domain.com/username/2

RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ users.php?user=$1&page=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ users.php?user=$1&page=$2

 

 
Leave a comment

Posted by on October 14, 2014 in .htacess

 

Tags: ,

Online Photoshop Tool

http://www.photoshoponlinefree.com/

 
Leave a comment

Posted by on October 3, 2014 in Photoshop

 

Stop WordPress from adding p tags and removing line break

A simple plugin to disable the WordPress wpautop function. This is the function that automatically formats your posts.

http://urbangiraffe.com/plugins/disable-wpautop/

 
Leave a comment

Posted by on September 30, 2014 in Wordpress