Re: [GENERAL] Strategies/Best Practises Handling Large Tables

2012-11-15 Thread Igor Romanchenko
On Thu, Nov 15, 2012 at 1:34 PM, Chitra Creta wrote: > Thanks for your example Chris. I will look into it as a long-term solution. > > Partitioning tables as a strategy worked very well indeed. This will be my > short/medium term solution. > > Another strategy that I would like to evaluate as a s

Re: [GENERAL] How do query optimizers affect window functions

2012-11-14 Thread Igor Romanchenko
On Wed, Nov 14, 2012 at 10:12 AM, Tianyin Xu wrote: > Hi, Postgresql, > > I want to understand how the query optimizers affect the output of the > window functions. > > For example, set "cpu_tuple_cost = 50" in postgresql.conf and start the > server, I apply the regress test (make installcheck).

Re: [GENERAL] View using dblink fails if not able to make connection

2012-11-09 Thread Igor Romanchenko
On Fri, Nov 9, 2012 at 9:21 PM, George Weaver wrote: > ** > Hi Everyone, > > I have a view made up of a local query unioned with a view comprised of a > dblink query. > > If the dblink query cannot establish a connection, I get the "could not > connect to server" error and the whole view fails. >

Re: [GENERAL] Update latest column in master table from transaction table

2012-11-03 Thread Igor Romanchenko
Hello, try something like WITH lastreceipt as (SELECT DISTINCT ON (acc.cname) acc.cname, acc.date, acc.amount FROM accounts acc ORDER BY acc.date DESC) UPDATE customer_master SET lastreceiptdate = lr.date lastreceiptamt = lr.amount FROM lastreceipt lr WHERE cname = lr.cname (Haven't tested