We don't bite newbies here... much | |
PerlMonks |
Re: Basic Perl trumps DBI? Or my poor DB design?by dragonchild (Archbishop) |
on Oct 25, 2004 at 00:49 UTC ( [id://402115]=note: print w/replies, xml ) | Need Help?? |
This isn't a Perl question so far as it's a relational database design question. So, I'll treat it as such.
You have two different tables:
So, given the info you have, I would design tables as such:
Then, I would create the query as such:
I would call it as such:
Depending on the power of your database server, this should run in under 3-5 seconds, given the numbers you mentioned. I should warn you that my experience is primarily with MySQL 4.1.x, so I don't have a lot of knowledge of the 3.x series. I would also turn on query_caching, which will help a bunch with the reporting. I personally have found a 90% improvement with certain kinds of reporting when I turned it on. Being right, does not endow the right to be rude; politeness costs nothing.
In Section
Seekers of Perl Wisdom
|
|