Post by madlime » Wed Aug 24, 2011 3:22 am

Hi everybody,

last week my website very slow but now fixed buy new dedicated server cpanel very fast now.

now start second problem :)

search very slow not slow very bad,

admin panel search any product only 1 second , front panel more than 40 second why?

i need help thank you very much

please check my website

http://www.madlime.com

http://www.madlime.com
Always Free Shipping


User avatar
New member

Posts

Joined
Sat May 28, 2011 5:56 pm
Location - Hong Kong

Post by Xsecrets » Wed Aug 24, 2011 4:55 am

it's going to be because of your tags. You might be able to help it a bit by indexing the tag field, but still the way tags are implemented I don't think the will ever really be efficient for searching.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by uksitebuilder » Wed Aug 24, 2011 6:37 am

The following SQL helped one of my sites a lot

Code: Select all

ALTER TABLE `category` ADD INDEX ( `parent_id` ) ;
ALTER TABLE `category` ADD INDEX ( `top` ) ;
ALTER TABLE `category` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `category` ADD INDEX ( `status` ) ;
ALTER TABLE `option` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `option_description` ADD INDEX ( `name` ) ;
ALTER TABLE `option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `option_value_description` ADD INDEX ( `option_id` ) ;
ALTER TABLE `order` ADD INDEX ( `customer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `model` ) ;
ALTER TABLE `product` ADD INDEX ( `sku` ) ;
ALTER TABLE `product` ADD INDEX ( `upc` ) ;
ALTER TABLE `product` ADD INDEX ( `manufacturer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `product` ADD INDEX ( `status` ) ;
ALTER TABLE `product_option` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_value_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `tag` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `user` ADD INDEX ( `username` ) ;
ALTER TABLE `user` ADD INDEX ( `password` ) ;
ALTER TABLE `user` ADD INDEX ( `email` ) ;
site was using 1.5.0.5

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cantykiwi » Wed Aug 24, 2011 6:42 am

I concur with Xsecrets that the tags is most likely your problem.
I was having the same issue myself on my development version (v1.5.1.1) of opencart and we have 2-5 tags on most of our 1200 products. It was taking almost a minute to do a search on localhost server!!!
After adding further indexes into the tag table this dropped searches to around 15 seconds but I still found this unnacceptable so took out the searching of tags altogether and the searches now typically only take around .01-.02 of a second instead!!!

New member

Posts

Joined
Mon Sep 13, 2010 12:37 pm

Post by Xsecrets » Wed Aug 24, 2011 6:44 am

uksitebuilder wrote:The following SQL helped one of my sites a lot

Code: Select all

ALTER TABLE `category` ADD INDEX ( `parent_id` ) ;
ALTER TABLE `category` ADD INDEX ( `top` ) ;
ALTER TABLE `category` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `category` ADD INDEX ( `status` ) ;
ALTER TABLE `option` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `option_description` ADD INDEX ( `name` ) ;
ALTER TABLE `option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `option_value_description` ADD INDEX ( `option_id` ) ;
ALTER TABLE `order` ADD INDEX ( `customer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `model` ) ;
ALTER TABLE `product` ADD INDEX ( `sku` ) ;
ALTER TABLE `product` ADD INDEX ( `upc` ) ;
ALTER TABLE `product` ADD INDEX ( `manufacturer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `product` ADD INDEX ( `status` ) ;
ALTER TABLE `product_option` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_value_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `tag` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `user` ADD INDEX ( `username` ) ;
ALTER TABLE `user` ADD INDEX ( `password` ) ;
ALTER TABLE `user` ADD INDEX ( `email` ) ;
site was using 1.5.0.5
LOL what you couldn't find an index all command? :crazy:

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by uksitebuilder » Wed Aug 24, 2011 6:52 am

My search mod hits a lot of columns hehe

Although I may have overdone it on some ;)

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by rph » Wed Aug 24, 2011 6:59 am

I can't believe Daniel still hasn't indexed query and keyword in the url_alias table.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by madlime » Wed Aug 24, 2011 3:08 pm

uksitebuilder wrote:The following SQL helped one of my sites a lot

Code: Select all

ALTER TABLE `category` ADD INDEX ( `parent_id` ) ;
ALTER TABLE `category` ADD INDEX ( `top` ) ;
ALTER TABLE `category` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `category` ADD INDEX ( `status` ) ;
ALTER TABLE `option` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `option_description` ADD INDEX ( `name` ) ;
ALTER TABLE `option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `option_value_description` ADD INDEX ( `option_id` ) ;
ALTER TABLE `order` ADD INDEX ( `customer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `model` ) ;
ALTER TABLE `product` ADD INDEX ( `sku` ) ;
ALTER TABLE `product` ADD INDEX ( `upc` ) ;
ALTER TABLE `product` ADD INDEX ( `manufacturer_id` ) ;
ALTER TABLE `product` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `product` ADD INDEX ( `status` ) ;
ALTER TABLE `product_option` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `product_option_value` ADD INDEX ( `option_value_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `product_id` ) ;
ALTER TABLE `product_tag` ADD INDEX ( `tag` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `user` ADD INDEX ( `username` ) ;
ALTER TABLE `user` ADD INDEX ( `password` ) ;
ALTER TABLE `user` ADD INDEX ( `email` ) ;
site was using 1.5.0.5

how to add it ?

http://www.madlime.com
Always Free Shipping


User avatar
New member

Posts

Joined
Sat May 28, 2011 5:56 pm
Location - Hong Kong

Post by uksitebuilder » Wed Aug 24, 2011 4:21 pm

via PHPMyAdmin in your hosting control panel

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by madlime » Wed Aug 24, 2011 4:28 pm

uksitebuilder wrote:via PHPMyAdmin in your hosting control panel

thank you.

http://www.madlime.com
Always Free Shipping


User avatar
New member

Posts

Joined
Sat May 28, 2011 5:56 pm
Location - Hong Kong

Post by cantykiwi » Mon Aug 29, 2011 6:17 am

Hey that's awesome, thanks uksitebuilder, certainly seems to work!

I like it better than my solution since you don't have to modify code ;D

Only trouble is, am getting more results than really necessary now since tags are working again, oh well guess i'll have to add some more filters to search results page :laugh:

New member

Posts

Joined
Mon Sep 13, 2010 12:37 pm

Post by hbg » Tue Oct 18, 2011 9:31 am

Hi, UKSB.
Is that the same as in your search mod? If so, it seems to be working for me. I was unsure how to use it, but this post helped. I have 2 tables. The 1st one didn't have all these table id's available, but the second one did.

Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia

Post by kkhan » Thu Oct 27, 2011 9:20 pm

cantykiwi wrote:I concur with Xsecrets that the tags is most likely your problem.
I was having the same issue myself on my development version (v1.5.1.1) of opencart and we have 2-5 tags on most of our 1200 products. It was taking almost a minute to do a search on localhost server!!!
After adding further indexes into the tag table this dropped searches to around 15 seconds but I still found this unnacceptable so took out the searching of tags altogether and the searches now typically only take around .01-.02 of a second instead!!!
and how to totally remove tag searching? Please explain

Newbie

Posts

Joined
Thu Jun 02, 2011 2:44 pm

Post by craig33 » Tue Nov 01, 2011 8:11 am

I did this and now items don't show up when you click on them they just show white blank page no error or anything im using 1.5.3 any ideas?

Newbie

Posts

Joined
Mon Sep 19, 2011 1:42 pm

Post by uksitebuilder » Tue Nov 01, 2011 3:53 pm

The above SQL Commands will do little if anything for 1.5.1.3 because Daniel finally got around to adding indexes to the tag table

Not sure why you are getting a blank page - check your server error logs to see what error you are getting.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by kkhan » Tue Nov 01, 2011 9:04 pm

Actually search function searches only inside "tags" field which limits the searching capability. You can't tell what he customer is going to write in search box and therefore you cannot add every thing under tags.
That was the reason when I got my searching function tweaked a bit and now it searches insie tags, names, vategories and SKU. After implementing this change now my every search returns results.

Newbie

Posts

Joined
Thu Jun 02, 2011 2:44 pm
Who is online

Users browsing this forum: No registered users and 72 guests