Suggested indices for a MPTT table?

I generally index just the left column. I usually work with mysql, which only allows for one index user per table in an execution plan, and an index on left helps every query i've ever written for a MPTT table and the benfits of including right in that index are minimal in short, a single index on left, in my experience, is the optimum balance between insert/update speed and select speed for nearly every use case.

I generally index just the left column. I usually work with mysql, which only allows for one index user per table in an execution plan, and an index on left helps every query i've ever written for a MPTT table and the benfits of including right in that index are minimal. In short, a single index on left, in my experience, is the optimum balance between insert/update speed and select speed for nearly every use case.

You will always be using the left column, however I often need to find all leaf nodes. WHERE lft = (rgt -1) So I usually just create a index with the pair lft, rgt.

1 This. Most trees are read a lot more than they are written to, so having a two-column index (not 2 separate indexes) on left and right is great. Also, if you're storing multiple trees in the same table, e.g. Grouping by user, make it a three-column index on grouping_id, left, right.

– Lucas Apr 29 at 1:26.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions