Sysprocplan
Posted in 2003
<html><div style='background-color:'><DIV>We have had this problem on 7.31TC4 (Windoze) and it has been confirmed as a<BR>bug. I don't know if it exists on any/all other versions.<BR><BR>----- Original Message -----<BR>From: "Bill Dare" <<A href="mailto:dareb@jevic.com">dareb@jevic.com</A>><BR>To: <<A href="mailto:janto@luzdelsur.com.pe">janto@luzdelsur.com.pe</A>>; <<A href="mailto:informix-list@iiug.org">informix-list@iiug.org</A>><BR>Sent: Tuesday, May 06, 2003 5:56 AM<BR>Subject: RE: sysprocplan ??<BR><BR><BR>> The link below will give you a good description of the problem(IBM calls<BR>it<BR>> documented behavior) you are expieriencing:<BR>><BR>><BR><A href="http://www-1.ibm.com/support/docview.wss?rs=203&context=SW000&q=sysprocplan">http://www-1.ibm.com/support/docview.wss?rs=203&context=SW000&q=sysprocplan</A>&<BR>> uid=swg21079720&loc=en_US&cs=utf-8&lang=en<BR>><BR>> My problem with this were with ! 2 stored procedures called from triggers.<BR>> The triggers were on very dynamic tables, constantly updated and inserted<BR>> to. Every time update statistics was run on the tables accessed by the<BR>> procedures, users accessing the table with the trigger got a lock on<BR>> sysprocplan and held it until the transaction was committed. Effectively,<BR>> an exclusive table level lock on the table with the trigger. So, I get a<BR>> user creating a manifest which takes about 3-4 minutes all in a single<BR>> transaction. The other ~300 users have to wait until that is finished.<BR>><BR>> The best way around the problem is to SET OPTIMIZATION LOW. Since this is<BR>> not a valid statement in a trigger I had to call an intermediate stored<BR>> procedure, SET OPTIMIZATION LOW there and then call the real stored<BR>> procedure. I've had no problems since I made that change.<BR>><BR>> Regards,<BR>> Bill D! are<BR>><BR>> > -----Original Message-----<BR>> &g! t; From: <A href="mailto:janto@luzdelsur.com.pe">janto@luzdelsur.com.pe</A> [SMTP:janto@luzdelsur.com.pe]<BR>> > Sent: Monday, May 05, 2003 8:54 PM<BR>> > To: <A href="mailto:informix-list@iiug.org">informix-list@iiug.org</A><BR>> > Subject: sysprocplan ??<BR>> ><BR>> > I have a problems whit stores procedures, why do I need to update<BR>> > statistics for table before update statistic for procedures ?<BR>> > It's my procedure:<BR>> ><BR>> > create procedure "sistec".tiempo_paso(vfec_entrega date,<BR>> > vfec_admisible date,vtiempo_lds integer,vetapa char(1),vestado<BR>> > char(1),<BR>> > vfec_aprobador date,vtip_solicitud char(2))<BR>> > returning integer;<BR>> > define vartiempo_paso integer;<BR>> > if vestado = 'A' or vestado = 'F' then<BR>> > if vtip_solicitud <> 'TD' then<BR>> > if vetapa ! = 'E' or vetapa = 'P' then<BR>> > let vartiempo_paso = vfec_entrega - vfec_admisible;<BR>> > else<BR>> > select vtiempo_lds - (today - vfec_admisible) into<BR>> > vartiempo_paso<BR>> > from dual;<BR>> > end if<BR>> > else<BR>> > if vetapa = 'A' then<BR>> > let vartiempo_paso = vfec_aprobador - vfec_admisible;<BR>> > else<BR>> > select vtiempo_lds - (today - vfec_admisible) into<BR>> > vartiempo_paso<BR>> > from dual;<BR>> > &nb! sp; end if<BR>> > end if<B! R>> & gt; else<BR>> > let vartiempo_paso = 0;<BR>> > end if<BR>> > if vartiempo_paso is null then<BR>> > let vartiempo_paso = 0;<BR>> > end if<BR>> > return vartiempo_paso;<BR>> > end procedure;<BR>> ><BR>> > I update statistics for procedure before update statistics for table,<BR>> > and<BR>> > the sysprocplan table becomes locked and gives a second user an SQL<BR>> > -211 error.<BR>> > I'm using Informix Online 7.31FD3W1<BR>><BR>><BR><BR></DIV></div><br clear=all><hr>Add photos to your messages with <a href="http://g.msn.com/8HMKENUS/2749">MSN 8. </a> Get 2 months FREE*.</html>