Re: [GENERAL] Slow queries in PL/PGSQL function

2004-06-08 Thread Gary Doades
It's OK, I'm an idiot. I read s many times that you need to get the data types in the query the same as the column types or indexes won't work. So I go and get it wrong! I had defined the parameter to the function as timestamp (equivalent to SQLServer datetime), but the column data type is

Re: [GENERAL] Slow queries in PL/PGSQL function

2004-02-28 Thread Gary Doades
Thank for the reply. I will move this onto the perfromance group, except that for some odd reason I cant see a performance group on usenet. I will subscribe to the mailing list I will gladly upload the schema (script) or anything else that anyone wants, but it may not be appropriate for a n

Re: [GENERAL] Slow queries in PL/PGSQL function

2004-02-20 Thread Gary Doades
I have a very similar problem. I put the following SQL into a function: SELECT VS.*,VL.TEL1,SC.CONTRACT_ID,SC.CONTRACT_REF, SC.MAX_HOURS, SC.MIN_HOURS, (SELECT COUNT(*) FROM TIMESHEET_DETAIL JOIN MAIN_ORDER ON (MAIN_ORDER.ORDER_ID = TIMESHEET_DETAIL.ORDER_ID AND MAIN_ORDER.CLIENT_ID = $3) WHERE