prorm API Reference
    Preparing search index...

    Class QueryOptimizer

    Main query optimizer class that combines all optimization features

    Index
    • Execute an optimized query with caching support

      Parameters

      • sql: string
      • Optionaloptions: {
            params?: any[];
            useCache?: boolean;
            usePreparedStatement?: boolean;
            hint?: QueryHint[];
            skipSlowLog?: boolean;
        }

      Returns Promise<{ result: any; fromCache: boolean; duration: number }>

    • Perform batch update with optimization

      Parameters

      • tableName: string
      • records: Record<string, any>[]
      • OptionalidentifierColumn: string
      • Optionaloptions: Partial<BatchOptions>

      Returns Promise<BatchResult<any>>

    • Get optimization statistics

      Returns {
          slowQuery: QueryStatistics | undefined;
          preparedStatementCache: CacheStats | undefined;
          queryResultCache:
              | { size: number; maxSize: number; hitCount: number }
              | undefined;
      }