What this driver does:
Measurements
- SQL exec performance (measured just before and immediatelly after
execute... calls; also the number of total calls and completed
calls of the SQL phrase, per connection).
- FETCH performance (ResultSet) (the difference between times of the last
next()/previous()... call and the first one).
- TX performance (measured from the first update statement, number of
statements executed whithin the transaction).
- Connection performance, (measured both global and per connection -
#statements, #exceptions, retention time per connection, max opened connections,
etc). From this statistics you should be able to configure correctly the pools
(if you use any).
- Exception reports (the stack trace, how often they appeared).
Code problems
- Deprecated methods usage.
- Accessors - we named the accessor == the routine executing a certain SQL phrase.
When we find the same SQL phrase in different routines, this means that there's
a certain level of code duplication. This may be not so good ...
- Use of not recommended syntax for the SQL phrases. For
instance, instead of using
SELECT * FROM mytable , you should use
SELECT mycol1, mycol2, mycol3 FROM mytable . The reason is obvious.
Detected problems & tips
- Resources are not closed (both resultsets and statements). It's maybe the
most useful feature.
- Connections are not closed.
- Cache recommandations. In some applications, it may be a good ideea to cache
some dictionary tables instead to get it each time you need it. If the same
resultset is received for a certain period of time passing the same parameters,
this SQL may be eligible for cache.
- When you use pools, in certain configurations and for special kind of
applications, and when connection warnings are never cleared, you may have the
surprise to see the program consuming more and more memory. This is also
analyzed by the driver.
- Inconsistent use of AUTOCOMMIT. We cannot say what the developer wanted to
do, but when the driver detects the same usage of some SQL phrase with a
different AUTOCOMMIT setting, it will warn the user.
- Inconsistent use of ISOLATION LEVEL. Same mechanism is in place here. If
you reach the same point in your program but with another TX ISOLATION LEVEL
set, it's almost for sure a mistake (somebody set it to some level and forgot it like that).
- Monitors the usage of 'heavy' TX ISOLATION LEVEL (for SERIALIZABLE and
REPEATABLE READ).
- Monitors the usage of updatable result sets. This kind of resultset has the
disadvantage that it places locks on the server side. If the update is driven by
some interactive application, it may be a major bottleneck.
- Unrecommended FETCH strategies. Warns if you use, for instance, reverse fetch
instead of using a correct
ORDER BY clause and a normal fetch.
- ... and more ...
So what will be in the near future ?...
- Hints for parallel execution
- More log options (for now only plain files and stderr/stdout are supported -
my plan is to support log4j and java.util.logging.* as well as a database)
- More config options (xml, database)
- A tool that will interpret the records gathered by this driver and will let
you visualize the output.
- More languages added. For now, only English is used (somebody should
translate the resource files in German, French, Italian ...).
Of course, if you have new ideas, I would more then happy to hear them.
|