Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re^3: Efficiently Walking Large Data Structures Stored in Multiple Tables

by aquarium (Curate)
on Feb 29, 2004 at 21:51 UTC ( [id://332710]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Efficiently Walking Large Data Structures Stored in Multiple Tables
in thread Efficiently Walking Large Data Structures Stored Across Multiple Tables

whilst recursive queries are fun, as you can do a whole lot of lookups and join them together in one sql statement; they do take a long time to run, significantly degrading performance. The flatter you can make the structure of the database, especially the often used tables, the faster the retrieval -- unfortunatelly this also means you end up with extra effort in maintaining the tables, as they start having redundant data (not fully normalised).
  • Comment on Re: Re^3: Efficiently Walking Large Data Structures Stored in Multiple Tables

Replies are listed 'Best First'.
Re^5: Efficiently Walking Large Data Structures Stored in Multiple Tables
by adrianh (Chancellor) on Feb 29, 2004 at 22:29 UTC
    whilst recursive queries are fun, as you can do a whole lot of lookups and join them together in one sql statement; they do take a long time to run, significantly degrading performance.

    Take another look at the bits of the thread on using a nested set representation for hierarchical data. Flat structure, normalised data and fast queries. Some performance degradation on insertion, but since people usually read and update a lot more than they insert it's rarely an issue.

    As for recursive queries - the old chestnut about premature optimization comes to mind. That and the fact that several databases have explicit support for hierarchical structures and appropriate optimisations to make access to those structures efficient - even if they set C.J. Date spinning in his grave ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-23 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found