Re: Should from_collapse be switched off? (queries 10 times faster)

2018-03-24 Thread Laurenz Albe
Peter wrote: > On Fri, Mar 23, 2018 at 10:14:19AM -0400, Tom Lane wrote: > > ! It's conceivable that the OP's problem is actually planning time > ! (if the query joins sufficiently many tables) and that restricting > ! the cost of the join plan search is really what he needs to do. > > Negative.

Re: functions: VOLATILE performs better than STABLE

2018-03-24 Thread Laurenz Albe
Peter wrote: > Given an arbitrary function fn(x) returning numeric. > > Question: how often is the function executed? > [...] > C. > select v.v,v.v from (select fn('const') as v) as v; > > Answer: > Once if declared VOLATILE. > Twice if declared STABLE. > > Now this IS a surprize. It is clear th