Custom Drupal module code audit and review

I have a custom Drupal module that needs thorough audit, review and perhaps rewrite to make it more scalable. It's a Views plugin that does cross-tabulation. Normal table display in Views only allow one-dimensional data i.e. only columns can be set. My custom module adds cross tabulation or two-dimensional functionality i.e. columns and rows can be set.

The problem is, the current custom module is not scalable. My database has over 13000000 rows and counting, that needs the cross-tabulation presentation to simplify data presentation. Using the table display by Views is fast, but not intuitive. Using this custom module, the display is excellent but lacks on performance. The database server is left with unfinished slow queries. The hosting provider told me that it has something to do with PHP's mysql_close() function but I can't figure it out.

The restriction is, the data cannot be accessed by others, so the winning bidder would have to make good use of his imagination: use Devel Generate, or come up with some made-up data using Excel and import them into MySQL to test the custom module.

No dodgy Indian, Pakistani or anywhere-near-there developers who claim to know-it-all but at last fail-it-all.