Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Tips - Function-based indexes

User_1871May 15 2022 — edited May 16 2022

I'm a novice trying to learn about function-based indexes. Any tips?
For example:
In the query that uses the FBI, make sure you have a IS NOT NULL where clause:
"The optimizer can only use an index (in place of a table) if it knows that the index entries are one-for-one with the table. Because it does not know if the expression may return a NULL (which are NOT stored in the index). It cannot make that direct swap unless you inform the optimizer."
"Hence SELECT ROOT FROM TST_AGG will not have the chance to use the index, but SELECT ROOT FROM TST_AGG WHERE ROOT IS NOT NULL should be able to."
Function Based Index not improving query performance
The function should also handle nulls. For example, if null values get passed into the function (such as a null X or Y), then the function should handle that by returning null — so that the function doesn't error-out. If that happens though, and the function does return nulls, then I think that means the query won't use the index; it'll do a full table scan instead. Unless, as mentioned in #1 above, the query's where clause has a IS NOT NULL .
Any functions used in the index must be defined as deterministic.
If you change the semantics of a DETERMINISTIC function and recompile it, then you must manually rebuild any dependent function-based indexes and materialized views. Otherwise, they report results for the prior version of the function.
Disadvantages of Function-Based Indexes
Edit: A SQL hint might be an option -- to force Oracle to use the FBI:
/*+ INDEX (parcels shape_idx) */
Set a SQL hint to instruct the Oracle optimizer in choosing an execution plan.
Related: Function-based spatial indexes

Comments

3156
Hi, Andras,

Please check Reports security policy in your Portal instance.

(1). Is there a Reports Definition File object created for test.jsp? If yes, did you select server rep_dkipcias as one of the Reports server that test.jsp can run against?

(2). Are the SSO user allowed to run the test.jsp against server dkipcias(check Access tab of report and server component)?

This error usually is caused by a security rule setup in your Portal. Please check.

-Jeff
320094
Hi Jeff,

Q(1): Yes.
(Report Name and Servers tab)
Report Server: REP_DKIPCIAS
Oracle Reports File Name: test.jsp
Execute: as JSP
(Other tabs)
Default values. Unchanged.
Q(2): (Acces Tab of Report Component)
Publish to Portal = checked
Inherit Privileges from Portal DB Provider = checked
(Acces Tab of Report Server Component)
Inherit Privileges from Portal DB Provider = checked

(SSO User)
The user I try to run the report with has the following group assignments:
Privilege Group
PORTAL_ADMINISTRATORS
PORTAL_DEVELOPERS
DBA
PORTLET_PUBLISHERS

Additional Info:

To be more specific: The mentioned security check failure exists outside of Portal as well. Eg. when we try to run the default portal test examples (test.jsp, test.rdf) from the iAS home page Demonstartions tab.

Thank You in advance,
Andras
3156
Hi, Andras,

(1). In the Reports Server component, is check box "Run Only Registered Report Definition Files" checked? If yes, try uncheck it.

(2). In the Access tab of Reports server & report component, uncheck the "Inherit Privileges from Portal DB Provider" checkbox. This should give you a list of users/groups who has at least Execute privilege on the report. Please make sure SSO user(or one of its group) is among the list.

BTW, it does not matter whether you run the report from inside Portal, or directly from browser location window. The same security policy will be applied.

Regards,

-Jeff
1 - 3

Post Details

Added on May 15 2022
5 comments
692 views