Re: [PERFORM] Optimize SQL

2006-09-18 Thread Mikael Carneholm
That query is generated by hibernate, right? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pallav Kalva Sent: den 15 september 2006 17:10 To: pgsql-performance@postgresql.org Subject: [PERFORM] Optimize SQL Hi, Is there anyway we can optimize

[PERFORM] Optimize SQL

2006-09-15 Thread Pallav Kalva
Hi, Is there anyway we can optimize this sql ? it is doing full table scan on listing and address table . Postgres version 8.0.2 Thanks! Pallav. explain analyze select listing0_.listingid as col_0_0_, getmaxdate(listing0_.lastupdate, max(addressval2_.createdate)) as col_1_0_ from

Re: [PERFORM] Optimize SQL

2006-09-15 Thread Tom Lane
Pallav Kalva [EMAIL PROTECTED] writes: select listing0_.listingid as col_0_0_, getmaxdate(listing0_.lastupdate, max(addressval2_.createdate)) as col_1_0_ from listing.listing listing0_ left outer join listing.address listingadd1_ on listing0_.fkbestaddressid=listingadd1_.addressid left

Re: [PERFORM] Optimize SQL

2006-09-15 Thread Arjen van der Meijden
On 15-9-2006 17:53 Tom Lane wrote: If that WHERE logic is actually what you need, then getting this query to run quickly seems pretty hopeless. The database must form the full outer join result: it cannot discard any listing0_ rows, even if they have lastupdate outside the given range, because