I suggest reading the SQL book that I recommended in another part of this thread. It will cover "views". Your application is "read only" so something like that is completely appropriate.

I am no SQL guru, but SQL has several types of table joins where 2 or more tables can be combined into a single "view" which is like a temporary table with the columns of both tables, but read only. On all tricky SQL questions, I defer to wiser Monks than myself.

However, if you can do the SQL, it can make the Perl code easier because you could just get all the results at once.

There is sometimes a tradeoff between Perl voodoo and SQL voodoo. I had one SQL query that I worked on very hard and it worked, but it took 15 minutes. Then I "simplified it" into 1,500 SQL queries and it took only 15 seconds. But I used some serious "Perl-kung-foo" on it!

From what I understand so far, your app is not performance or memory limited. Find some combination of stuff that works for you! Any of the SQL or Perl code that we've discussed so far will be just fine.


In reply to Re^5: Help with MySQL SELECT into multidimensional array by Marshall
in thread Help with MySQL SELECT into multidimensional array by btongeorge

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.