Hierarchical Data in MySQL is fast to retrieve?

Posted by ajsie on Stack Overflow See other posts from Stack Overflow or by ajsie
Published on 2010-04-18T22:59:48Z Indexed on 2010/04/18 23:03 UTC
Read the original article Hit count: 298

Filed under:
|
|

i've got a list of all countries -> states -> cities (-> subcities/villages etc) in a XML file and to retrieve for example a state's all cities it's really quick with XML (using xml parser).

i wonder, if i put all this information in mysql, is retrieving a state's all cities as fast as with XML? cause XML is designed to store hierarchical data while relational databases like mysql are not.

the list contains like 500 000 entities. so i wonder if its as fast as XML using either of:

Adjacency list model

Nested Set model

And which one should i use? Cause (theoretically) there could be unlimited levels under a state. And which is fastest for this huge dataset?

Thanks!

© Stack Overflow or respective owner

Related posts about Xml

Related posts about mysql