X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E8A2A8B9B6F for ; Tue, 1 Feb 2005 17:07:04 +0000 (GMT) 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 93473-01 for ; Tue, 1 Feb 2005 17:07:01 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id AB4588B9B6A for ; Tue, 1 Feb 2005 17:06:59 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j11H6t7Q008563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Feb 2005 10:06:57 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j11H6sJa065565; Tue, 1 Feb 2005 10:06:54 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j11H6sGg065564; Tue, 1 Feb 2005 10:06:54 -0700 (MST) (envelope-from mfuhr) Date: Tue, 1 Feb 2005 10:06:54 -0700 From: Michael Fuhr To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: MSSQL versus Postgres timing Message-ID: <20050201170654.GA65518@winnie.fuhr.org> References: <000001c5087e$b92ddfa0$797ba8c0@jfradkin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c5087e$b92ddfa0$797ba8c0@jfradkin> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/27 X-Sequence-Number: 20138 On Tue, Feb 01, 2005 at 11:54:11AM -0500, Joel Fradkin wrote: > > A table with 645,000 records for associates has view (basically select * > from tblassociates where clientnum = 'test') > > This is taking 13 seconds in postgres and 3 seconds in MSSQL. Please post the EXPLAIN ANALYZE output for the slow query, once with enable_seqscan on and once with it off. For example: SET enable_seqscan TO on; -- if not already on EXPLAIN ANALYZE SELECT * FROM tblassociates WHERE clientnum = 'test'; SET enable_seqscan TO off; EXPLAIN ANALYZE SELECT * FROM tblassociates WHERE clientnum = 'test'; > Be glad to provide the view and tables etc. Please do -- it might help us spot something that could be improved. What version of PostgreSQL are you using? -- Michael Fuhr http://www.fuhr.org/~mfuhr/