Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YGraK-00047M-Dl for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Jan 2015 16:04:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YGraJ-0004CQ-Uq for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Jan 2015 16:04:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YGraJ-0004CK-8S for pgsql-bugs@postgresql.org; Thu, 29 Jan 2015 16:04:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YGraG-0006Wh-Fx for pgsql-bugs@postgresql.org; Thu, 29 Jan 2015 16:04:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t0TG4elI006518; Thu, 29 Jan 2015 11:04:40 -0500 From: Tom Lane To: Heikki Linnakangas cc: Michael Paquier , olaf.gw@googlemail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12694: crash if the number of result rows is lower than gin_fuzzy_search_limit In-reply-to: <54CA57B9.3070602@vmware.com> References: <20150128181243.2579.80775@wrigleys.postgresql.org> <54CA3EB5.3030804@vmware.com> <4773.1422545177@sss.pgh.pa.us> <54CA57B9.3070602@vmware.com> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 29 Jan 2015 17:54:33 +0200" Date: Thu, 29 Jan 2015 11:04:40 -0500 Message-ID: <6517.1422547480@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Heikki Linnakangas writes: > On 01/29/2015 05:26 PM, Tom Lane wrote: >> Another, even simpler fix would be to just move the startScanKey() >> call loop to before the "if (GinFuzzySearchLimit > 0)" block. >> Is there a particular reason why it's a good idea to do things in >> the current order? It almost looks like a patch application error >> as it stands. > The code in startScanKey() uses the predictNumberResult estimates, which > the loop modifies, so it would change how that behaves. Oh! Sorry, I'd missed looking at what the qsort comparator did. > I'm not sure if > it would actually be better that way though; it's not clear to me how > the fuzzy search limit should interact with the fast scan code. Yeah, it might be better but it's not very clear what the implications are. Probably shouldn't touch that as part of an emergency bug fix. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs