MySQL – Implement the hierarchical data structure in the database

I know there are two methods: adjacency list and nested tree. It is said that due to a large number of queries, the adjacency list will be slow to traverse. But I don’t know any actual numbers in this regard The website I’m making will have 200 pages. Does it take more than 0.3 seconds to traverse to generate (for example) a sitemap?

Use the LAMP stack to run on MySQL (innoDB).

If possible, I would prefer to implement adjacency because the design is simpler.

Thank you.

In addition to the two options you mentioned, there are more options. There are:

> adjacency list (almost everyone uses “parent_id”)
>nested set
>path enumeration
>close list (also called adjacency Relationship)

Look at my answer to “What is the most efficient/elegant way to parse a flat table into a tree?”

Or a few books:

< p>> Joe Celko’s “Trees and Hierarchies in SQL for Smarties”.
> Vadim Tropashko’s “SQL Design Patterns”.

I know there are two ways : Adjacency list and nested tree. It is said that due to a large number of queries, the adjacency list will be very slow to use in traversal. But I don’t know any actual numbers in this regard. The website I’m making will have 200 pages. Traverse generates (for example) sites Does the map take more than 0.3 seconds?

Use the LAMP stack to run on MySQL (innoDB).

If possible, I would prefer to implement adjacency because the design is simpler.

Thank you.

In addition to the two options you mentioned, there are more options. There are:

>Adjacency list (“parent_id” used by almost everyone)
>Nested set
>Path enumeration
>Close table (also known as adjacency relationship)

See what I am right The answer to “What is the most efficient/elegant way to parse a flat table into a tree?”

Or a few books:

> Joe Celko’s “Trees and Hierarchies in SQL for Smarties”.
> “SQL Design Patterns” by Vadim Tropashko.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2932 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.