Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoHm-0008LV-1L for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jan 2013 17:57:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TuoHk-0006Oo-D5 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jan 2013 17:57:24 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoH5-0005oD-7G for pgsql-hackers@postgresql.org; Mon, 14 Jan 2013 17:56:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoH4-0005Ov-0U for pgsql-hackers@postgresql.org; Mon, 14 Jan 2013 17:56:42 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r0EHubEX024606; Mon, 14 Jan 2013 12:56:37 -0500 (EST) From: Tom Lane To: Robert Haas cc: Simon Riggs , Jeff Janes , pgsql-hackers Subject: Re: [PERFORM] Slow query: bitmap scan troubles In-reply-to: References: <092a01cdd230$ff6143c0$fe23cb40$@foo.me.uk> <097601cdd249$ae338530$0a9a8f90$@foo.me.uk> <9022.1354730710@sss.pgh.pa.us> <28944.1357424296@sss.pgh.pa.us> <18164.1357498720@sss.pgh.pa.us> <8539.1357513385@sss.pgh.pa.us> <12791.1357580151@sss.pgh.pa.us> <13842.1357583258@sss.pgh.pa.us> <13967.1357866454@sss.pgh.pa.us> <23869.1358184197@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 14 Jan 2013 12:50:24 -0500" Date: Mon, 14 Jan 2013 12:56:37 -0500 Message-ID: <24605.1358186197@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Mon, Jan 14, 2013 at 12:23 PM, Tom Lane wrote: >> The old code definitely had an unreasonably large charge for indexes >> exceeding 1e8 or so tuples. This wouldn't matter that much for simple >> single-table lookup queries, but I could easily see it putting the >> kibosh on uses of an index on the inside of a nestloop. > The reported behavior was that the planner would prefer to > sequential-scan the table rather than use the index, even if > enable_seqscan=off. I'm not sure what the query looked like, but it > could have been something best implemented as a nested loop w/inner > index-scan. Remember also that "enable_seqscan=off" merely adds 1e10 to the estimated cost of seqscans. For sufficiently large tables this is not exactly a hard disable, just a thumb on the scales. But I don't know what your definition of "extremely large indexes" is. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers