Avoid full ORM hydration in POST /semantic/views/list - #2432
Draft
shangyian wants to merge 2 commits into
Draft
Conversation
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
/semantic/views/list
/semantic/views/list/semantic/views/list
/semantic/views/list/semantic/views/list
POST /semantic/views/list hydrated a full Node ORM entity for every cube in the instance just to read .name, and Node.created_by/Node.tags are lazy="selectin" at the mapper level, so each batch of cubes fanned out into extra batched queries for users and tags the response never used. Switch to Node.find_names, which selects only the name column and leaves the session identity map untouched.
shangyian
force-pushed
the
perf/views-list-hydration
branch
from
August 21, 2026 10:44
7f50329 to
0374993
Compare
/semantic/views/listPOST /semantic/views/list
/semantic/views/list was its last caller. Listing by prefix and type without hydrating entities is Node.find_names, and the entity-returning search with filters and load options is Node.find_by, so nothing here is lost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /semantic/views/listhydrated a full Node ORM entity for every cube in the instance just to read the cube's name, which is expensive. SinceNode.created_byand Node.tags areselectinat the mapper level, each batch of cubes fanned out into extra batched queries for users and tags that the response never used.This PR switches it to
Node.find_names, which selects only the name column.Test Plan
make checkpassesmake testshows 100% unit test coverageDeployment Plan