[PERFORM] sequence query performance issues

2007-09-27 Thread Peter Koczan
Hello, I have a weird performance issue with a query I'm testing. Basically, I'm trying to port a function that generates user uids, and since postgres offers a sequence generator function, I figure I'd take advantage of that. Basically, I generate our uid range, filter out those which are in use,

Re: [PERFORM] Searching for the cause of a bad plan

2007-09-27 Thread Ron Mayer
Csaba Nagy wrote: > > Well, my problem was actually solved by rising the statistics target, Would it do more benefit than harm if postgres increased the default_statistics_target? I see a fair number of people (myself included) asking questions who's resolution was to ALTER TABLE SET STATISTICS;

[PERFORM] Tuning for warm standby

2007-09-27 Thread Kevin Kempter
Hi All; I'm preparing to fire up WAL archiving on 8 production servers We will follow up with implementing a warm standby scenariio. Does anyone have any thoughts per how to maximize performance, yet minimize the potential for data loss assuming we were not able to retrieve the final un-archiv

Re: [PERFORM] Searching for the cause of a bad plan

2007-09-27 Thread Simon Riggs
On Thu, 2007-09-27 at 10:40 -0400, Tom Lane wrote: > And yet there's another trap here: if the parameter you passed in > chanced to be one of the very common values, a plan that was optimized > for a small number of matches would perform terribly. I wonder could we move prepare_threshold onto the

Re: [PERFORM] Searching for the cause of a bad plan

2007-09-27 Thread Csaba Nagy
On Thu, 2007-09-27 at 10:40 -0400, Tom Lane wrote: > And yet there's another trap here: if the parameter you passed in > chanced to be one of the very common values, a plan that was optimized > for a small number of matches would perform terribly. > > We've speculated about trying to deal with the

Re: [PERFORM] Searching for the cause of a bad plan

2007-09-27 Thread Tom Lane
Csaba Nagy <[EMAIL PROTECTED]> writes: > On Wed, 2007-09-26 at 11:22 -0400, Tom Lane wrote: >> ... how >> many values of "a" are there really, and what's the true distribution of >> counts? > table_a has 23366 distinct values. Some statistics (using R): >> summary(table_a_histogram) >a

Re: [PERFORM] Difference in query plan when using = or > in where clause

2007-09-27 Thread Heikki Linnakangas
Radhika S wrote: > I am curious as to why this occurs. Why does an = change the query plan so > drastically? > > When my query is: > Select count(*) from View_A WHERE tradedate = '20070801'; > The query plan is as below: > ... > But when my query is: > Select count(*) from View_A WHERE tradedate B

Re: [PERFORM] Searching for the cause of a bad plan

2007-09-27 Thread Csaba Nagy
On Wed, 2007-09-26 at 11:22 -0400, Tom Lane wrote: > ... how > many values of "a" are there really, and what's the true distribution of > counts? table_a has 23366 distinct values. Some statistics (using R): > summary(table_a_histogram) a count Min. : 7857

Re: [PERFORM] REPOST: Nested loops row estimates always too high

2007-09-27 Thread Ow Mun Heng
On Wed, 2007-09-26 at 00:02 -0400, Tom Lane wrote: > Ow Mun Heng <[EMAIL PROTECTED]> writes: > > Where can I erad more about this new "feature"? > > http://developer.postgresql.org/pgdocs/postgres/sql-createfunction.html > > http://developer.postgresql.org/pgdocs/postgres/ always has a current >