-
Is it possible to create function based index on columns from multiple tables
Hi, I have two tables: tab1 and tab2, I have the following query
select tab1.*, tab2.*, function1(tab1.col1, tab2.col1, tab2.col2)
from tab1, tab2
where tab1.col3 = tab2.col3
and function1(tab1.col1, tab2.col1, tab2.col2) = sysdate;
Is it possible to create function based index on function1(tab1.col1, tab2.col1, tab2.col2) which using columns from two tables?
Oracle 8, 8i, 9i OCP DBA
Oracle 6/6i OCP DEV
Sun Solaris8 SCSA
MCDBA 2000
-
What version of Oracle are you using the function based index in?
What kind of function are you using and is it deterministic?
https://docs.oracle.com/cd/E11882_01...s.htm#ADFNS257
It could be the solution is not to use function based indexes, but to use a sub query as a with clause.
Using a with clause is like creating a temp table that can get joined to the main tables in the query.
Using a function can be slow because the function will get executed once for every row.
So what does your function do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|