Re: [PERFORM] slow query using sub select

2006-05-23 Thread Tim Jones
: [PERFORM] slow query using sub select "Tim Jones" <[EMAIL PROTECTED]> writes: > I am having a problem with a sub select query being kinda slow. The > query is as follows: > select batterycode, batterydescription, observationdate from Battery > t1 where pat

Re: [PERFORM] slow query using sub select

2006-05-22 Thread Jonathan Blitz
> -Original Message- > From: Tim Jones [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 12:11 AM > To: pgsql-performance@postgresql.org > Subject: [PERFORM] slow query using sub select > > Hi, > I am having a problem with a sub select query being kinda

Re: [PERFORM] slow query using sub select

2006-05-22 Thread Tom Lane
"Tim Jones" <[EMAIL PROTECTED]> writes: > I am having a problem with a sub select query being kinda slow. The > query is as follows: > select batterycode, batterydescription, observationdate from Battery t1 > where patientidentifier=611802158 and observationdate = (select > max(observationdate

[PERFORM] slow query using sub select

2006-05-22 Thread Tim Jones
Hi, I am having a problem with a sub select query being kinda slow. The query is as follows: select batterycode, batterydescription, observationdate from Battery t1 where patientidentifier=611802158 and observationdate = (select max(observationdate) from Battery t2 where t2.batterycode=t1.batt