Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uga9x-0000Ci-2Q for pgsql-performance@arkaria.postgresql.org; Sun, 26 May 2013 12:34:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uga9w-00048e-Dk for pgsql-performance@arkaria.postgresql.org; Sun, 26 May 2013 12:34:48 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uga9u-00048V-9f for pgsql-performance@postgresql.org; Sun, 26 May 2013 12:34:46 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uga9h-0006KC-3g for pgsql-performance@postgresql.org; Sun, 26 May 2013 12:34:44 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uga9c-0000eE-Ry for pgsql-performance@postgresql.org; Sun, 26 May 2013 14:34:28 +0200 Received: from p508571e2.dip0.t-ipconnect.de ([80.133.113.226]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 May 2013 14:34:28 +0200 Received: from shortcutter by p508571e2.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 May 2013 14:34:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Robert Klemme Subject: Re: Advice on optimizing select/index Date: Sun, 26 May 2013 14:34:10 +0200 Lines: 19 Message-ID: References: <39DB3954-1DDF-4551-B794-E65AF48F2C96@autouncle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p508571e2.dip0.t-ipconnect.de User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: <39DB3954-1DDF-4551-B794-E65AF48F2C96@autouncle.com> X-Antivirus: avast! (VPS 130526-0, 26.05.2013), Outbound message X-Antivirus-Status: Clean X-Pg-Spam-Score: 0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 22.05.2013 16:37, Niels Kristian Schj=F8dt wrote: > In reality the adverts that are selected is all 'active'. I'm hence > wondering if it theoretically (and in reality of cause) would make my > query faster if I did something like: "SELECT .* FROM cars LEFT > OUTER JOIN adverts on cars.id =3D adverts.car_id WHERE cars.brand =3D > 'Audi' AND adverts.state =3D 'active'" with a partial index on "INDEX > adverts ON (car_id) WHERE state =3D 'active'"? That sounds reasonable to do. If you have enough bandwidth on your=20 production database why not just try it out? Otherwise you could do=20 this on a test database and see how it goes and what plan you get. Btw.=20 did you look at the original plan? Cheers robert --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance