Subject Re: [firebird-support] sometime can not Load record
Author Helen Borrie
At 06:34 AM 11/03/2009, you wrote:
>for all DBA Master..
>at my table i have some index MYSS1 ( Create index myss1 on myss(p_tgl,p_lok,p_meja,p_flag) buit i dont have Primary Key.
>every application run i used command : "ALTER TABLE MYSS1 ACTIVE"
>i have command sql at my aplication :
> " select p_meja,p_sku,p_sell,p_disc,sum(p_qty),p_tax from myss where p_tgl='01/01/2009' and P_LOK='01' AND p_meja='R301' AND P_FLAG =' ' order by p_meja,p_sku,p_sell,p_disc PLAN (myss order myss1) group by p_meja,p_sku,p_sell,p_disc "
>for starting this week sometime i can not load this record data. but
>after i am run sql : 'ALTER INDEX MYSS1 ACTIVE'
>I can load this data again.
>why ?
>something wrong at my sql command

>If you hard-code the plan into the select statement, you prevent the Firebird engine from using its own plan. So, of course, if you deactivate any index that is referred to in that hard-coded plan, the index is unavailable and so the plan is invalid.

>and my structure table ?

Why no primary key?
and why do you deactivate indexes? You need to sort that problem out. It is not a healthy thing to have user applications running "ALTER TABLE MYSS1 ACTIVE". That is something only the DBA should do, and only as a final step in an exclusive DBA-only operation that deactivated the index in question.