Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U2taN-0001Pj-8d for pgsql-sql@arkaria.postgresql.org; Wed, 06 Feb 2013 01:14:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U2taM-00036k-9j for pgsql-sql@arkaria.postgresql.org; Wed, 06 Feb 2013 01:14:02 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U2taL-00036f-Lj for pgsql-sql@postgresql.org; Wed, 06 Feb 2013 01:14:01 +0000 Received: from eastrmfepo201.cox.net ([68.230.241.216]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U2taD-0000zz-21 for pgsql-sql@postgresql.org; Wed, 06 Feb 2013 01:13:56 +0000 Received: from eastrmimpo305 ([68.230.241.237]) by eastrmfepo201.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20130206011350.PMQW17456.eastrmfepo201.cox.net@eastrmimpo305> for ; Tue, 5 Feb 2013 20:13:50 -0500 Received: from slacker.ja10629.home ([68.100.172.111]) by eastrmimpo305 with cox id wpDp1k00t2QZvnG01pDqHX; Tue, 05 Feb 2013 20:13:50 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020205.5111AE4E.004F,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=e+KEuNV/ c=1 sm=1 a=KkuxRCi8ThM9wmHDumrCpg==:17 a=z1TLwsU0kBEA:10 a=lyv0vbOZ4mEA:10 a=PjkiJtDTOQ4A:10 a=ZcFhQy0-F_sA:10 a=kj9zAlcOel0A:10 a=P6M1L9rJAAAA:8 a=Uz3sVoaqlUMA:10 a=rTnf8mtyKRxr4iF02GUA:9 a=CjuIK1q_8ugA:10 a=KkuxRCi8ThM9wmHDumrCpg==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: from wcuddy by slacker.ja10629.home with local (Exim 4.72) (envelope-from ) id 1U2ta9-0004xn-NP for pgsql-sql@postgresql.org; Tue, 05 Feb 2013 20:13:49 -0500 Date: Tue, 5 Feb 2013 20:13:49 -0500 From: Wayne Cuddy To: PostgreSQL Subject: index scan vs bitmap index scan Message-ID: <20130206011349.GA18317@slacker.ja10629.home> Mail-Followup-To: PostgreSQL Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org I have a table with with an index that is of type 'timestamp without time zone'. Multiple records are inserted per second so the index is not unique. This table experiences frequent inserts and updates. Bulk deletes are performed once per month. Slower than expected search times are experienced when performing queries that limit the result to a range of dates. It's always a simple range: 'where ts between A and B'. I copied the table to another system where no inserts/updates are taking place and the results are rendered much faster. I attribute some of this to the I/O load on the idle system compared to our production system. EXPLAIN shows that the difference is that on the idle system a 'bitmap index scan' is used. On the production system a 'index scan' is used. On the production system query times are greatly reduced when 'set enable_indexscans to off' is used. Both backends are PGSQL 9.0.4. The table has about 24 million records. What influences the use of a bitmap index scan vs index scan? Any pointers on what I can do to render faster performance without having to explicitly adjust enable_indexscan would be greatly appreciated. Thanks, Wayne -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql