Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: (bbfu) (expensive children) Re(4): Will this break your program?

by Corion (Patriarch)
on Apr 30, 2001 at 00:44 UTC ( [id://76505]=note: print w/replies, xml ) Need Help??


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

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.

The two things I've learned about relational databases are :

  • Don't create artificial data structures within blobs, the DB is better at handling them than you are.
  • If you have a many-to-many relationship (== variable length array in Perl), use another table with the relations in it.
In this case, this would mean having a relation table, isChild, which would consist of two columns, parentID and childID. If you have a database with triggers, you can maintain the integrity with stored procedures, if not, you can at least handle node deletions gracefully with a small SQL script.

  • Comment on Re: (bbfu) (expensive children) Re(4): Will this break your program?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2025-07-10 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.