Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id EF93064FDEF for ; Wed, 12 Nov 2008 13:46:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68643-06 for ; Wed, 12 Nov 2008 13:46:05 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.147]) by mail.postgresql.org (Postfix) with ESMTP id 7F3A064FD9B for ; Wed, 12 Nov 2008 13:46:01 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay03.plus.net with esmtp (Exim) id 1L0Jmt-0000nc-HU; Wed, 12 Nov 2008 17:45:55 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 61F07274062; Wed, 12 Nov 2008 17:45:55 +0000 (GMT) Message-ID: <491B1653.3040600@archonet.com> Date: Wed, 12 Nov 2008 17:45:55 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: firerox@centrum.cz CC: tv@fuzzy.cz, pgsql-performance@postgresql.org Subject: Re: slow full table update References: <200811101729.14977@centrum.cz> <200811101730.11057@centrum.cz> <200811101730.15902@centrum.cz> <61593.89.102.139.23.1226335300.squirrel@sq.gransy.com> <200811121725.30238@centrum.cz> <63509.89.102.139.23.1226508479.squirrel@sq.gransy.com> <200811121825.26487@centrum.cz> In-Reply-To: <200811121825.26487@centrum.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 40893ca9fb81ab9b9c8c93d9ddbceef6 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200811/101 X-Sequence-Number: 31832 firerox@centrum.cz wrote: > Hi, > > I've changed settings, > but with no effect on speed. > > I try explain query with this result > for 10.000 rows > update songs set views = 0 where sid > 20000 and sid < 30000 > > Bitmap Heap Scan on songs (cost=151.59..6814.29 rows=8931 width=526) (actual time=4.848..167.855 rows=8945 loops=1) This query says t is taking 167 milli-seconds, not 10 minutes as your first message said. Is this query actually slow? > > Recheck Cond: ((sid > 20000) AND (sid < 30000)) > > -> Bitmap Index Scan on pk_songs2 (cost=0.00..151.59 rows=8931 width=0) (actual time=4.071..4.071 rows=9579 loops=1) > > Index Cond: ((sid > 20000) AND (sid < 30000)) > > Is there a way to run this query on sigle throughpass with no Recheck Cond? Only a sequential scan. -- Richard Huxton Archonet Ltd