Another couple of possible ways:
Select groupfield,value
>From tbl x1
Where number = (select max(number) from tbl x2 where x2.groupfield=
x1.groupfield)
Select groupfield,value
>From tbl x1
Where (groupfield,number) in (select groupfield,max(number) from tbl group
by groupfield)
Which is qui
Definitely after.
Jonathan
-Original Message-
From: pgsql-performance-ow...@postgresql.org
[mailto:pgsql-performance-ow...@postgresql.org] On Behalf Of Matthew
Wakeling
Sent: Monday, November 23, 2009 1:00 PM
To: Jonathan Blitz
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM
Many thanks.
I'll give it a try and see what happens.
-Original Message-
From: Craig Ringer [mailto:cr...@postnewspapers.com.au]
Sent: Sunday, November 22, 2009 3:25 PM
To: Jonathan Blitz
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Why is the query not using the
performs a sort.
Am I missing something?
Jonathan Blitz
How about trying:
Select *
From
(Select * from t28 where t28.0='spec') t28a
Left out join (t1 JOIN t11 ON
> (t11.o = '<http://example.org>' AND t11.s = t1.o)) ON t28a.s = t1.s
In this way, I think, the where clause on t28 would be performed before the
join rathe
>
> Most laptop drives are only 5,400 RPM which would make a transaction like
> you are describing likely take a while.
Not sure what my one is but it is new(ish).
>
> No desktop at home you could try it on?
> I think the problem with the laptop is likely it's drive.
I suppose I could do but I
>
>
> Could you do the updates in batches instead of trying to do them all at
> once?
Nope. Didn't think it would make any difference.
>
> Have you done a vacuum full on this table ever?
Many times
>
> What hardware?
> I have a dual CPU opteron with 4GB of RAM and 8 disks in RAID 10 (SATA).
> > So, I have tried to run the following command. The command never
finishes
> > (I gave up after about and hour and a half!).
>
> Did you ever find what was the problem?
> Perhaps you needed to run a vacuum full on the table?
Nope.
I just gave up in the end and left it with NULL as the default
802158) order by batterydescription.
How about changing it into a standard join:
select t1.batterycode, t1.batterydescription, t2.observationdate
from Battery t1,
(Select batterycode ,max(observationdate) from Battery t2 where
patientidentifier=611802158 group by batterycode) AS T2
where t1. bat
should be fast enough.
Any ideas?
Jonathan Blitz
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 05/15/2006
10 matches
Mail list logo