X-Original-To: pgsql-sql@postgresql.org Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by postgresql.org (Postfix) with SMTP id 4BA87476105 for ; Mon, 10 Mar 2003 11:43:32 -0500 (EST) Received: from unknown (HELO eg1opwxp107) (heshamgowaily@212.103.160.174 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 10 Mar 2003 16:43:36 -0000 From: "Objectz" To: Subject: Execution plan Question Date: Mon, 10 Mar 2003 18:43:17 +0200 Message-ID: <002201c2e724$2816d8a0$aea067d4@eg1opwxp107> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Archive-Number: 200303/246 X-Sequence-Number: 12286 hi all, I have a strange problem and really wish to get some help in here. I have the following tables create table shr_objects( objectid int8 not null companyid int4 not null name varchar(255) description varchar(255) ) primary key : object id foreign key on companyid references shr_companies(companyid) Index on companyid Number of rows ~ 1,410,000 create table smb_contacts{ contactid int4 not null objectid int8 not null firstname varchar(255) lastname varchar(255) ) primary key : contactid foreign key on objectid references shr_objects9objectid) index on : objectid Number of rows ~ 10,000 I am trying to execute a query that joins the 2 tables on object id , it works fine but when i add an order clause the performance is degarded dramatically. I have included both quiries with their excution plan. Regards, --ObjectZ Maker