Slow access

From: Tyson Oswald <tysono(at)iserv(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Slow access
Date: 1999-11-16 23:44:19
Message-ID: 3831EC53.D5B285F3@iserv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,
Not sure is this is the place for this but, I have two object
created a table (customers) and a view cust which joins customers and
cust runs pretty slow when select count(*) from cust. I think it may be
an index issue, can anyone help? there are about 1200 records in
customers and it takes about 30 seconds to count(*). Also how to I
create a foreign key constraint?

Tyson Oswald

Create table Customers
(
id serial,
Name varchar(25),
UID varchar(7),
Ext char(4),
fkMailcode int4,
fkContext int4,
fkServer int4,
fkAdmin int4
);

drop index idx_Customers_fkAdmin;
drop index idx_Customers_fkMailcode;
drop index idx_Customers_fkServer;
drop index idx_Customers_fkContext;

Create index idx_Customers_fkAdmin on Customers(fkadmin);
Create index idx_Customers_fkMailcode on Customers(fkMailcode);
Create index idx_Customers_fkContext on Customers(fkContext);
Create index idx_Customers_fkServer on Customers(fkServer);

Create table Codes
(
id serial,
description varchar(50),
type varchar(5),
typecode varchar(5)
);
create view cust as
select
c.name,
c.ext,
c.uid,
tmail.description as mail,
tcontext.description as context,
tserver.description as server,
admins.name as admin,
c.id
from
customers c,
codes tmail,
codes tserver,
codes tcontext,
admins
where
c.fkadmin=admins.id
and c.fkmailcode = tmail.id
and c.fkcontext = tcontext.id
and c.fkserver = tserver.id;

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-11-17 05:13:14 Re: PostgreSQL install
Previous Message Aaron J. Seigo 1999-11-16 16:26:50 replication