Re: Tuning
Posted in 1996
Let's see... First you could try to get rid of the SUM. I know under the 4.1 SE the SUM slowed things down quite a bit. Do you have any indexes on the table? How many rows? Use of the YEAR function will cause Informix to NOT use the index even if there is one on the przydzial.miesiac field. If it's executed multiple times in a run of the program, you probably should PREPARE the statement. That has the potential to help a lot. If you have indexes, adding the line SET EXPLAIN ON in your code will allow you to see which (if any) of the indexes the program is using. See the manual for all the details. I think the output goes by default into a sqlqexplain.out or something like that. Hope that helps some. -- Frank >> SELECT SUM(przydzial.godziny) >> INTO arr_przyd_sc[counter].suma_rok >> FROM przydzial >> WHERE YEAR(przydzial.miesiac)=YEAR(przyd_bufor.miesiac) >> AND przydzial.zad_id = przyd_bufor.zad_id >> >> This is description of table: >> "przydzial" : zad_id INTEGER, >> prac_id INTEGER, >> miesiac DATETIME YEAR TO MONTH, >> godziny INTEGER >> It is used on small OnLine 4.1 with overloaded system but I was asked >>to change code. Any suggestions ?