Received: by 10.224.181.75 with SMTP id bx11mr2022591qab.7.1345814549527; Fri, 24 Aug 2012 06:22:29 -0700 (PDT) X-BeenThere: rose-db-object@googlegroups.com Received: by 10.224.210.4 with SMTP id gi4ls2495368qab.2.gmail; Fri, 24 Aug 2012 06:22:29 -0700 (PDT) Received: by 10.224.223.77 with SMTP id ij13mr2564056qab.1.1345814548991; Fri, 24 Aug 2012 06:22:28 -0700 (PDT) Received: by 10.224.223.77 with SMTP id ij13mr2564053qab.1.1345814548864; Fri, 24 Aug 2012 06:22:28 -0700 (PDT) Return-Path: Received: from mail-qc0-f170.google.com (mail-qc0-f170.google.com [209.85.216.170]) by gmr-mx.google.com with ESMTPS id mx24si1937073qcb.3.2012.08.24.06.22.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 06:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of sirac...@gmail.com designates 209.85.216.170 as permitted sender) client-ip=209.85.216.170; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of sirac...@gmail.com designates 209.85.216.170 as permitted sender) smtp.mail=sirac...@gmail.com; dkim=pass header...@gmail.com Received: by mail-qc0-f170.google.com with SMTP id d42so2272805qca.1 for ; Fri, 24 Aug 2012 06:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=WDzNPzs238XEIytwkVIAL3am9PX0vJEgWsIX6zMxvv0=; b=tCZBSDSwpg3yjMeA3AnjBEBQwtIVj6kFBKkznA/sNCVj9cWvwR5YCcOqV/3MOiEatN krJ3sz0nBgctOjsgx2HpmrHi4J3wRkhNHZD9KljWogjP/ofk2z5kb5OL0dTWr99iJnxw yrtZ8ZqnOniqiaxM+I4f02ue17fWvq9ES3TVvN6VXVZ9cjS1o695ux7V/8m/K6DsCxFB ntsThyPwEZKSYzuaN05BJaP1CMqbU2gZa1FwHWm72b6vwpTKthcIishThZwz5eCPF81r 0yAPYvClI+0FOF0MMhUR7G1rJjM0F2rplk9kl+Uh+Es6PCpBEwZGfHYe3jdCOmBwbKi/ LOxQ== Received: by 10.224.180.70 with SMTP id bt6mr8653926qab.91.1345814548682; Fri, 24 Aug 2012 06:22:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.37.169 with HTTP; Fri, 24 Aug 2012 06:22:08 -0700 (PDT) In-Reply-To: References: <3cfbb716-19ff-4db7-b396-79fdc7a36f0d@googlegroups.com> From: John Siracusa Date: Fri, 24 Aug 2012 09:22:08 -0400 Message-ID: Subject: Re: (limit_with_subselect => 0, limit => 1) doesn't affect generated SQL To: rose-db-object@googlegroups.com Content-Type: text/plain; charset=UTF-8 On Fri, Aug 24, 2012 at 9:12 AM, kirill wrote: > The problem is that database freezes when i run it. That sounds like a different problem. Or maybe it's just a really slow query due to database size and available memory and other server resources? > But when i copy the query and manually run it in mysql console adding ' > limit 10;' it gives me the right results in "0.00 sec". Why are you explicitly disabling the subselect limit? Does MySQL not support it? > The only option i have is to generate sql into a string and then manually > append limits i need? That query would be incorrect. You'd be limiting it to 10 rows, not 10 Offers. If the first Offer has 7 associated MarketBidsRecommended objects and the second has 5, a "LIMIT 10" clause on the query would result in one Offer with its 7 associated MarketBidsRecommended objects and a second Offer with 3 of its 5 associated MarketBidsRecommended objects. -John