A couple of thoughts.

  1. Your entire 30,000 companies by 12,000 products classes and 500 groups can be stored in a flat file in 45 MB.

    This can be slurped into memory or scanned record by record. Either way, the results of your 350 queries can be determined in ~100 seconds.

    The data is stored 1-bit per yes/no answer. 12,500/8 * 30,000 == 44.7 MB.

    The code to generate a test DB, generate 350 test queries, and run them, is 50 lines. (No formatting of the report is done.)

  2. If this is survey data, it is static once the survey is finished. So why does it matter how long it takes to generate the report?

    You only need run the queries once and store the results for reuse each time the web page is needed. Or better still, generate and store the html.

    If you want the viewer to be able to sub-select the results produced for them, then generate a separate html snippet for each of the 350 categories and merge the required bits once you know what they want.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: Feasability of quick generation of complex report from large db? by BrowserUk
in thread Feasability of quick generation of complex report from large db? by punch_card_don

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.