Execution plan Question - Mailing list pgsql-sql

From Objectz
Subject Execution plan Question
Date
Msg-id 002201c2e724$2816d8a0$aea067d4@eg1opwxp107
Whole thread Raw
List pgsql-sql
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 nullcompanyid     int4    not nullname        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 nullobjectid    int8    not nullfirstname    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



pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Cursors and backwards scans and SCROLL
Next
From: Tomasz Myrta
Date:
Subject: Re: Execution plan Question