Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DB1061336971 for ; Wed, 12 Jan 2011 09:42:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 03700-03 for ; Wed, 12 Jan 2011 13:42:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx01.bfk.de (mx01.bfk.de [193.227.124.2]) by mail.postgresql.org (Postfix) with ESMTP id 90B7E133616B for ; Wed, 12 Jan 2011 09:42:43 -0400 (AST) Received: from mx00.int.bfk.de ([10.119.110.2]) by mx01.bfk.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1Pd0yI-0001TP-DT; Wed, 12 Jan 2011 13:42:42 +0000 Received: by bfk.de with local id 1Pd0yI-0000Gb-9Y; Wed, 12 Jan 2011 13:42:42 +0000 To: Laszlo Nagy Cc: "pgsql-performance\@postgresql.org" , Daniel Fekete Subject: Re: Slow query + why bitmap index scan?? References: <4D2D9B1E.7080302@shopzeus.com> From: Florian Weimer Date: Wed, 12 Jan 2011 13:42:42 +0000 In-Reply-To: <4D2D9B1E.7080302@shopzeus.com> (Laszlo Nagy's message of "Wed\, 12 Jan 2011 13\:14\:22 +0100") Message-ID: <82y66qp7al.fsf@mid.bfk.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/66 X-Sequence-Number: 41853 * Laszlo Nagy: > This query: > > select hid from product_price_history where id=3D35547581 > > Returns 759 rows in 8837 msec! How can this be that slow??? If most records are on different heap pages, processing this query requires many seeks. 11ms per seek is not too bad if most of them are cache misses. --=20 Florian Weimer BFK edv-consulting GmbH http://www.bfk.de/ Kriegsstra=DFe 100 tel: +49-721-96201-1 D-76133 Karlsruhe fax: +49-721-96201-99