Re: [GENERAL] Horrible/never returning performance using stable function on WHERE clause

2016-03-29 Thread Achilleas Mantzios
Hello David On 29/03/2016 14:04, David Rowley wrote: On 29 March 2016 at 20:01, Achilleas Mantzios wrote: We are using PostgreSQL 9.3. Shouldn't the optimizer use a single call to get_machdef_sister_defids in get_machdef_sister_defids_maxrh ?? It shouldn't be up

Re: [GENERAL] Horrible/never returning performance using stable function on WHERE clause

2016-03-29 Thread David Rowley
On 29 March 2016 at 20:01, Achilleas Mantzios wrote: > We are using PostgreSQL 9.3. Shouldn't the optimizer use a single call to > get_machdef_sister_defids in get_machdef_sister_defids_maxrh ?? It shouldn't be up to the optimizer to evaluate a STABLE function. Only

[GENERAL] Horrible/never returning performance using stable function on WHERE clause

2016-03-29 Thread Achilleas Mantzios
Hello list, I have written some functions to extract some data from our DB, from an hierarchical structure, the problem is that if a function doing lookups is defined as STABLE in the WHERE clause the performance is horrible. What I am trying to achieve is given a specific node in an