DataWarehouse
view release on metacpan or search on metacpan
lib/DataWarehouse.pod view on Meta::CPAN
=item Sales_by_user
=item Sales_by_region
=item and so on...
=back
Moreover, you depend on the end users (or programmers) to actually *use*
these tables, instead of the base fact table.
And you know -- users will always query the base fact table, because it
is easier.
=head1 AGGREGATE NAVIGATOR
The solution to this problem is to make the aggregates invisible: we
will create an intermediate layer, above DBI, that will intercept each
query made against the base fact table, and rewrite it so it will use
the best aggregate table available.
For example:
----------------------------------------------------------
User SQL... Becomes...
----------------------------------------------------------
SELECT SELECT
month, month,
SUM(sales) SUM(sales)
FROM FROM
Sales Sales_by_month
WHERE WHERE
year=2010 year=2010
GROUP BY GROUP BY
month month
----------------------------------------------------------
SELECT SELECT
brand, brand,
SUM(sales) SUM(sales)
FROM FROM
Sales Sales_by_brand
WHERE WHERE
year=2010 year=2010
GROUP BY GROUP BY
brand brand
----------------------------------------------------------
SELECT SELECT
month, month,
brand, brand,
SUM(sales) SUM(sales)
FROM FROM
Sales Sales_by_brand_by_month
WHERE WHERE
year=2010 year=2010
GROUP BY GROUP BY
month, month,
brand brand
----------------------------------------------------------
The aggregate navigator, which performs this transformation, will improve
the performance of the data warehouse transparently.
=head1 WARNING
THIS IS ALPHA SOFTWARE. It could drink your beer and eat your hamster!
=head1 AUTHOR
Nelson Ferraz, C<< <nferraz at gmail.com> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-dw at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DataWarehouse>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc DataWarehouse::Fact
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=DataWarehouse>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/DataWarehouse>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/DataWarehouse>
=item * Search CPAN
L<http://search.cpan.org/dist/DataWarehouse/>
=back
=head1 ACKNOWLEDGEMENTS
=head1 LICENSE AND COPYRIGHT
Copyright 2010 Nelson Ferraz.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
( run in 0.535 second using v1.01-cache-2.11-cpan-39bf76dae61 )