Its a way of representing a tree with right-left pointers in each record (basically re-inventing a hierarchical database
in a relational model...). A good description is in Joe Celko's SQL For Smarties book. Selection is very fast because
any node's children have node ID's between the right and left nodes of said node, so there's no mucking about
with connect by and what not. There's a synopsis linked at the PG Cookbook pages (,
but the cookbook seems to off-line (I think I'll offer to mirror it - this happens frequently). There's another description at _requestid=65750.

Insertion takes a fair amount of work, as you generally have to re-arrange the node IDs when you add a record.

On Mar 29, 2004, at 12:05 PM, Jaime Casanova wrote:


> I used to use the connect-by patch, but have since rewritten everything
> to use a nested set model.

Cool! You're probably the only person I know other than me using nested sets
in a production environment.

can you explain me what is a nested set?

Add photos to your messages with MSN 8. Get 2 months FREE*.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?


Andrew Rawnsley
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114

---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Reply via email to