Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 520FA1337B58 for ; Sun, 21 Nov 2010 11:42:15 -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 18789-03 for ; Sun, 21 Nov 2010 15:42:08 +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 475651337B4A for ; Sun, 21 Nov 2010 11:42:07 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 9B8B215E40F7; Sun, 21 Nov 2010 16:42:07 +0100 (CET) Received: from 89.103.152.5 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Sun, 21 Nov 2010 16:42:07 +0100 Message-ID: <1cc426dab35a9fc3fd189d5f9a6fb7a0.squirrel@sq.gransy.com> In-Reply-To: References: , , , Date: Sun, 21 Nov 2010 16:42:07 +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.5 tagged_above=-10 required=5 tests=BAYES_05=-0.5 X-Spam-Level: X-Archive-Number: 201011/336 X-Sequence-Number: 41360 >> 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. OK, I've just realized the tables have 3 character columns, not integers. In that case the tables are probably much bigger (and there are things like TOAST). In that case indexes may be even more important. Tomas