alienhuman has asked for the wisdom of the Perl Monks concerning the following question:
This isn't strictly a perl question, it's more a db design question--but I'm going to be using perl eventually to get, insert and manipulate this data. If this is inappropriate for PM, please delete this writeup.
Consider:
I'm storing the information about who ran what report when in a single table (this is a legacy). One of the fields is an ID that is generated using a uid, a timestamp and a varying list of whitespace delimited strings that denote various report options.
For instance, one report id might be something like "uid333 200309091230 H J Krm 3 2003-6-30" while another may be "uid333 200309091231 A L foobar 4". So you can see that while these ids have something in common, they also have a lot that's not in common. The other columns in the table are identical. The id is what is used to determine if the client has run the report previously within a specified time limit, and they are charged less for the subsequent runnings.
For example, if I run the report that corresponds to "uid 200309091230 H J Krm 3 2003-6-30" in the morning, and again after lunch, the report running script compares the ids (generated partially from the report options) and if there is a match, compares timestamps (data in another column) and charges accordingly.
My question is this: does anyone have any thoughts about how to store the report options in such a way that eliminates this cumbersome report id string? How does one deal with data that is loosely similar?
AH
As a p.s., the # options for a report are not predictable. In other words, it's not enough to know that I ran a XYZ report at 2pm. You must know that I ran an XYZ report with the values 1,1,2,3,5,8. Which is entirely different than the XYZ report with values 5,8,13 or just 21,baz.
p.p.s. the report running script currently does some chopping of the report id in various places and some pattern matching to determine a match.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suggestions on storing loosely similar data
by Roger (Parson) on Sep 10, 2003 at 23:50 UTC | |
by zby (Vicar) on Sep 11, 2003 at 07:40 UTC | |
by alienhuman (Pilgrim) on Sep 12, 2003 at 15:31 UTC | |
by zby (Vicar) on Sep 12, 2003 at 16:22 UTC | |
by bean (Monk) on Sep 11, 2003 at 03:30 UTC | |
|
Re: Suggestions on storing loosely similar data
by adrianh (Chancellor) on Sep 10, 2003 at 22:10 UTC |