Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7115B133798E for ; Sun, 21 Nov 2010 10:34:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 53688-10 for ; Sun, 21 Nov 2010 14:34:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id 2C5B81335B36 for ; Sun, 21 Nov 2010 10:34:47 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 704E515E40F7; Sun, 21 Nov 2010 15:34:46 +0100 (CET) Received: from 89.103.152.5 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Sun, 21 Nov 2010 15:34:46 +0100 Message-ID: In-Reply-To: References: , , , Date: Sun, 21 Nov 2010 15:34:46 +0100 Subject: Re: Query Performance SQL Server vs. Postgresql From: tv@fuzzy.cz To: "Humair Mohammed" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_20=-0.001 X-Spam-Level: X-Archive-Number: 201011/332 X-Sequence-Number: 41356 > 4) INDEXESI can certainly add an index but given the table sizes I am not > sure if that is a factor. This by no means is a large dataset less than > 350,000 rows in total and 3 columns. Also this was just a quick dump of > data for comparison purpose. When I saw the poor performance on the > COALESCE, I pointed the data load to SQL Server and ran the same query > except with the TSQL specific ISNULL function. 350000 rows definitely is a lot of rows, although with 3 INT column it's just about 13MB of data (including overhead). But indexes can be quite handy when doing joins, as in this case. Tomas