Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 448E02E005A for ; Fri, 9 May 2008 04:53:27 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 11703-04 for ; Fri, 9 May 2008 04:53:16 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by developer.postgresql.org (Postfix) with ESMTP id D69882E0050 for ; Fri, 9 May 2008 04:53:19 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id n4so1616303wag.5 for ; Fri, 09 May 2008 00:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=jli5zQhc32qC5Lv8D24wMWJUxBO9xLoraJXJuOHi+mU=; b=CzqqlXsJt0GtmkHDccA+cEHZyRgvO2o3akkffXm1M5ofLRIf5RiVEEDsswBZpEqrxyvjLRys8lNCOffZUWhixb2OaUbcoOKePa5PLHEzxIIG275QSFjyG/e1U6/dmMGxwsXF465IXVgrLFREeoXXC+x679kzkR7e1/lRsskIwGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TVdTtF8K82SovJ7l+Bo0Qx1xDRZUmmBnE+NiQ89xg7o3c5PPiiK91+zyxda3UHSMhBip0hjmPoDOww3cZyk6hgytcrhmVPzb6P3bN0hQYCFEAT2ofBPs2bg2P3aknjNaar5zZP/A8R595Iz5kxjqkstsLhV+6lTZqs3/3GHlr7c= Received: by 10.115.111.1 with SMTP id o1mr3972507wam.87.1210319598785; Fri, 09 May 2008 00:53:18 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Fri, 9 May 2008 00:53:18 -0700 (PDT) Message-ID: Date: Fri, 9 May 2008 01:53:18 -0600 From: "Scott Marlowe" To: "Antoine Baudoux" Subject: Re: multiple joins + Order by + LIMIT query performance issue Cc: "Shaun Thomas" , "pgsql-performance@postgresql.org" In-Reply-To: <17BEF74A-6B90-4BAD-8612-3548B616AFC7@taktik.be> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <938EC908-FB9A-4BFA-950A-053BE3C87085@taktik.be> <1210092220.14833.33.camel@berners-lee> <1210098273.14833.55.camel@berners-lee> <17BEF74A-6B90-4BAD-8612-3548B616AFC7@taktik.be> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/136 X-Sequence-Number: 30104 On Fri, May 9, 2008 at 1:18 AM, Antoine Baudoux wrote: > Ok, I've tried everything, and the planner keeps choosing index scans when > it shouldnt. > > Is there a way to disable index scans? You can use "set enable_indexscan off;" as the first command I've had one or two reporting queries in the past that it was a necessity to do that before running certain queries on very large datasets where a seq scan would kill performance.