I have a controller that returns JSON or XML from a fairly complex relational query with some controller logic as well.
I\'ve tuned on the DB side by refining my query a
Your DB number is time actually spent in the database, but not loading ActiveRecord objects.
So if you're loading 168,000 ruby active_record objects to render then as JSON, this would explain your 550 ms (or more!)