To create a deterministic function, use DETERMINISTIC
clause next to return type declaration,
see syntax here.
create or replace function extraer_doc_id(viParam VARCHAR2)
return varchar2
DETERMINISTIC
is
begin
RETURN replace(regexp_substr(viParam, '&idDocunet=\d+'), 'idDocunet=', NULL);
end extraer_doc_id;
You created a function based index that references my_column field:
replace(regexp_substr(**my_column**, '&idDocunet=\d+'), 'idDocunet=', NULL)
but in the where
clause of the query you are using a function that is different from the function in the index (different column):
WHERE replace(regexp_substr(**parametros**, '&idDocunet=\d+'), 'idDocunet=', NULL) = 799493
so Oracle cannot use this index for this query, these expressions are different.
Also do not use ANALYZE TABLE
, this command was deprecated in 10g, use DBMS_STATS instead: