Re: [PERFORM] Sql Query :: Any advice ?

2016-11-15 Thread Henrik Ekenberg
Here are the indexes I have for those queries Indexes: hist_account_balance  :: "hist_account_balance_ix1" btree (trade_no)     trades :: "trades_pkey" PRIMARY KEY, btree  (trade_no)  "trades_trade_date_index" btree (trade_date) //H Quoting vinny : On 201

[PERFORM] Sql Query :: Any advice ?

2016-11-15 Thread Henrik Ekenberg
Hi, I have some data to join and I want to get som advice from you. Any tips ? Any comments are apreciated //H select trade_no from forecast_trades.hist_account_balance left join trades using (trade_no) where  trade_date > current_date - 120    and    trade_date < current_date - 30    and    f

[PERFORM] Any advice tuning this query ?

2016-11-11 Thread Henrik Ekenberg
Hi, I have a select moving around a lot of data and takes times Any advice tuning this query ? EXPLAIN (ANALYZE ON, BUFFERS ON)     select     d.books,     d.date publish_date,     extract(dow from d.date) publish_dow,     week_num_fixed,     coalesce(sum(case when i.invno is not null then 1 els

Re: [PERFORM] Tuning one Recurcive CTE

2016-11-09 Thread Henrik Ekenberg
Hi, I will need to anonymized before sending it. Do you know if there is any tuning documents related to CTE scans //H På onsdag 09. november 2016 kl. 14:05:55, skrev Henrik Ekenberg : Hi, I try to tune one Recursive CTE. Explain Plan can be found here https://explain.depesz.com/s/yLVd

[PERFORM] Tuning one Recurcive CTE

2016-11-09 Thread Henrik Ekenberg
Hi, I try to tune one Recursive CTE. Explain Plan can be found here https://explain.depesz.com/s/yLVd Anyone can give me direction to check? //H.