I’m importing data from a CSV file, one line per record. The import method tidies up the data before creating each new record. If I find a duplicate, I ask if it’s OK to add it (they’re rare, but some duplicates are permissible).
So I have an ItemExists method, which is
$sel:= ds .items. query (“date = :1 and amount = :2 and balance = :3 and desc = :4”\
[items]date; [items]amount; [items]balance; [items]desc)
It turns out that the import spends about 99% of its time in this method.
Before I spend time re-inventing the wheel, is there a generally-approved and fast method of finding duplicates? I could add a hash of some sort to each record, I suppose: is there a better way?