@@ -147,8 +147,6 @@ func NewStatementHintsCache(
147147func (c * StatementHintsCache ) Start (
148148 ctx context.Context , sysTableResolver catalog.SystemTableIDResolver ,
149149) error {
150- // TODO(drewk): in a follow-up commit, block until the initial scan is done
151- // so that statements without hints don't have to check the LRU cache.
152150 return c .startRangefeedInternal (ctx , sysTableResolver )
153151}
154152
@@ -393,7 +391,7 @@ func (c *StatementHintsCache) GetGeneration() int64 {
393391// retrieving them.
394392func (c * StatementHintsCache ) MaybeGetStatementHints (
395393 ctx context.Context , statementFingerprint string ,
396- ) (hints []hintpb.StatementHint , ids []int64 ) {
394+ ) (hints []hintpb.StatementHintUnion , ids []int64 ) {
397395 hash := fnv .New64 ()
398396 _ , err := hash .Write ([]byte (statementFingerprint ))
399397 if err != nil {
@@ -451,7 +449,7 @@ func (c *StatementHintsCache) maybeWaitForRefreshLocked(
451449// released while reading from the db, and then reacquired.
452450func (c * StatementHintsCache ) addCacheEntryLocked (
453451 ctx context.Context , statementHash int64 , statementFingerprint string ,
454- ) (hints []hintpb.StatementHint , ids []int64 ) {
452+ ) (hints []hintpb.StatementHintUnion , ids []int64 ) {
455453 c .mu .AssertHeld ()
456454
457455 // Add a cache entry that other queries can find and wait on until we have the
@@ -516,7 +514,7 @@ func (c *StatementHintsCache) getStatementHintsFromDB(
516514 datums := it .Cur ()
517515 rowID := int64 (tree .MustBeDInt (datums [0 ]))
518516 fingerprint := string (tree .MustBeDString (datums [1 ]))
519- hint , err := hintpb .NewStatementHint ([]byte (tree .MustBeDBytes (datums [2 ])))
517+ hint , err := hintpb .FromBytes ([]byte (tree .MustBeDBytes (datums [2 ])))
520518 if err != nil {
521519 return err
522520 }
@@ -543,7 +541,7 @@ type cacheEntry struct {
543541 // be duplicate entries in the fingerprints slice.
544542 // TODO(drewk): consider de-duplicating the fingerprint strings to reduce
545543 // memory usage.
546- hints []hintpb.StatementHint
544+ hints []hintpb.StatementHintUnion
547545 fingerprints []string
548546 ids []int64
549547}
@@ -552,7 +550,7 @@ type cacheEntry struct {
552550// fingerprint, or nil if they don't exist. The results are in order of row ID.
553551func (entry * cacheEntry ) getMatchingHints (
554552 statementFingerprint string ,
555- ) (hints []hintpb.StatementHint , ids []int64 ) {
553+ ) (hints []hintpb.StatementHintUnion , ids []int64 ) {
556554 for i := range entry .hints {
557555 if entry .fingerprints [i ] == statementFingerprint {
558556 hints = append (hints , entry .hints [i ])
0 commit comments