Month: November 2023

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

    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.

  • Column statistics – histogram negatively affected query performance

    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.

  • Optimizing Direct Path Read Decision with Table_Stats Hint

    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.

  • Child Cursors Related with LANGUAGE_MISMATCH

    Child Cursors Related with LANGUAGE_MISMATCH

    The content discusses an issue with non-shared cursors in a production database due to differing NLS settings, leading to increased child and version counts under “LANGUAGE_MISMATCH.” It details the specific NLS settings, their impact, and solutions, such as monitoring login triggers, detecting NLS settings, and standardizing NLS_ENV settings for scheduler jobs.