Well, I was figuring you would only store children's node id, and only one deep (ie, immediate children). Unless each node in your application is expected to have an extreme amout of immediate children, I don't see that it would be a problem.

Let's see... Generously, 4 bytes to store a node id and 100 immediate children on avg. gives only 400 extra bytes per node. That's not a huge amount and most nodes on PM have far less than 100 immediate children. I don't recall any I've seen with greater than 30. That's only 120 extra bytes per node.

Not sure how many, if any, DB's support variable length data-arrays but you could always use a blob and pack it yourself. A little more work, but not as much as an exhaustive search of the DB for every node with a parent ID of xx.

Don't get me wrong, I understand your point and I know that it might not be worth it in some cases. I just don't think that most cases (and this one in particular) would be that hurt by the cost and I think the benefit would outway the small cost of extra size. 'Tis, of course, the Implementator's call; and the point is moot in this case unless we feel like submitting a patch to EveryDevl.com. :-)

Disclaimer: It is quite possible (likely?) that I am mistaken and/or am relying on an invalid assumption. I don't know a great amount about the Everything engine, nor even the general implementation of such systems. Therefore, I provide no warranty for this post, expressed or implied, for fitness of use or merchantability or anything else. I disavow all knowledge of my own actions and assume no responsibility for anything. ;-)

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.


In reply to (bbfu) (expensive children) Re(4): Will this break your program? by bbfu
in thread threaded display of replies by epoptai

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.