|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Handling large datastore searchIn case I have a huge datastore (10000 entries, each entry has like 6 properties), what is the best way
to handle the search within such a huge datastore, and what if I want to make a generic search, for example you write a word and i use it to search within all properties I have for all entries? Is the conversion to XML a good solution, or it is not? sorry for being new to web development, and python. Thanks in advance. -- -------------------- Regards, Ahmed Barakat http://ahmedbarakat83.blogspot.com/ Even a small step counts -- http://mail.python.org/mailman/listinfo/python-list |
|
|
Re: Handling large datastore searchAhmed Barakat wrote:
> In case I have a huge datastore (10000 entries, each entry has like 6 > properties) Can you show some sample entries? That way we can get an idea how your datastore looks like. By the way, 10000 doesn't sound that much. At work I create python programs which do data processing and ofter have this much entries in a dictionary, often more. > Is the conversion to XML a good solution, or it is not? XML is meant to be an exchange format; it is not designed for storage or fast retrieval. Greetings, -- "The ability of the OSS process to collect and harness the collective IQ of thousands of individuals across the Internet is simply amazing." - Vinod Valloppillil http://www.catb.org/~esr/halloween/halloween4.html -- http://mail.python.org/mailman/listinfo/python-list |
|
|
Re: Handling large datastore searchAhmed Barakat wrote:
> In case I have a huge datastore (10000 entries, each entry has like 6 > properties), what is the best way > to handle the search within such a huge datastore, and what if I want to > make a generic search, for example > you write a word and i use it to search within all properties I have for all > entries? > > Is the conversion to XML a good solution, or it is not? > > sorry for being new to web development, and python. > > Thanks in advance. > > development, and there's no need to be apologetic for being new anyway. One person's "huge" is another person's "pretty large." I'd say 10000 items is pretty small if you're working on the desktop, as you can readily hold all the data in "memory." I edit text files bigger than that. But I'll assume your data really is huge, or will grow to be huge, or is an environment which treats it as huge. When you're parsing large amounts of data, there are always tradeoffs between performance and other characteristics, usually size and complexity. If you have lots of data, you're probably best off by using a standard code system -- a real database. The developers of such things have decades of experience in making certain things fast, reliable, and self-consistent. But considering only speed here, I have to point out that you have to understand databases, and your particular model of database, pretty well to really benefit from all the performance tricks in there. Keeping it abstract, you specify what parts of the data you care about fast random access to. If you want fast search access to "all" of it, your database will generally be huge, and very slow to updates. And the best way to avoid that is to pick a database mechanism that best fits your search mechanism. I hate to think how many man-centuries Google has dedicated to getting fast random word access to its *enormous* database. I'm sure they did not build on a standard relational model. If you plan to do it yourself, I'd say the last thing you want to do is use XML. XML may be convenient way to store self-describing data, but it's not quick to parse large amounts of it. Instead, store the raw data in text form, with separate index files describing what is where. Anything that's indexed will be found rapidly, while anything that isn't will require search of the raw data. There are algorithms for searching raw data that are faster than scanning every byte, but a relevant index will almost always be faster. DaveA -- http://mail.python.org/mailman/listinfo/python-list |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |