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 527048B9BBB for ; Tue, 1 Feb 2005 21:44:46 +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 16334-04 for ; Tue, 1 Feb 2005 21:44:43 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 7A15F8B9B86 for ; Tue, 1 Feb 2005 21:44:43 +0000 (GMT) Received: (qmail 27751 invoked from network); 1 Feb 2005 22:45:05 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 1 Feb 2005 22:45:05 +0100 To: "Joel Fradkin" , pgsql-sql@postgresql.org Subject: Re: MSSQL versus Postgres timing References: <000001c5089b$63d56650$797ba8c0@jfradkin> Message-ID: Date: Tue, 01 Feb 2005 22:47:19 +0100 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <000001c5089b$63d56650$797ba8c0@jfradkin> User-Agent: Opera M2/7.54 (Linux, build 751) 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/34 X-Sequence-Number: 20145 > CREATE OR REPLACE VIEW viwassoclist AS > SELECT a.clientnum, a.associateid, a.associatenum, a.lastname, > a.firstname, > jt.value AS jobtitle, l.name AS "location", l.locationid AS > mainlocationid, > l.divisionid, l.regionid, l.districtid, (a.lastname::text || ', '::text) > || > a.firstname::text AS assocname, a.isactive, a.isdeleted > FROM tblassociate a > LEFT JOIN tbljobtitle jt ON a.jobtitleid = jt.id AND > jt.clientnum::text = > a.clientnum::text AND 1 = jt.presentationid > JOIN tbllocation l ON a.locationid = l.locationid AND > l.clientnum::text = > a.clientnum::text; Try removing those ::text casts... and creating two column indexes on the columns you use in your Join