The last thing we need to do for Nile dot com is to generate
reports to find out how well we're doing.
There are two approaches to generating reports.
Approach 1
- Write a very specific SELECT statement
that picks out the specific items wanted and summarizes
and sorts them.
- Your script then need only format the returned
data into HTML pages.
- The database does all the work.
- Drawbacks:
- The database could become a bottleneck.
- Advanced SELECTs may use non-standard SQL,
hindering portability.
Approach 2
- Simply perform a SELECT * WHERE ...
- Grab every row that matches our criteria.
- Use no fancy SELECT features.
- Let the Perl script do the work of
summarizing and sorting.
- Lessens the burden on the database.
- More of a burden on the Perl script.
- Perl is an especially good language for text processing.
Which approach you choose will depend on where the bottleneck
is likeliest to occur.
Review
Which SQL command is used to generate reports?