BIND - sorting of reverse domain.

Danny Mayer mayer at gis.net
Mon Jul 15 02:30:08 UTC 2002


At 09:56 PM 7/14/02, D. Stussy wrote:
> >You mean you haven't. I repeat there are no KNOWN benefits.  Denial
> >doesn't make it otherwise.
> >
> >>The traversal order for writing out the data to a file, and the traversal
> >>order
> >>for searching the tree to answer queries NEED NOT BE THE SAME.  Nowhere 
> did I
> >>say that they should and in fact, they may not be.
> >
> >So now you want to add code to sort in a different way when writing to a 
> file
> >for no known benefit. You still haven't explained the benefit of what 
> you want
> >to do.  You need a cost-benefit analysis to justify this.
>
>There is no code addition needed for this change - only a rearrangement.
>Therefore, the "cost" (CPU time, file I/O overhead, etc., ...) remains exactly
>the same.

Read your own statement above where you state that "the traversal order for
writing out the data to a file and the traversal order for searching the 
tree to
answer queries NEED NOT BE THE SAME" (your emphasis). So there
is a code addition and not just a rearrangement. There is a cost.

>I have explained the benefit on the newsgroup/mailing list:
>
>Instead of writing the file out with a traversal of "LMR", writing it out 
>with a
>traversal of "MLR" (or equally, "MRL") gains nothing on the output of the 
>file,
>but SAVES when that file needs to be read back in, because upon reading that
>data back in, the natural operation of looping through, reading one 
>element at a
>time and inserting it [back] into a binary tree, has the NATURAL PROPERTY of
>recreating the exact tree from which the data was originally traversed and
>written from.  The SAVINGS:  If the tree was "balanced" when written out, it
>will ALREADY be balanced when read back in and thus - the routine to 
>rebalance a
>tree (a very costly, CPU intensive operation) can be SAFELY BYPASSED.

Do you have any performance numbers to back up your conjecture and if
so what are the numbers?

>The other traversals, including the "LMR" one that happens to also put the 
>zone
>data into domain-name alphabetical/machine order, do not have this 
>property and
>are cost-penalized by needing the rebalancing operation.
>
>The benefit doesn't get simpler than that.

If that's the only consideration.

Danny



More information about the bind-users mailing list