On Apr 29, 2011, at 2:09 PM, Kevin Ball wrote:

> On Fri, Apr 29, 2011 at 2:06 PM, Guyren Howe <[email protected]> wrote:
> On Apr 29, 2011, at 2:03 PM, James Miller wrote:
> 
> > I would agree with Kevin.  You're likely swapping pretty quick with only 
> > 512MB on the machine, especially if you're expecting to return 3500 rows -- 
> > did you try a larger slice?
> >
> > Try running `free -m` on the slice to see your current memory state while 
> > that monster query is running.
> 
> I did try a 1GB slice, which made no difference whatever.
> 
> I just found that removing one of the constraints — which would, if anything, 
> give me more rows — cures the problem.
> 
> So I have a workaround. But there’s an ugly issue lurking there somewhere.

> Hmm.. can you give more info on which constraint cures the problem?  I wonder 
> if you end up getting rows back in a different order, and so either do or 
> don't sort?  Are you using any ordering constraints?

Actually, the constraint involved another join as well.

The schema looks like:

role <- roles_users -> users -> order_transactions
                                                   -> accounts

The constraint and join I removed was on the role name. The other constraint is 
on order_transactions.creation_date. There is only one users record involved. 
The 3,500 records are the order_transactions.

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to