Hi Maz(vydas,

>oxrootid is used for reducing row changing in DB. for example: you adding new category in first root category, so you updating all oxleft and oxright after your new category. To limit these updates, Oxid using oxroot, so only one branch will be affected on category insert or delete.

In my opinion this is the wrong place to save performance. You only edit categories in the admin panel - not in the running shop; so we have way more read actions than write actions here. So I don't see a time critical issue here. The disadvantages in handling several root ids and not totally switching to a nested set with one tree is bigger than this small win of performance.

Best regards,

Daniel

Am 17.07.2012 00:59, schrieb "[.nfq] Maz(vydas Skuodas":
Hi Daniel,

I think that somebody should write tutorial or explanation how it works, but it is not that hard to understand. Oxid took all advantages of nested set and adopted it to standard "parent id" logic, and made more performance friendly with oxrootid, and more user friendly then using oxsort :)

Ok, so oxrootid, oxleft, oxright and oxparentid is used ONLY for making categories hierarchical and for Developers easier to use. and oxsort is used ONLY for sorting. dont mix functionalities here and report a bug if you see differently in Oxid core :)

oxrootid is used for reducing row changing in DB. for example: you adding new category in first root category, so you updating all oxleft and oxright after your new category. To limit these updates, Oxid using oxroot, so only one branch will be affected on category insert or delete.


Maz(vydas

On 2012-07-17 01:42, Daniel Schlichtholz wrote:
Hi Maz(vydas,

using nested sets AND parent_id's makes the code hard to understand. You are mixing to different concepts which also doubles potential error pits.

As a developer, who wants to extend OXIDs functionality, I have to delve deep into the core code to understand in which cases oxsort is taken into account and when it's not.
I'd suggest you better stick to one concept.

I also don't understand why there are different root nodes. This way there are several trees which are independant from each other - I think this is the part where you need oxsort to bring these independant trees into a defined order. But this is not the concept of a tree. One root id (that is not shown) having the subcategories as branches would be the easier way (imho). Then the ordering for "root"-categories would also be defined by oxleft.

Best regards,
Daniel

Am 16.07.2012 23:54, schrieb Maz(vydas Skuodas:
Hi Joscha,

nested sets are used for hierarchy reasons as well as oxparentid. In fact it is more useful then parent id, as you can check simple with one record,

if that category has any subcategory and its count ( oxright - oxleft == 1
- no subcategories, (oxright - oxleft -1)/2 how many subcats),
you can select all children elements ( WHERE oxrootid = this.oxrootid AND
oxleft > this.oxleft AND oxright < this.oxright)
you can select all parent elements ( WHERE oxrootid = this.oxrootid AND
oxleft < this.oxleft AND oxright > this.oxright)
and some more magic.

oxparentid is used for simple select - like only root categories should be
selected, or only one level of subcategories.

although you can sort by oxleft, it was not used by Oxid, as it is to much work to change oxleft,oxright if you want to simple swap to main categories
(which has lets say 10 subcats so you have to change 22 records).

this fields for nested set (oxrootid, oxleft, oxright) takes only 12
bytes(to example oxtitle has) so i think you have something more than this
question, is it ? :)

Maz(vydas

On Mon, Jul 16, 2012 at 9:44 PM, Joscha Krug | marmalade.de <
[email protected]> wrote:

  Ok, seems like OXID is NOT using nested sets?!

The question is more like: Why do we have left+right although we use
ParentID and Sorting?
Isn't that a bit too redundant?

Regards,
Joscha

//---------

marmalade.de
Joscha Krug

www.marmalade.de
[email protected]

  Leibnizstr.25
39104 Magdeburg
GERMANY

phone: +49 (0) 391 / 559 22 104
fax:      +49 (0) 391 / 559 22 106

*OXMOB | mobile Template<http://www.oxmob.de/?pk_campaign=OXMOB%20%7C%20E-Mail-Link&pk_kwd=normalEmail>
*
Das einfach geniale OXID eShop Modul.
Ab sofort in unserem Online-Shop<http://www.marmalade.de/shop/Templates/OXMOB-OXID-eShop-mobile-Template.html?pk_campaign=OXMOB%20%7C%20E-Mail-Link&pk_kwd=normalEmail>erhältlich.

  Am 16.07.2012 19:31, schrieb Björn Lange:

Hi All,

2012/7/16 Frank Zunderer<[email protected]>
i think nested sets are not used for building the categorytree, it's
built from id/parentid.

And the sorting becomes easier, because every category with oxparent =
'oxrootid' has oxleft=1 at the moment.

  Regards,
Björn

  --

*_________________________________
WBL Konzept, Beerden & Lange GbR*
*Björn Lange*
Geschäftsführender Gesellschafter

Luxemburger Straße 266
50937 Köln

Bilker Straße 34
40213 Düsseldorf

Telefon: 0211 942 120 30 *|* Fax: 0211 192 120 32
www.wbl-konzept.de  *|*www.facebook.com/wbl.konzept  *|*
[email protected]



_______________________________________________
dev-general [email protected]http://dir.gmane.org/gmane.comp.php.oxid.general




_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general



_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general



--
Mit herzlichem Gruß,

Daniel Schlichtholz
Badstr.9
97234 Reichenberg
http://www.mysqldumper.de
http://otrance.org


_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general





_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general


--
Mit herzlichem Gruß,

Daniel Schlichtholz
Badstr.9
97234 Reichenberg
http://www.mysqldumper.de
http://otrance.org

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to