X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id BFC049FA441 for ; Thu, 13 Jul 2006 19:33:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 76349-01 for ; Thu, 13 Jul 2006 19:33:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8B9439FA322 for ; Thu, 13 Jul 2006 19:33:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k6DMWwno021982; Thu, 13 Jul 2006 18:32:59 -0400 (EDT) To: jkapad@csd.uoc.gr cc: pgsql-performance@postgresql.org Subject: Re: Problem with bitmap-index-scan plan In-reply-to: <1152078884.44ab542441450@ermis.edu.uoc.gr> References: <1152078884.44ab542441450@ermis.edu.uoc.gr> Comments: In-reply-to jkapad@csd.uoc.gr message dated "Wed, 05 Jul 2006 08:54:44 +0300" Date: Thu, 13 Jul 2006 18:32:58 -0400 Message-ID: <21981.1152829978@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/136 X-Sequence-Number: 19996 jkapad@csd.uoc.gr writes: > ... is quite reasonable.The table has 1.000.000 rows (17.242 pages). From > pg_stat_get_blocks_fetched I can see that there were 102 page requests for > table. So all things seem to work great here! > But if I multiply the size of the table ten-times (10.000.000 rows - 172.414 > pages) and run the same query I get: > ... > which is slower even than a seq scan. Now I get that there were 131.398 page > requests for table in order to retrieve almost 1250 tuples!Can someone explain > why this is happening? All memory parameters are set to default. You probably need to increase work_mem so that the bitmaps don't become lossy ... regards, tom lane