Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D3B501337B7E for ; Tue, 7 Dec 2010 18:11:49 -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 65527-07 for ; Tue, 7 Dec 2010 22:11:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by mail.postgresql.org (Postfix) with SMTP id 214FD1337B4F for ; Tue, 7 Dec 2010 18:11:41 -0400 (AST) Received: (qmail 19729 invoked by uid 453); 28 Nov 2010 20:11:04 -0000 Received: from pc-00002.gpdnet.co.uk (HELO [192.168.1.2]) (192.168.1.2) by gpdnet.co.uk (qpsmtpd/0.83) with (AES256-SHA encrypted) ESMTPS; Sun, 28 Nov 2010 20:11:04 +0000 Message-ID: <4CFEB124.3010400@gpdnet.co.uk> Date: Tue, 07 Dec 2010 22:11:48 +0000 From: Gary Doades User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows References: <378e24d1e3af88a49fbbb7c4d26f441a@mail.gmail.com> <4CFE7964.80206@squeakycode.net> <4CFE8E59.2010505@squeakycode.net> <20101207201028.GE4028@aart.is.rice.edu> <4CFE97B4.8090708@squeakycode.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 X-Spam-Level: X-Archive-Number: 201012/97 X-Sequence-Number: 41549 On 07/12/2010 9:29 PM, Tom Polak wrote: > > From EXPLAIN ANALYZE I can see the query ran much faster. > "Nested Loop Left Join (cost=0.00..138.04 rows=1001 width=1298) (actual > time=0.036..4.679 rows=1001 loops=1)" > " Join Filter: (pgtemp1.state = pgtemp2.stateid)" > " -> Seq Scan on pgtemp1 (cost=0.00..122.01 rows=1001 width=788) > (actual time=0.010..0.764 rows=1001 loops=1)" > " -> Materialize (cost=0.00..1.01 rows=1 width=510) (actual > time=0.000..0.001 rows=1 loops=1001)" > " -> Seq Scan on pgtemp2 (cost=0.00..1.01 rows=1 width=510) > (actual time=0.006..0.008 rows=1 loops=1)" > "Total runtime: 5.128 ms" > > The general question comes down to, can I expect decent perfomance from > Postgresql compared to MSSQL. I was hoping that Postgresql 9.0 beat MSSQL > 2000 since MS 2000 is over 10 years old. > So postgres actually executed the select in around 5 miiliseconds. Pretty good I would say. The problem therefore lies not with postgres itself, but what is done with the results afterwards? Assuming that this is pure local and therefore no network issues, perhaps there is a performance issue in this case with the Npgsql driver? Someone who knows more about this driver could perhaps shed some light on this? I have used .NET (C#) with postgres before, but only using the odbc driver. Perhaps you could try that instead (using OdbcCommand, OdbcDataReader etc.). I mainly use ruby (jruby) with postgres both under linux and Windows, but I can certainly process 1000 records of similar structure in well under 1 second. Cheers, Gary.