in reply to Re: Best way to match a hash with large CSV file
in thread Best way to match a hash with large CSV file
The DB, if it is built with SQLite, will be so performant that it is great!
That is a very bold, some would say rash, claim. Given you appear not to understand the problem.
At some point in the run of a program the OP has a hash containing 5000 key/value pairs. At that same point in time on disk, there is a CSV file containing 120,000 lines of 10 fields.
The task is, given the hash and an integer (that represents a field within each record), to produce an output file on disk that contains that subset of the input file where field 1 (0-based) of the record exists as a key in the hash, with the value of the field identified by the number, as its value.
What you are suggesting is that in less than 6 seconds you can:
select * from table where field1 eq ? and field? eq ?;
(For strict compliance, re-order the retrieved records into input file order before output.)
Good luck!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Best way to match a hash with large CSV file
by Marshall (Canon) on Nov 06, 2011 at 12:34 UTC | |
by BrowserUk (Patriarch) on Nov 06, 2011 at 12:36 UTC | |
by Marshall (Canon) on Nov 06, 2011 at 13:27 UTC | |
by BrowserUk (Patriarch) on Nov 06, 2011 at 13:42 UTC | |
by Marshall (Canon) on Nov 06, 2011 at 13:58 UTC |