Re: [PERFORM] Query optimization help

2011-08-30 Thread Ondrej Ivanič
Hi, 2011/8/30 Szymon Kosok : > 2011/8/30 Ondrej Ivanič : >> Could you please re-post your explain using this web site: >> http://explain.depesz.com/ and post links to Stackoverflow question? > > Here it is: http://explain.depesz.com/s/Iaa > >> - try to disable nested loop join (set enable_nestloop

Re: [PERFORM] Query optimization help

2011-08-30 Thread Szymon Kosok
2011/8/30 Ondrej Ivanič : > Could you please re-post your explain using this web site: > http://explain.depesz.com/ and post links to Stackoverflow question? Here it is: http://explain.depesz.com/s/Iaa > - try to disable nested loop join (set enable_nestloop=off) Even worse performance (http://e

Re: [PERFORM] Query optimization help

2011-08-29 Thread Ondrej Ivanič
Hi, On 30 August 2011 15:36, Szymon Kosok wrote: > Hello, > > I asked that question on StackOverflow, but didn't get any valuable > response, so I'll ask it here. :) > > I have such query: Could you please re-post your explain using this web site: http://explain.depesz.com/ and post links to Sta

[PERFORM] Query optimization help

2011-08-29 Thread Szymon Kosok
Hello, I asked that question on StackOverflow, but didn't get any valuable response, so I'll ask it here. :) I have such query: SELECT "spoleczniak_tablica"."id", "spoleczniak_tablica"."postac_id", "spoleczniak_tablica"."hash", "spoleczniak_tablica"."typ", "spoleczniak_tablica"."ikona", "spolecz

[PERFORM] Query optimization help

2011-08-29 Thread Szymon Kosok
Hello, I asked that question on StackOverflow, but didn't get any valuable response, so I'll ask it here. :) I have such query: SELECT "spoleczniak_tablica"."id", "spoleczniak_tablica"."postac_id", "spoleczniak_tablica"."hash", "spoleczniak_tablica"."typ", "spoleczniak_tablica"."ikona", "spolecz

Re: [PERFORM] query optimization help

2005-01-14 Thread sarlav kumar
Hi,   Thanks for the help. I actually got around with it by doing the following. I created a temporary table:   create table statesnew as select distinct state,state_code from postalcode where lower(country)='us';   And then changed the query to :   SELECT (SELECT sn.state FROM statesnew sn WHERE U

Re: [PERFORM] query optimization help

2005-01-14 Thread Merlin Moncure
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sarlav kumar Sent: Friday, January 14, 2005 9:40 AM To: pgsqlnovice; pgsqlperform Subject: [PERFORM] query optimization help Hi All,   I have the following query to generate a report grouped by "states".   SELECT distinc

[PERFORM] query optimization help

2005-01-14 Thread sarlav kumar
Hi All,   I have the following query to generate a report grouped by "states".   SELECT distinct upper(cd.state) as mystate, SUM(d.amount) as total_amount, SUM(COALESCE(d.fee,0) + COALESCE(mp.seller_fee, 0) + COALESCE(mp.buyer_fee,0)) as total_fee FROM data d left JOIN customerdata cd ON d.uid = cd