Re: [PERFORM] constant vs function param differs in performance

2003-11-19 Thread SZŰCS Gábor
Dear Tom, Thanks for your early response. An addition: the nastier difference increased by adding an index (it was an essential index for this query): func with param improved from 2700ms to 2300ms func with constant improved from 400ms to 31ms inline query improved from 390ms to 2ms So a

Re: [PERFORM] constant vs function param differs in performance

2003-11-14 Thread Tom Lane
"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <[EMAIL PROTECTED]> writes: > I have two SQL function that produce different times and I can't understand > why. The planner often produces different plans when there are constants in WHERE clauses than when there are variables, because it can get more accurate

[PERFORM] constant vs function param differs in performance

2003-11-14 Thread SZŰCS Gábor
Dear Gurus, I have two SQL function that produce different times and I can't understand why. Here is the basic difference between them: CREATE FUNCTION test_const_1234 () RETURNS int4 AS ' SELECT ... 1234 ... 1234 1234 ... ' LANGUAGE 'SQL'; CREATE FUNCTION test_param (int4) RETURNS int4 A