@@ -311,20 +311,19 @@ public List<Dictionary<string, object>> ExecuteQuery(CachedQueryPlan plan, Dicti
311311 // B8: direct hash-index point lookup for `WHERE indexed_col = @param|literal`. This
312312 // skips building a WHERE string and re-parsing it inside SelectInternal — the single
313313 // biggest overhead difference vs the Direct API (FindByIndex) on point reads.
314- if ( TryResolveWhereValue ( simple , parameters , out var whereValue ) && whereValue is not null )
314+ if ( TryResolveWhereValue ( simple , parameters , out var whereValue ) &&
315+ whereValue is not null &&
316+ table is DataStructures . Table concrete &&
317+ concrete . TrySelectIndexedPointLookup ( simple . WhereColumn , whereValue , out var indexRows ) )
315318 {
316- if ( table is DataStructures . Table concrete &&
317- concrete . TrySelectIndexedPointLookup ( simple . WhereColumn , whereValue , out var indexRows ) )
318- {
319- if ( simple . Offset . HasValue && simple . Offset . Value > 0 )
320- indexRows = [ .. indexRows . Skip ( simple . Offset . Value ) ] ;
319+ if ( simple . Offset . HasValue && simple . Offset . Value > 0 )
320+ indexRows = [ .. indexRows . Skip ( simple . Offset . Value ) ] ;
321321
322- if ( simple . Limit . HasValue && simple . Limit . Value > 0 )
323- indexRows = [ .. indexRows . Take ( simple . Limit . Value ) ] ;
322+ if ( simple . Limit . HasValue && simple . Limit . Value > 0 )
323+ indexRows = [ .. indexRows . Take ( simple . Limit . Value ) ] ;
324324
325- results = concrete . DeduplicateByPrimaryKey ( indexRows ) ;
326- return true ;
327- }
325+ results = concrete . DeduplicateByPrimaryKey ( indexRows ) ;
326+ return true ;
328327 }
329328
330329 // Fallback: build the WHERE string exactly like the legacy binder and let the table
0 commit comments