[PERFORM] Queries slow using stored procedures

2004-10-24 Thread Rod Dutton
Hi, Has anybody got any ideas on my recent posting ? (thanks in advance) :- I have a problem where a query inside a function is up to 100 times slower inside a function than as a stand alone query run in psql. The column 'botnumber' isa character(10), is indexed and there are 125000

Re: [PERFORM] Queries slow using stored procedures

2004-10-24 Thread John Meinel
Rod Dutton wrote: Hi, Has anybody got any ideas on my recent posting ? (thanks in advance) :- I have a problem where a query inside a function is up to 100 times slower inside a function than as a stand alone query run in psql. The column 'botnumber' is a character(10), is indexed and

Re: [PERFORM] Queries slow using stored procedures

2004-10-24 Thread John Meinel
Rod Dutton wrote: Thank John, I am running Postgres 7.3.7 on a Dell PowerEdge 6600 Server with Quad Xeon 2.7GHz processors with 16GB RAM and 12 x 146GB drives in Raid 10 (OS, WAL, Data all on separate arrays). You might want think about upgraded to 7.4, as I know it is better at quite a few

Re: [PERFORM] Queries slow using stored procedures

2004-10-24 Thread John Meinel
Rod Dutton wrote: I also should add that the sp is only slow when the table is big (probably obvious!). Rod Sure, the problem is it is switching to a sequential search, with a lot of rows, versus doing an indexed search. It's all about trying to figure out how to fix that, especially for any

Re: [PERFORM] Queries slow using stored procedures

2004-10-19 Thread Alban Medici (NetCentrex)
."batchserial ".; END LOOP; --else return 0; END;'language plpgsql ; does it return the same results in the same time ? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rod DuttonSent: lundi 18 octobre 2004 20:01To: [EMAIL PROTECTED]Subject: [PERFORM] Queries slow usi

[PERFORM] Queries slow using stored procedures

2004-10-18 Thread Rod Dutton
Hi, I have a problem where a query inside a function is up to 100 times slower inside a function than as a stand alone query run in psql. The column 'botnumber' isa character(10), is indexed and there are 125000 rows in the table. Help please! This query is fast:- explain analyze