Skip to content

Conversation

devsergiy
Copy link
Member

@coderabbitai summary

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.

Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sergiy/eng-8285-improve-query-planning-time

Comment @coderabbitai help to get the list of available commands and usage tips.

@devsergiy devsergiy force-pushed the sergiy/eng-8285-improve-query-planning-time branch from 85594c9 to 8cb0c3c Compare October 20, 2025 11:18
Copy link
Contributor

@ysmolski ysmolski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First half of review...

Comment on lines +1413 to +1416
ctx := context.Background()
labels := pprof.Labels("walker_id", w.walkerID)

pprof.Do(ctx, labels, func(ctx context.Context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we okay with putting this into production?

Comment on lines +27 to 28
walker := astvisitor.WalkerFromPool2("A")
defer walker.Release()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets walker from walkerPoolA, but Release will put it back to walkerPool

Comment on lines +146 to +171
func WalkerFromPool2(pool string) *Walker {
switch pool {
case "A":
walker := walkerPoolA.Get()
if walker == nil {
w := NewWalkerWithID(8, "RepresentationVariables")
return &w
}
return walker.(*Walker)
case "B":
walker := walkerPoolB.Get()
if walker == nil {
w := NewWalkerWithID(8, "CollectNodes")
return &w
}
return walker.(*Walker)
default:
walker := walkerPool.Get()
if walker == nil {
w := NewWalker(8)
return &w
}
return walker.(*Walker)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function might be doing too much. The only thing that is actually used here is the case "A" branch. Also for the pool we can define how to create a new instance of the object via the New method:

walkerPoolA = sync.Pool{
	New: func() any {
		return new(NewWalkerWithID(8, "RepresentationVariables"))
	},
}

So the getting of new items would be as simple as:

walker := walkerPoolA.Get().(*walker.Walker)

This might give you ideas how to simplify the managment around pools.

},
DisableResolveFieldPositions: true,
}, WithDefaultPostProcessor()))
}, WithDefaultPostProcessor(), WithSkipReason("fix me")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you plan to fix it in this PR?

}
}

type FieldsLimitedVisitor struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find where it is being used...

import (
"context"
"errors"
"unique"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot understand why you have used unique here. Could you point why interning for strings was required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants