Wonderfully rich reply - thanks.
But I think, maybe, some miscommunications.
To put it into similar terms:
- I have companies (ex: ABC Inc, XYZ Inc, ...) and I have product classes (ex: pens, liquid nitrogen, desk chairs, fork lifts, plywood, fourier-transform-infrared-spectrometres,...)
- yes, one of the attributes of a company is its size_factor
- a product_class has no attributes
- Someone has canvassed ~30,000 companies and asked them:
- do you belong to industry group X (ex: more than X employees)?
- do you belong to industry group Y (ex: located in Ontario, California)?
- do you belong to industry group Z(ex: less than 5 years in business)?
- do you use product class A?
- do you use product class B?
- do you use product class C?
- ...and so on, for ~12,000 product classes.
So, all the info could have been put into one big 30,000 row x 12,000 column table, and then just query
SELECT company WHERE (group_a = 1 and product_class_C = 1);
But I still have to repeat that query for 350 combinations of group and product_class.
Originally, there was only going to be a requirement to produce a half-dozen cross-references at a time. So, came the idea of the reverse-index tables - easy and quick to identify the ten tables needed, find the intersection of these little <= 10Kb tables that are often only a few hundred rows long, and sum the size-factors.
But THEN someone said "Hey, that's great - and fast - here, do that for this report of 350 intersections."
Update: I appear to have at least partially answered my own question - even if it was done the other way, there'd still be 350 queries to run, except each one on a full 30k-row x 12k column table!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.