• Oracle Filtered Index Implementation

    Creating a Conditional Oracle Index Equivalent to a Partial Index in PostgreSQL

    The post discusses the use of partial indexes as a solution for improving query performance. It explains that a partial index is built over a subset of a table defined by a conditional expression. By excluding common values, it reduces index size, speeds up relevant queries, and improves table update operations. The author shares their successful implementation of a filtered index solution in Oracle, achieving a 98% performance boost.


  • Histogram directs to wrong execution plan

    Column statistics – histogram negatively affected query performance

    In a critical OLTP database, a long-running query caused a “Latch: cache buffer chains” wait event issue. To address this, the query was optimized by making use of a deterministic function and using scalar subquery caching. When the table partitioning strategy was changed, the issue was resolved, but a batch job suffered performance issues. Investigating further, it was found that the optimizer’s choice changed after table statistics were refreshed, leading to degraded query performance. Various solutions were explored to address this, including using an index hint, fixing the plan with a baseline, using a SQL profile and rewriting the query.


  • force direct path read

    Optimizing Direct Path Read Decision with Table_Stats Hint

    This content discusses manipulation of table statistics and direct path read decisions in Oracle database. It explores the usage of the table_stats hint to force a direct path read and the impact of various thresholds on this decision. The author shares their findings, including challenges faced and solutions tried, such as using OPT_PARAM hint and optimizing rownum filter. The post concludes with a resolution to the issue.


  • Oracle CBO takes decision

    Direct Path Read Decision in Oracle: Beyond the Optimizer

    The performance issue with an SQL query was resolved by using the /*+ PARALLEL(2) */ hint, reducing execution time from 180-200 seconds to milliseconds. The decision to perform a direct read from disk to memory instead of reading blocks from disk was made by the database engine and is controlled by the hidden “_serial_direct_read” parameter. To force direct path read for SQL statements, the running statement can be used with a parallel hint or by setting table statistics. This solution allows for applying a SQL patch and significantly improves query performance.


  • Reset gc_policy_minimum parameter to default

    “_gc_policy_minimum” parameter and Dynamic Resource Management in Oracle RAC

    The content discusses the concept of remastering in database management, particularly regarding Oracle RAC. It explains how remastering reallocates resources among nodes during changes, which can temporarily disrupt access to data. The innovative “lazy remastering” technique minimizes these disruptions by focusing on critical resources, allowing most processes to continue uninterrupted. In upcoming releases from 19.20 onwards, the default value for “_gc_policy_minimum” will change due to an internal bug. It will be reset to 15000, eliminating the need for manual tuning. DRM attributes are intentionally undocumented and should not be altered without support consultation.