Support Article
Poor performance caused by SQL script
SA-346
Summary
Performance problem within Oracle SQL alerts were found in log. The problem appears in Select against a custom work item table, where a pzInsKey reference was imposed in the Where clause of the Select.
Error Messages
Not Applicable
Steps to Reproduce
There is no specific use case to replicate the issue.
Root Cause
The following Select was issued against the database:
select pzPVStream from XXX_YYYNotifications where pzInsKey = ?
The first 32 characters of All instances of this property contained a common string value:
ZZ-AAA-BBB-XXX-DATA-DOCUMENTNOTI
Due to this non-uniqueness, the Oracle Optimizer rejected the use of any existing Indexes on this table or property, and will resort to full table scans to resolve the SQL.
Resolution
Perform the following local-change:
1. Delete the Histogram Data on XXX_YYYNOTIFICATIONS table and PZINSKEY property.
2. Configure the database to not compute Histogram data for this property during future Compute or Estimate table statistics.
3. Trigger a regeneration of index data on the table.
4. Tune Oracle to use Indexes rather than performing a Full Table Scan.
Published March 17, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.