Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

216589 Posts in 58326 Topics- by 87989 Members - Latest Member: Gavin58614
VirtueMart ForumVirtueMart Dev/Coding CentralFeature requests (Moderator: Jeff_S)Performance optimisation proposal using a category tree (code source available)
Pages: [1]   Go Down
Print
Author Topic: Performance optimisation proposal using a category tree (code source available)  (Read 7808 times)
Antoine T
Translator Team
Newbie
**
Posts: 19


View Profile WWW
« on: November 06, 2008, 12:15:52 pm »

Hi,

I used VirtueMart for huge web sites (at the moment three with more than 15000 rows in the #__vm_product table).

The default back office is painly slow and I think the way developpers can browse the category tree is not efficient enough.

That is why I created a new table. It is for instance used in shop_browse_queries, but it can also be used to make the creation of category menu structure in the front more efficient, (same thing for the creation of the categories select/options widget).

Here is the table I am using at the moment :

CREATE TABLE IF NOT EXISTS `jos_vm_category_tree` (
  `category_id` int(11) NOT NULL,
  `category_path` varchar(255) NOT NULL,
  `level` int(11) NOT NULL
  KEY `category_id` (`category_id`),
  KEY `category_path` (`category_path`),
  KEY `level` (`level`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

The category path contains "the bread crumb" of the category.

Here is a sample row :
category_id   category_path     level
25983           ;5538;5544;5669;  4

This way, if one want to know what are the categories (the products...) which are below the category 5538, it may uses (...) like ';5538;%'

If you whant to build the breadcrumb of 25983 (for SEO for instance), it is also very obvious.

But it can be improved in order to help the build of widgets and menus. I will explain the details if I see the community is interested.

Regards

Antoine Tissier

PS  : sorry for my pathetic english
PS2 : I made the same thing for browsing through attributes
« Last Edit: November 07, 2008, 09:21:02 am by Antoine Tissier » Logged
bunak
Newbie
*
Posts: 25



View Profile
« Reply #1 on: November 17, 2008, 15:00:50 pm »

Hi
can you get the urls of this sites, which have more then 15000 products.
Logged
Antoine T
Translator Team
Newbie
**
Posts: 19


View Profile WWW
« Reply #2 on: November 27, 2008, 22:28:49 pm »

Sorry, I am not allowed to. (the company I am working for wants to avoid script-kiddies).
Logged
IvyPearson
Newbie
*
Posts: 1


View Profile
« Reply #3 on: January 29, 2009, 14:35:04 pm »

Hi,

 Thank you, this is a very useful idea and it would be great if it was a built-in table in VM.
Actually, it is quite painful to retrieve a full path in order to make a breadcrumb or to apply a specific color/design for a category (and of course the products related to that category).
Logged
klutzon
Sr. Member
****
Posts: 319


Knuckles the Echidna


View Profile WWW
« Reply #4 on: January 29, 2009, 17:49:11 pm »

Hey Antoine,

I'm very interested in working with you to design and test some code that will improve VirtueMart, if you've got the time to work with me. Send me a PM if you do have the time. Smiley
Logged
Antoine T
Translator Team
Newbie
**
Posts: 19


View Profile WWW
« Reply #5 on: January 29, 2009, 19:16:04 pm »

Great ! I have just bought a new house, ang got some huge work to make inside it, but it'll send you code ASAP.
Logged
klutzon
Sr. Member
****
Posts: 319


Knuckles the Echidna


View Profile WWW
« Reply #6 on: January 29, 2009, 19:18:17 pm »

Great ! I have just bought a new house, ang got some huge work to make inside it, but it'll send you code ASAP.

I appreciate your enthusiasm. Smiley Take your time, sort out your house and your work first, and when you've got time, send me a PM and we'll take it from there.
Logged
Antoine T
Translator Team
Newbie
**
Posts: 19


View Profile WWW
« Reply #7 on: January 30, 2009, 23:21:45 pm »

I am starting to post code about this performance enhancement on my blog about virtuemart and joomla.

A the moment, one can only find SQL snippets.

Regards

Antoine
Logged
Fredrik Larsson
Newbie
*
Posts: 21


View Profile
« Reply #8 on: February 01, 2009, 17:07:02 pm »

Antoine, your blog doesn't work?

I am working on a site with 22000 products and roughly 7000 categories and it will probably grow to around 100000 products. A nightmare I know.. Sad anyway I don't think that a new table is what is needed but more an improvement in the PHP-code. On the frontpage I am using mod_virtuemart_product_categories that displays the categories using XHTML. This tree is very fast and I would guess that a similar approach could be used to lets say have a button that on a click pops up a treeview in plain text where you select the category by clicking on it. This would populate the input-field with the category_id. Pressing search will filter out the products.

The way categories are used by populating a dropdownbox today is a real showstopper on large sites.
Logged
Antoine T
Translator Team
Newbie
**
Posts: 19


View Profile WWW
« Reply #9 on: February 02, 2009, 12:48:04 pm »

Hi,

I know. (no space left on the device :-()). It is fixed now.

The thing is : we didn't used virtuemart as in. (no probleme with select, options...).

Our performance issues are essentially in the back office (not used by our customer anyway).

It is far from being easy with the default data model to change shop_browse_queries.php in order to show the products stored in a category and in its childs (there is an unlimited depth level of categories), and sort the result.

Regards

Antoine
Logged
makuwood
Newbie
*
Posts: 3


View Profile
« Reply #10 on: February 07, 2009, 10:55:04 am »

Hi Antoine,
Nice! I also will PM you about it.
Logged
Pages: [1]   Go Up
Print
Jump to: