Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3692202
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:14:07+00:00 2026-05-19T04:14:07+00:00

I’ve been reading up a bit on how multi-tiered commenting systems are built: http://articles.sitepoint.com/article/hierarchical-data-database/2

  • 0

I’ve been reading up a bit on how multi-tiered commenting systems are built:

http://articles.sitepoint.com/article/hierarchical-data-database/2

I understand the two methods talked about in that article. In fact I went down the recursive path myself, and I can see how the “Modified Preorder Tree Traversal” method is very useful as well, but I have a few questions:

  • How well do these two method perform in a large environment like Reddit’s, where you can have thousands and thousands of mutli-tiered comments?
  • Which method does Reddit use? It simply seems very costly, to me, to have to update thousands of rows if they use the MPTT method. I’m not deluding myself into thinking I am building a system to handle Reddit’s traffic, this is simply curiosity.
  • There’s another way of retrieving comments like this … JOINs via SQL that return the rows with IDs defining their parents. How much slower/faster/better/worse would it be to simply take these unformatted results, loop through them and add them into a formatted array using my language of choice (PHP)?
  • After reading that sitepoint article, I believe I understand that Oracle offers this functionality in a much simpler, easier to use way, and MySQL does not. Are there any free databases that offer something similar to Oracle?
  • On a side note, how is SQL pronounced? I’m getting the feeling I’ve been wrong for the past several years by saying ‘sequel’ instead of ‘s – q – l’, although “My Sequel” rolls easier off the tongue than “My S Q L”!

    • 1 1 Answer
    • 0 Views
    • 0 Followers
    • 0
    Share
    • Facebook
    • Report

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    1 Answer

    • Voted
    • Oldest
    • Recent
    • Random
    1. Editorial Team
      Editorial Team
      2026-05-19T04:14:07+00:00Added an answer on May 19, 2026 at 4:14 am
      • MPTT is easier to fetch (a single SQL query), but more expensive to update. Simply delegate the update to a background process (that’s what queue managers are for). Also note that most of that update is a single SQL UPDATE command. It might take long to process, but a smart RDBM could make the transaction visible (in cache) to new (read-only) queries before it’s committed to disk.

      • I’d bet it uses MPTT, but not only doing the ‘hard’ update in background but also quite likely do a simple rendering to in-memory cache. This way, the posting user can see his post immediately, without having to wait until updating so many rows. Also, SSDs do help in getting high transaction rates.

      • that’s called Adjacency Model (or sometimes adjacency list), it’s a more obvious way to do it, and simpler to update (doesn’t modify existing records) but FAR more inefficient to read. You have to do a recursive walk of the tree, with an SQL query at each node. That’s what kills you: the number of small queries.

      • PostgreSQL has recursive SELECTs, which do in the server what you envision in PHP. It’s better than PHP because it’s closer to the data; but it still has the same (huge) number of random-access disk seeks.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
    I have a jquery bug and I've been looking for hours now, I can't
    link Im having trouble converting the html entites into html characters, (&# 8217;) i
    I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
    I am reading a book about Javascript and jQuery and using one of the
    I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
    I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
    I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
    That's pretty much it. I'm using Nokogiri to scrape a web page what has
    I have just tried to save a simple *.rtf file with some websites and

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • SEARCH

    Footer

    © 2021 The Archive Base. All Rights Reserved
    With Love by The Archive Base

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.