Re: [PERFORM] Help with optimizing a query over hierarchical data

2014-03-04 Thread Damon Snyder
Hi Claudio, Thanks for the help! Damon On Mon, Mar 3, 2014 at 8:20 PM, Claudio Freire wrote: > On Mon, Mar 3, 2014 at 10:12 PM, Damon Snyder > wrote: > > > >> Um... I think your problem is a misuse of CTE. Your CTE is building an > > intermediate of several thousan

Re: [PERFORM] Help with optimizing a query over hierarchical data

2014-03-03 Thread Damon Snyder
to be smarter about that. > > On Mon, Mar 3, 2014 at 2:55 PM, Damon Snyder > wrote: > > Hi Claudio, > > Thanks for responding. Here is the explain ( > http://explain.depesz.com/s/W3W) > > for the ordering by meta container starting on line 192 > > ( > https

Re: [PERFORM] Help with optimizing a query over hierarchical data

2014-03-03 Thread Damon Snyder
le wal_buffers | 16MB | configuration file work_mem | 8MB| configuration file (32 rows) On Sat, Mar 1, 2014 at 5:02 PM, Claudio Freire wrote: > On Fri, Feb 28, 2014 at 5:01 PM, Damon Snyder > wrote: > > The primary query

[PERFORM] Help with optimizing a query over hierarchical data

2014-03-01 Thread Damon Snyder
Hi Everyone, We have a data set and access pattern that is causing us some performance issues. The data set is hierarchical with about 2 million rows at the lowest level (object), followed by 500k at the next level (container) and approximately 10 at the highest level (category). The way the data

Re: [PERFORM] Rather large LA

2011-09-06 Thread Damon Snyder
If you are not doing so already, another approach to preventing the slam at startup would be to implement some form of caching either in memcache or an http accelerator such as varnish (https://www.varnish-cache.org/). Depending on your application and the usage patterns, you might be able to fairl

Re: [PERFORM] Stored procedure declared as VOLATILE => no good optimization is done

2010-10-29 Thread Damon Snyder
Thank you for all of the responses. This was really helpful. Damon On Sat, Oct 16, 2010 at 12:54 PM, Merlin Moncure wrote: > On Fri, Oct 15, 2010 at 10:31 PM, Tom Lane wrote: > > Tatsuo Ishii writes: > >> So can I say "if a function is marked IMMUTABLE, then it should never > >> modify databa

[PERFORM] Stored procedure declared as VOLATILE => no good optimization is done

2010-10-15 Thread Damon Snyder
Hello, I have heard it said that if a stored procedure is declared as VOLATILE, then no good optimizations can be done on queries within the stored procedure or queries that use the stored procedure (say as the column in a view). I have seen this in practice, recommended on the irc channel, and in