Performant BOM explosion
Lars Johansson
lasse at 11dim.se
Mon Apr 14 11:45:19 UTC 2025
I'm writing my first 'real' D-program.
The input are two mySQL tables: one with parent-child nodes
(800000), one with 70000 topnodes i.e. do not have a parent.
For each of the top nodes I like to do a full BOM explosion
(about 1.8 million tree nodes).
So far I have managed to read the input tables into two arrays.
My assumption was using an associative array for the parent-child
table I could do the BOM explosion by itterative seaching the AA
starting from the top nodes.
Now when I look at the AA in the documentation I doubt it is
possible to do this with an AA.
I take one topnode find all nodes with the topnode as parent,
then for each of those find nodes that have the child as parent
and so on until all top nodes are processed.
But I do not find a way to do the search for children in a
performant way.
I would be very obliged if anyone can advise a way to create the
complete BOM tree.
p.s.
My explanation is a simplification, but an advise is a good start.
More information about the Digitalmars-d-learn
mailing list