I'm writing a Rails app that does a lot of calculations on imported pay-per-click advertising data. The imported logs, which contain records about impressions, clicks, conversions, etc. are all stored in one massive log table, which then needs to be joined with a conversions table to calculate cost per conversion, conversion rate for each campaign. Doing in in MySQL seems to be fast enough (400ms), but is there any reason to do this in the application rather than on the database layer?
Thanks!