Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7369A1336473 for ; Mon, 18 Oct 2010 04:58:46 -0300 (ADT) 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 48469-03 for ; Mon, 18 Oct 2010 07:58:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id CE524133616B for ; Mon, 18 Oct 2010 04:58:38 -0300 (ADT) Received: by fxm4 with SMTP id 4so383359fxm.19 for ; Mon, 18 Oct 2010 00:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=KFlaQ+4rJ1gzt1eu19fUbI79J34RRjAeQ6q9BSwHink=; b=ZmnC5w/TI47wPlHecJ0vhskhtSMYuvOGD/i0ePHD8F40Yy5LUZOADbAPTmCxKBj4Dy EtAuRNsqEA2Lsb7Y2LrU9FgZd4DDRSC6Kaq/Wlm4zgIcZoypPIDM00Bt6AA/7W4AseFy CfKItpeZ/cXgqkUXLJF2F/9HGVx2M7kFL2GIg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=t+oPE/O07GyKTGCrqEuoQKxvkTjRAUBzYxdLCASR0dzNgA2Umh6IS9+yzYWEIt3fVy nUojunm45YsLIuOtdPG/Sw8XIgBCa5VEkt2vrk93iDR3UeGZA0iR2GJXg/Isaf4+4c7Q bskyPYgFjJWYOW0R/2U5CyzgqGgXmUidHMXg8= Received: by 10.103.39.17 with SMTP id r17mr1627353muj.67.1287388718020; Mon, 18 Oct 2010 00:58:38 -0700 (PDT) Received: from [10.1.1.57] (skuns.zoral.com.ua [91.193.166.194]) by mx.google.com with ESMTPS id y19sm2155728fau.41.2010.10.18.00.58.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Oct 2010 00:58:36 -0700 (PDT) Message-ID: <4CBBFE2F.3010801@gmail.com> Date: Mon, 18 Oct 2010 10:58:39 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Select count(*), the sequel References: <4CB9D82F.9040505@gmail.com> In-Reply-To: <4CB9D82F.9040505@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/286 X-Sequence-Number: 40704 16.10.10 19:51, Mladen Gogala написав(ла): > There was some doubt as for the speed of doing the select count(*) in > PostgreSQL and Oracle. > To that end, I copied the most part of the Oracle table I used before > to Postgres. Although the copy > wasn't complete, the resulting table is already significantly larger > than the table it was copied from. The result still shows that Oracle > is significantly faster: Hello. Did you vacuum postgresql DB before the count(*). I ask this because (unless table was created & loaded in same transaction) on the first scan, postgresql has to write hint bits to the whole table. Second scan may be way faster. Best regards, Vitalii Tymchyshyn