Buy Percona SupportEmergency? Get 24/7 Help Now!
  Wednesday, December 31, 1969
   Bill Karwin

Models for Hierarchical Data in SQL and PHP

Tree-like data relationships are common, but working with trees in SQL usually requires awkward recursive queries. This talk describes alternative solutions for modeling hierarchical data that work for MySQL, including:

  • Adjacency List
  • Path Enumeration
  • Nested Sets
  • Closure Table

Code examples will demonstrate using the Closure Table in PHP, and offer guidelines for choosing one design over another.


Bill Karwin
Senior Knowledge Manager


General Inquiries

For general inquiries, please send us your question and someone will contact you.