Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id ED038B5F670 for ; Tue, 7 Jun 2011 05:19:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 53165-08 for ; Tue, 7 Jun 2011 08:19:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id E383CB5F66B for ; Tue, 7 Jun 2011 05:19:31 -0300 (ADT) Received: by fxm17 with SMTP id 17so2909700fxm.19 for ; Tue, 07 Jun 2011 01:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yMDG+Fpg0woJWnUfxguWia+sGe5n7ckCHsmstQauT4o=; b=T0cP1cfgmsxI2elGPbiMAfwba1BSyGRsKOBeAqrvqMXjIvMNI2OnQwJs/cj5FG3DY+ 62hYh6O9oS8G1mFNtlPpCyVvxc5QSsY9xoXSQvIxu77sO/bILvC5vlxyfzNMJcO1Aoo6 KdFWAbVaTT+AZpc8Qtn2+Ve2ADUyZPlrdynfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=dcN0BLvb17u/vsJ5MAovPStzcm07elVVqpHna2y7m53Ys/cVxuQsk5CbddXX1ftNJa U25t3ZHgmcroSi+smQA3gBoVmUTl3WBcygK0WWNOwIGjxjQTQDQu9CCD0WeCgTULCvth +/B+XDiTyGQuXRi/br2J8UjVWGZrVRkwr+Nro= Received: by 10.223.27.18 with SMTP id g18mr6363177fac.52.1307434771209; Tue, 07 Jun 2011 01:19:31 -0700 (PDT) Received: from [10.64.1.26] ([213.108.72.250]) by mx.google.com with ESMTPS id y7sm1621302fak.31.2011.06.07.01.19.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Jun 2011 01:19:29 -0700 (PDT) Message-ID: <4DEDDF11.2020801@gmail.com> Date: Tue, 07 Jun 2011 11:19:29 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Josh Berkus CC: pgsql-performance@postgresql.org Subject: Re: 8.4/9.0 simple query performance regression References: <4DED4A87.7000901@agliodbs.com> In-Reply-To: <4DED4A87.7000901@agliodbs.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.345 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201106/44 X-Sequence-Number: 43977 07.06.11 00:45, Josh Berkus написав(ла): > All, > > Just got this simple case off IRC today: > > 8.4.4 > This plan completes in 100ms: > Filter: (NOT (hashed SubPlan 1)) > 9.0.2 > This plan does not complete in 15 minutes or more: > Filter: (NOT (SubPlan 1)) "Hashed" is the key. Hashed subplans usually has much better performance. You need to increase work_mem. I suppose it is in default state as you need not too much memory for hash of 70K integer values. BTW: Why do it want to materialize a result of seq scan without filter. I can see no benefits (or is it more narrow rows?) Best regards, Vitalii Tymchyshyn