Skip to content

Avoid full ORM hydration in POST /semantic/views/list - #2432

Draft
shangyian wants to merge 2 commits into
mainfrom
perf/views-list-hydration
Draft

Avoid full ORM hydration in POST /semantic/views/list#2432
shangyian wants to merge 2 commits into
mainfrom
perf/views-list-hydration

Conversation

@shangyian

@shangyian shangyian commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

POST /semantic/views/list hydrated a full Node ORM entity for every cube in the instance just to read the cube's name, which is expensive. Since Node.created_by and Node.tags are selectin at 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

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 1b97544
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a883556ef2be30008d20b41

@shangyian shangyian changed the title perf(semantic-layer): avoid full ORM hydration in /views/list perf: avoid full ORM hydration in /semantic/views/list Aug 21, 2026
@shangyian shangyian changed the title perf: avoid full ORM hydration in /semantic/views/list Avoid full ORM hydration in /semantic/views/list Aug 21, 2026
@shangyian shangyian changed the title Avoid full ORM hydration in /semantic/views/list [perf] Avoid full ORM hydration in /semantic/views/list Aug 21, 2026
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
shangyian force-pushed the perf/views-list-hydration branch from 7f50329 to 0374993 Compare August 21, 2026 10:44
@shangyian shangyian changed the title [perf] Avoid full ORM hydration in /semantic/views/list Avoid full ORM hydration in POST /semantic/views/list Aug 21, 2026
/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant