[Nitro] OG vs Active Record

Bill Kelly billk at cts.com
Tue Aug 21 00:17:28 EDT 2007

From: "Jonathan Buch" <john at oxyliquit.de>
>> Dunno if this is useful to anyone; but so far it's been possible for
>> me to use Og to do most of the work, and just write custom queries as
>> I need them.
> you're correct in that you need custom queries sometimes, but that is
> quite horrible there within the model.  ;)

If you thought that was ugly, you should have seen the "optimized"
queries.  <grin>

> May I say that VIEWs are really useful?  Please, also consider my Tip
> on http://www.oxyliquit.de/tip/31 , life can only go better.  :P
> I agree on that it only 'moves' the problem, but...  I think it's
> just a whole lot cleaner.

Thanks for the tip.  I had considered using VIEWs at one point, but
it's nice to see an example.

Ultimately, despite my best attempts at optimizing my queries, I was
not to achieve enough performance, once the tables started getting
millions of rows.  (I studied postgresql's analysis; it was using
the indexes when it should have been.)

Many of my queries started out as being very simple statements in
Og... just a few lines of ruby.  Some of them grew to 50 or 100 lines
for the fastest versions I came up with.  I got about an order of
magnitude speedup over Og... but it still wasn't enough.

Grisly details: http://rubyurl.com/XsB



More information about the Nitro-general mailing list