Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 66B62A0109A for ; Wed, 30 Nov 2011 17:19:26 -0400 (AST) Received: from smtp.01.com ([216.115.88.169]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVrYp-0000th-Ku for pgsql-performance@postgresql.org; Wed, 30 Nov 2011 21:19:26 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 19BA5414359 for ; Wed, 30 Nov 2011 15:19:10 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fvp1iGbaqpn3 for ; Wed, 30 Nov 2011 15:19:10 -0600 (CST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id EC9564144A7 for ; Wed, 30 Nov 2011 15:19:09 -0600 (CST) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-2.01.com (Postfix) with ESMTPSA id BDCE5414359 for ; Wed, 30 Nov 2011 15:19:09 -0600 (CST) Message-ID: <4ED69DCD.5000806@agliodbs.com> Date: Wed, 30 Nov 2011 13:19:09 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: vacuum internals and performance affect References: <1322586733308-5033043.post@n5.nabble.com> In-Reply-To: <1322586733308-5033043.post@n5.nabble.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201111/287 X-Sequence-Number: 45798 MX, > to my understanding, vacuum just marks the dead rows of a table so that from > that point on that space would be re-used for new inserts and new updates on > that specific table. however, if there is an open transaction, vacuum can > only do what is described above up to the point that the open transaction > was started. so if for example there is a query running for 1 day, no matter > how many times i will have vacuumed the table (manual or auto), the dead > rows wont be possible to be marked as re-usable space. > -is the above correct? More or less. The transactionID isn't a timestamp, so the "stop point" is based on snapshots rather than a point-in-time. But that's a fine distinction. > -is there something more about vacuum in that case i am describing? would > for example mark the rows as 'semi-dead' so that when a scan would be made > these rows wouldn't be checked and so the queries would be faster? is there > anything else for this specific case? Well, vacuum does some other work, yes. > -would there be any effect from the vacuum on the indexes of the table?like > i said above for the table, would the entries of the index not be scanned > for a query, due to some reason? Vacuum also does some pruning dead index pointers. Otherwise, I'm not sure what you're asking. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com