Re: [SQL] sorting by day of the week

2006-01-24 Thread ipv
Hi, Try to use a calculated index: (tested similar solution, but not this code) CREATE OR REPLACE FUNCTION TestOrder (nameTable.weekDay%TYPE) RETURNS INT AS ' DECLARE numWeekDay INT; BEGIN if ($1 = ''Wed'') then numWeekDay := 1; if ($1 = ''Tue'') then numWeekDay := 2; . RETURN (nu

Fw: [SQL] stored procedures for complex SELECTs

2006-01-24 Thread ipv
For better performance, try to utilize prepared statements; example: PREPARE CPrep_Clients (varchar(20)) AS SELECT * FROM client WHERE nom = $1; EXECUTE CPrep_Clients('Francio'); In my system, over 51ms difference between standard select (prepared by-pass planification/optimization) Reg

Re: [SQL] Does VACUUM reorder tables on clustered indices

2005-12-20 Thread ipv
Hi, Utilize CLUSTER; (after vacuum) to reorder the data. Regards - Original Message - From: "Jim C. Nasby" <[EMAIL PROTECTED]> To: "Martin Marques" ; "frank church" <[EMAIL PROTECTED]>; Sent: Tuesday, December 20, 2005 10:41 PM Subject: Re: [SQL] Does VACUUM reorder tables on clust