Re: [PERFORM] Performance problems inside a stored procedure.

2008-02-05 Thread Matthew Lunnon
Thanks for your help Андрей your English is easily understandable and much better than my ... (Russian?). I managed to get the results of an analyze and this showed that an index was not being used correctly. It seems that I was passing in a varchar and not casting it to an int and this stopped

Re: [PERFORM] Performance problems inside a stored procedure.

2008-01-29 Thread Matthew Lunnon
Thanks Euler, I made the change to STABLE but it didn't seem to make any difference. On closer inspection it seems to have been a casting problem, I was passing a varchar into the function and then testing this for equality with an integer. The planner seems to have been unable to use this t

Re: [PERFORM] Performance problems inside a stored procedure.

2008-01-29 Thread Euler Taveira de Oliveira
Matthew Lunnon wrote: Ahh, sorry, I have been too aggressive with my cutting, I am running 8.2.6 and the function is below. $BODY$ LANGUAGE 'sql' VOLATILE; ^^ I suspect that it's because you're using VOLATILE (so no good optimizations is done); did you try STABL

Re: [PERFORM] Performance problems inside a stored procedure.

2008-01-28 Thread Matthew Lunnon
Ahh, sorry, I have been too aggressive with my cutting, I am running 8.2.6 and the function is below. Thanks. Matthew CREATE OR REPLACE FUNCTION sp_get_price_panel_id(int4, "varchar", "varchar", "varchar", bpchar) RETURNS SETOF t_market_price_panel AS $BODY$ SELECT * FROM market mrkt J

Re: [PERFORM] Performance problems inside a stored procedure.

2008-01-28 Thread Heikki Linnakangas
Matthew Lunnon wrote: I have a query which runs pretty quick ( 0.82ms) but when I put it inside a stored procedure it takes 10 times as long (11.229ms). Is this what you would expect and is there any way that I can get around this time delay? It depends. You'll need to show us the function.

[PERFORM] Performance problems inside a stored procedure.

2008-01-28 Thread Matthew Lunnon
Hi ms I have a query which runs pretty quick ( 0.82ms) but when I put it inside a stored procedure it takes 10 times as long (11.229ms). Is this what you would expect and is there any way that I can get around this time delay? postgres.conf changes. shared_buffers = 500MB work_mem = 10MB