X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 72CBB5287C for ; Tue, 24 May 2005 03:40:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41655-09 for ; Tue, 24 May 2005 06:40:38 +0000 (GMT) Received: from web53105.mail.yahoo.com (web53105.mail.yahoo.com [206.190.39.208]) by svr1.postgresql.org (Postfix) with SMTP id CF00E5280A for ; Tue, 24 May 2005 03:40:37 -0300 (ADT) Received: (qmail 18215 invoked by uid 60001); 24 May 2005 06:40:34 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=rEU/IaSJ/+lMm/XIvFerIsrhM7LtxHeL9b3XGF4lDHcn6wmH+y6+X+Tvg1n21rMKDVFGORgfeFt7qZo/K/oSpXHmofQL0pfQmRdxlTFVvz81VrYs7OlSCvW6S+ZJzvVadzQ67TwAKlV43/9769UoEMn0kNHbYR1ARqie+iveIdI= ; Message-ID: <20050524064034.18213.qmail@web53105.mail.yahoo.com> Received: from [68.70.32.45] by web53105.mail.yahoo.com via HTTP; Mon, 23 May 2005 23:40:34 PDT Date: Mon, 23 May 2005 23:40:34 -0700 (PDT) From: mark durrant Subject: Re: Select performance vs. mssql To: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.829 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FROM_ENDS_IN_NUMS X-Spam-Level: * X-Archive-Number: 200505/355 X-Sequence-Number: 12519 > Post the result of this for us: > > explain analyze select count(*) from mtable where > day='Mon'; > > On both machines. Hi Chris -- PostgreSQL Machine: "Aggregate (cost=140122.56..140122.56 rows=1 width=0) (actual time=24516.000..24516.000 rows=1 loops=1)" " -> Index Scan using "day" on mtable (cost=0.00..140035.06 rows=35000 width=0) (actual time=47.000..21841.000 rows=1166025 loops=1)" " Index Cond: ("day" = 'Mon'::bpchar)" "Total runtime: 24516.000 ms" (Note this took 24 seconds after fresh reboot, next execution was 11, and execution without explain analyze was 6.7 seconds) MSSQL Machine: That "Explain Analyze" command doesn't work for MSSQL, but I did view the Query plan. 97% of it was "Scanning a particular range of rows from a nonclustered index" Thanks for your help --Mark __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com