Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 297B89F9B25 for ; Fri, 17 Aug 2007 04:28:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 98459-10 for ; Fri, 17 Aug 2007 04:28:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 1EF359F9A78 for ; Fri, 17 Aug 2007 04:28:46 -0300 (ADT) Received: from [10.11.12.6] (helo=xxx.home.depesz.com) by depesz.com with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1ILwG8-0006xn-KX; Fri, 17 Aug 2007 09:28:43 +0200 Received: from depesz by xxx.home.depesz.com with local (Exim 4.63) (envelope-from ) id 1ILwG7-0001xB-NZ; Fri, 17 Aug 2007 09:28:39 +0200 Date: Fri, 17 Aug 2007 09:28:39 +0200 From: hubert depesz lubaczewski To: Frank Schoep Cc: pgsql-performance@postgresql.org Subject: Re: Bad planner decision - bitmap scan instead of index Message-ID: <20070817072839.GA6598@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/173 X-Sequence-Number: 26303 On Thu, Aug 16, 2007 at 06:14:02PM +0200, Frank Schoep wrote: > The (example) query: > SELECT * FROM movies WHERE letter = 'T' ORDER BY name ASC LIMIT 100 > OFFSET 1900; try to change the query to: SELECT * FROM movies WHERE letter = 'T' ORDER BY letter ASC, name ASC LIMIT 100 OFFSET 1900; depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)