Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E2E319FB440 for ; Wed, 21 Feb 2007 06:17:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 06043-04 for ; Wed, 21 Feb 2007 06:16:54 -0400 (AST) X-Greylist: delayed 00:19:22.889889 by SQLgrey-1.7.4 Received: from samson.polok.pl (dns.wislanet.pl [195.205.86.254]) by postgresql.org (Postfix) with ESMTP id E380C9FB324 for ; Wed, 21 Feb 2007 06:16:57 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by samson.polok.pl (Postfix) with ESMTP id 4D43342B64 for ; Wed, 21 Feb 2007 10:57:33 +0100 (CET) Received: from samson.polok.pl ([127.0.0.1]) by localhost (samson.polok.pl [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 17297-46 for ; Wed, 21 Feb 2007 10:57:31 +0100 (CET) Received: from [127.0.0.1] (aoy162.internetdsl.tpnet.pl [83.17.132.162]) by samson.polok.pl (Postfix) with ESMTP id 7E2A942B63 for ; Wed, 21 Feb 2007 10:57:30 +0100 (CET) Message-ID: <45DC1786.80504@polok.pl> Date: Wed, 21 Feb 2007 10:57:26 +0100 From: =?ISO-8859-2?Q?Jacek_Zar=EAba?= User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Postgres performance Linux vs FreeBSD Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000715-0, 2007-02-20), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at polok.pl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/206 X-Sequence-Number: 23260 Hello, I've set up 2 identical machines, hp server 1ghz p3, 768mb ram, 18gb scsi3 drive. On the first one I've installed Debian/GNU 4.0 Linux, on the second FreeBSD 6.2. On both machines I've installed Postgresql 8.2.3 from sources. Now the point :)) According to my tests postgres on Linux box run much faster then on FreeBSD, here are my results: *** setting up ************************** creeate table foo as select x from generate_series(1,2500000) x; vacuum foo; checkpoint; \timing ***************************************** *** BSD ********************************* actual=# select count(*) from foo; count --------- 2500000 (1 row) Time: 1756.455 ms actual=# explain analyze select count(*) from foo; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Aggregate (cost=34554.20..34554.21 rows=1 width=0) (actual time=12116.841..12116.843 rows=1 loops=1) -> Seq Scan on foo (cost=0.00..28304.20 rows=2500000 width=0) (actual time=9.276..6435.890 rows=2500000 loops=1) Total runtime: 12116.989 ms (3 rows) Time: 12117.803 ms ****************************************** *** LIN ********************************** actual=# select count(*) from foo; count --------- 2500000 (1 row) Time: 1362,193 ms actual=# EXPLAIN ANALYZE actual-# select count(*) from foo; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Aggregate (cost=34554.20..34554.21 rows=1 width=0) (actual time=4737.243..4737.244 rows=1 loops=1) -> Seq Scan on foo (cost=0.00..28304.20 rows=2500000 width=0) (actual time=0.058..2585.170 rows=2500000 loops=1) Total runtime: 4737.363 ms (3 rows) Time: 4738,367 ms actual=# ****************************************** Just a word about FS i've used: BSD: /dev/da0s1g on /usr/local/pgsql (ufs, local, noatime, soft-updates) LIN: /dev/sda7 on /usr/local/pgsql type xfs (rw,noatime) My question is simple :) what's wrong with the FreeBSD BOX?? What's the rule for computing gettimeofday() time ?? Thanks for any advices :)) ..and have a nice day!! J.