Re: [GENERAL] Weird performance issue with custom function with a for loop.

2011-02-01 Thread Nicos Panayides
On 02/01/2011 06:52 PM, Tom Lane wrote: Nicos Panayides writes: On 01/31/2011 08:48 PM, Tom Lane wrote: It seems likely that you're getting a different plan for the generic case because that user id isn't representative of the overall average for the column. I tried the

Re: [GENERAL] Weird performance issue with custom function with a for loop.

2011-02-01 Thread Tom Lane
Nicos Panayides writes: > On 01/31/2011 08:48 PM, Tom Lane wrote: >> It seems likely that you're getting a different plan for the generic >> case because that user id isn't representative of the overall average >> for the column. > I tried the prepared statement with both $1 and 1811 for user_id

Re: [GENERAL] Weird performance issue with custom function with a for loop.

2011-02-01 Thread Nicos Panayides
On 01/31/2011 08:48 PM, Tom Lane wrote: Nicos Panayides writes: the following function takes forever to execute as is. I see 'Inserting original actions in temporary table' and nothing after that. If i replace orig_user_id in the FOR loop with 1811 (the same orig_user_id passed as the funct

Re: [GENERAL] Weird performance issue with custom function with a for loop.

2011-01-31 Thread Tom Lane
Nicos Panayides writes: > the following function takes forever to execute as is. I see 'Inserting > original actions in temporary table' and nothing after that. If i > replace orig_user_id in the FOR loop with 1811 (the same orig_user_id > passed as the function parameter) it returns immediatel

[GENERAL] Weird performance issue with custom function with a for loop.

2011-01-31 Thread Nicos Panayides
Hello, the following function takes forever to execute as is. I see 'Inserting original actions in temporary table' and nothing after that. If i replace orig_user_id in the FOR loop with 1811 (the same orig_user_id passed as the function parameter) it returns immediately correctly (the table