in reply to Re: Alternative to querying a database to save time
in thread Alternative to querying a database to save time
You -could- do this with Perl, problem is you'll need to load all your data into memory to do efficient searching, and unless you want to keep it there (which will eat hundreds of MB of RAM minimum...), you'll have to recreate the hash every time you want to do a lookup, which probably won't be that fast either.As far as I understood, he just needs the set of abstracts from a static DB for every set of <file1, file2> that are both associated with one of the keys in file1 and match one of the terms in file2. To do that, he could fetch the abstracts for each of the keys, do the searching in Perl and depending on the result either output the abstract or just throw the record away. That way he only has to keep one record at a time in memory and would likely be faster than with MySQL's horribly inefficient regexen, not to mention one separate query per key times search terms.
As always, giving us samples of your data is going to help if you want specific queries / code.True. The Stackoverflow link has some snippets though, if not the clearest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Alternative to querying a database to save time
by smandape1 (Acolyte) on Dec 29, 2011 at 19:36 UTC | |
by Anonymous Monk on Dec 29, 2011 at 20:34 UTC | |
|
Re^3: Alternative to querying a database to save time
by smandape1 (Acolyte) on Dec 29, 2011 at 19:39 UTC |