Re: [GENERAL] slow queries

From: Thomas Good <tomg(at)admin(dot)nrnet(dot)org>
To: pgsql-general(at)postgreSQL(dot)org
Cc: Federico Passaro <fede(at)link(dot)it>
Subject: Re: [GENERAL] slow queries
Date: 1998-09-18 16:27:00
Message-ID: Pine.LNX.3.96.980918121541.24729A-100000@admin.nrnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 18 Sep 1998, David Hartwig wrote:

> I would like to see it! I was not aware that table aliasing could
> have any impact on performance.

Hello Oliver and David,

I was a bit amazed myself. Federico Passaro, on the SQL list,
helped me out some time ago when a query was failing.
His code worked so well that I filed it away for a rainy day...
this week I decided to try it and see if it helped hasten my
slooooowest query. It did.

Here is my code (hope it's coherent, I didn't name the tables!):

#!/bin/sh
tput clear
echo -ne "Enter Unit Code: "
read unit
psql millie <<EOF | less
SELECT unit_lname FROM crund1 WHERE unit_id = ${unit};
SELECT S.tr_id, T.i_date, S.client_lname, S.client_fname, S.eth_nic
FROM svcrd1 S, trhist T
WHERE S.client_id = T.pt_id
AND T.unit_id = ${unit}
AND T.o_date IS NULL
ORDER BY S.client_lname;
EOF

Cheers,
Tom

---------- Sisters of Charity Medical Center ----------
Department of Psychiatry
----
Thomas Good <tomg(at)q8(dot)nrnet(dot)org>
Coordinator, North Richmond C.M.H.C. Information Systems
75 Vanderbilt Ave, Quarters 8 Phone: 718-354-5528
Staten Island, NY 10304 Fax: 718-354-5056

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Constantin Teodorescu 1998-09-18 16:46:36 PgAccess 0.90 new version released - user input query parameters available
Previous Message System Administrator 1998-09-18 15:54:47 pg_dump