B trees or binary trees or hash tables or wathever sort algo or memory
organisation could be just great if i'd put all my data in the page and
tried or needed to sort it, but i can't do that and don't really need to.
I'm actually searching for a way to load a ton of data from mysql but
avoiding to transfer everything in php memory to work it out.
I think the b tree would be nice if i had a ton of data to sort but i
technically don't have lots of element in my node tree on the same
levels, i could just sort that data in a simple php sort before showing
it :)
Jochem Maas wrote:
I think this might interest you:
http://www.bluerwhite.org/btree/
then again it may make your ears bleed (because of the Maths :-).
Mathieu Dumoulin wrote:
This is more a "How would you do it" than a "How can i do it" question.
Didn't have time to try it, but i want to know how mysql_seek_row acts
with large result sets.
For example im thinking of building a node tree application that can
have dual direction links to nodes attached to different places.
I was wondering if i could actually have two result sets that query
everything sorted by ID (Links and Nodes) then just seek the rows i
need instead of dumping everything in php memory. When i mean large i
mean really large, more than the standard possible 2 mbs of data
allowed by most php servers.
That's where the "how you'd do it" comes into play. I think i'd just
query my tables, loop them but keep only the line (to do a data_seek
later on) and ID in some kind of an hash table or simply an array.
This would make it relatively fast without taking too much memory.
This is my solution, how do you people see it without dumping
everything to memory or by making recursive SQL calls (which will
obviously slow everything down i'm pretty sure)
Mathieu Dumoulin
Programmer analyst in web solutions
mdumoulin@xxxxxxxxxxxxxxx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php