René's URL Explorer Experiment


Title: feat: Batch Postgres online reads across feature views by DKilkenny · Pull Request #6832 · feast-dev/feast · GitHub

Open Graph Title: feat: Batch Postgres online reads across feature views by DKilkenny · Pull Request #6832 · feast-dev/feast

X Title: feat: Batch Postgres online reads across feature views by DKilkenny · Pull Request #6832 · feast-dev/feast

Description: What this PR does / why we need it: The generic OnlineStore._read_features_per_fv loop issues one online_read per feature view, so a request spanning N feature views costs N round trips. Redis already overrides that seam to batch; Postgres now does too, which is the follow-up described in #3259. Postgres keeps each feature view in its own table, so the per-view reads can go out as one UNION ALL. Each branch carries a constant tag column and the combined result is split back apart by it. The tag is doing real work here: the table name is not in the result set, and two feature views can return both the same entity key and the same feature name. Both the sync and async seams are overridden. When this helps, and when it does not. Batching trades round trips for holding more rows at once, so it only pays where round trips dominate. Measured against Postgres 16 with a 2 ms delay injected per execute to stand in for a remote database: shape batched generic speedup 10 views, 1 entity 6.1 ms, 1 query 34.3 ms, 10 queries 5.6x 10 views, 10 entities 13.4 ms, 1 query 41.1 ms, 10 queries 3.1x 25 views, 10 entities 27.6 ms, 1 query 108.7 ms, 25 queries 3.9x 10 views, 5000 entities 4417 ms 4357 ms 0.99x At 5000 entities there is no saving left, and holding every view's rows before emitting any of them took peak memory to 85 MB against a flat 9.6 MB for the generic path. That is the wrong trade for a concurrent feature server, so requests above MAX_BATCHED_READ_KEYS entity keys fall through to the generic path, which processes and releases one view at a time. Memory at that size is now identical to before. The check reads the request shape before any keys are serialized, so declining to batch costs nothing. That 2048 threshold is my number from the measurements above, taken on a laptop against a container. Happy to move it, make it configurable, or drop it entirely if you would rather this always batch. Two things worth flagging. Postgres does not advertise async_supported, so _read_features_per_fv_async is not reachable from the feature server today; it is implemented and verified against a real database so that it behaves whenever that changes. And the docs diff is slightly wider than the feature, because four lines described Redis and Postgres as overriding get_online_features when both override _read_features_per_fv. Three of those were already there, and correcting them seemed better than adding a fifth alongside. No changes to online_store.py, so the base class contract is untouched. Which issue(s) this PR fixes: Refs #3259 Checks I've made sure the tests are passing. My commits are signed off (git commit -s) My PR title follows conventional commits format Testing Strategy Unit tests Integration tests Manual tests Testing is not required for this change 10 unit tests and 6 integration tests. The integration tests run the same request through the batched path and through OnlineStore._read_features_per_fv and assert the protobuf responses are identical, including the case where an entity exists in one view but not another. I mutation tested these rather than trusting a green run. Ignoring the tag, executing the query twice, cross wiring one view's entity index mapping onto another, and disabling the size guard each fail exactly the tests meant to catch them. Two of those slipped past an earlier version of the tests, which is why the demux tests give both feature views the same feature name: with different names a crossed bucket still resolves the right value and the test proves nothing. The tests/unit/infra suite is unchanged at 41 failed / 279 passed before and 41 failed / 289 passed after, same pre-existing failures plus the new tests. Those failures and the 27 collection errors are missing optional extras in my environment, not related to this change. ruff and mypy are clean. The numbers in the table above come from a manual benchmark against a Postgres 16 testcontainer, counting executes and tracemalloc peak across view and entity counts with and without an injected per-execute delay. It is a throwaway script rather than part of the suite; happy to clean it up into sdk/python/tests/benchmarks/ if that is useful to keep. One caveat on coverage: I ran all of this on Python 3.11. There is no py3.13 requirements file and the pinned pytest-timeout does not import on 3.12 or later, so 3.10 and 3.12 are unverified on my side and CI will be the first run against them. Misc Release note: PostgreSQL online store now reads all feature views in a single query, reducing round trips for requests that span multiple feature views.

Open Graph Description: What this PR does / why we need it: The generic OnlineStore._read_features_per_fv loop issues one online_read per feature view, so a request spanning N feature views costs N round trips. Redis alre...

X Description: What this PR does / why we need it: The generic OnlineStore._read_features_per_fv loop issues one online_read per feature view, so a request spanning N feature views costs N round trips. Redis alre...

Opengraph URL: https://github.com/feast-dev/feast/pull/6832

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:223914a5-f630-0f18-3265-0d350668f819
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB48C:172ED:2AD559:3BAB00:6AFE9837
html-safe-noncee21a5dea07ba4d559ed095d9233d967440309d42507404c93d766e836b2432d3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDhDOjE3MkVEOjJBRDU1OTozQkFCMDA6NkFGRTk4MzciLCJ2aXNpdG9yX2lkIjoiNTg4OTE2MTgwNDA0NjU3MTU3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac22abdd07ef624f0f77734eddfb2efea098fac35e303a89a7b4f24818f637145e
hovercard-subject-tagpull_request:4511487173
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/6832/files
twitter:imagehttps://avatars.githubusercontent.com/u/20937088?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/20937088?s=400&v=4
og:image:altWhat this PR does / why we need it: The generic OnlineStore._read_features_per_fv loop issues one online_read per feature view, so a request spanning N feature views costs N round trips. Redis alre...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/feast-dev/feast git https://github.com/feast-dev/feast.git
octolytics-dimension-user_id57027613
octolytics-dimension-user_loginfeast-dev
octolytics-dimension-repository_id161133770
octolytics-dimension-repository_nwofeast-dev/feast
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id161133770
octolytics-dimension-repository_network_root_nwofeast-dev/feast
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a10310af51a1bfffbedc4fd81cb582acf0cb0ff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/feast-dev/feast/pull/6832/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fpull%2F6832%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fpull%2F6832%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=feast-dev%2Ffeast
Reloadhttps://github.com/feast-dev/feast/pull/6832/files
Reloadhttps://github.com/feast-dev/feast/pull/6832/files
Reloadhttps://github.com/feast-dev/feast/pull/6832/files
feast-devhttps://github.com/feast-dev
feasthttps://github.com/feast-dev/feast
Codehttps://github.com/feast-dev/feast
Issues223 (223)https://github.com/feast-dev/feast/issues
Pull requests143 (143)https://github.com/feast-dev/feast/pulls
Discussionshttps://github.com/feast-dev/feast/discussions
Actionshttps://github.com/feast-dev/feast/actions
Security and quality1 (1)https://github.com/feast-dev/feast/security
Insightshttps://github.com/feast-dev/feast/insights
Sign up for GitHub https://github.com/signup?return_to=%2Ffeast-dev%2Ffeast%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ffeast-dev%2Ffeast%2Fissues%2Fnew%2Fchoose
ntkatholehttps://github.com/ntkathole
feast-dev:masterhttps://github.com/feast-dev/feast/tree/master
DKilkenny:feat/postgres-batched-online-readhttps://github.com/DKilkenny/feast/tree/feat/postgres-batched-online-read
Conversation 7 https://github.com/feast-dev/feast/pull/6832
Commits 5 https://github.com/feast-dev/feast/pull/6832/commits
Checks 23 https://github.com/feast-dev/feast/pull/6832/checks
Files changed https://github.com/feast-dev/feast/pull/6832/files
Please reload this pagehttps://github.com/feast-dev/feast/pull/6832/files
feat: Batch Postgres online reads across feature views https://github.com/feast-dev/feast/pull/6832/files#top
Show all changes 5 commits https://github.com/feast-dev/feast/pull/6832/files
a0d985d feat: Batch Postgres online reads across feature views DKilkenny Sep 11, 2026 https://github.com/feast-dev/feast/pull/6832/commits/a0d985dd9daa48354b6b3128c37482cee9bc1194
c07e1c2 ci: Allowlist fake Postgres password in batched read test DKilkenny Sep 16, 2026 https://github.com/feast-dev/feast/pull/6832/commits/c07e1c2aa056e3885601d4aae4210c1a96d611af
07a8708 test: Consolidate batched read tests across sync and async paths DKilkenny Sep 16, 2026 https://github.com/feast-dev/feast/pull/6832/commits/07a87085f0c52abb3242e4a8136472afe6a95b89
4b3a41b test: Consolidate Postgres batched read integration tests DKilkenny Sep 30, 2026 https://github.com/feast-dev/feast/pull/6832/commits/4b3a41ba06da4a096b08bd3d4132d761a3c62497
ff60681 feat: Make the Postgres batched read limit configurable DKilkenny Sep 30, 2026 https://github.com/feast-dev/feast/pull/6832/commits/ff6068123b8fb7c73a599a36ed2a2d67306501a7
Clear filters https://github.com/feast-dev/feast/pull/6832/files
Please reload this pagehttps://github.com/feast-dev/feast/pull/6832/files
Please reload this pagehttps://github.com/feast-dev/feast/pull/6832/files
online-server-performance-tuning.md https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
postgres.md https://github.com/feast-dev/feast/pull/6832/files#diff-223fab4322711183ade8b0c3618cd80faaff111aad0baea8fe92a39fdecf90c2
postgres.py https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
test_postgres_batched_read.py https://github.com/feast-dev/feast/pull/6832/files#diff-de81d2c97d90a4a1535f786bf452a769e74773186118a68a2a9e9cb70475e202
test_postgres_batched_read.py https://github.com/feast-dev/feast/pull/6832/files#diff-ec8350c71ab3dbcaf464471f95b46e11547d340df68b758bc7f91a10df4bb3cf
https://github.com/feast-dev/feast/blob/master/CODEOWNERS#L4
docs/how-to-guides/online-server-performance-tuning.mdhttps://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
View file https://github.com/DKilkenny/feast/blob/ff6068123b8fb7c73a599a36ed2a2d67306501a7/docs/how-to-guides/online-server-performance-tuning.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/feast-dev/feast/pull/6832/{{ revealButtonHref }}
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/pull/6832/files#diff-82d8b79f95d6cae2c7dd44eecce63c06a146e04bd44b88dda34ee5ada8914b63
https://github.com/feast-dev/feast/blob/master/CODEOWNERS#L4
docs/reference/online-stores/postgres.mdhttps://github.com/feast-dev/feast/pull/6832/files#diff-223fab4322711183ade8b0c3618cd80faaff111aad0baea8fe92a39fdecf90c2
View file https://github.com/DKilkenny/feast/blob/ff6068123b8fb7c73a599a36ed2a2d67306501a7/docs/reference/online-stores/postgres.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/feast-dev/feast/pull/6832/{{ revealButtonHref }}
https://github.com/feast-dev/feast/pull/6832/files#diff-223fab4322711183ade8b0c3618cd80faaff111aad0baea8fe92a39fdecf90c2
https://github.com/feast-dev/feast/pull/6832/files#diff-223fab4322711183ade8b0c3618cd80faaff111aad0baea8fe92a39fdecf90c2
https://github.com/feast-dev/feast/blob/master/CODEOWNERS#L10
sdk/python/feast/infra/online_stores/postgres_online_store/postgres.pyhttps://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
View file https://github.com/DKilkenny/feast/blob/ff6068123b8fb7c73a599a36ed2a2d67306501a7/sdk/python/feast/infra/online_stores/postgres_online_store/postgres.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/feast-dev/feast/pull/6832/{{ revealButtonHref }}
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
https://github.com/feast-dev/feast/pull/6832/files#diff-47ca5062c9deda124e65cb5f558c1c4aceffbcfaf88d499fd79b11a51f56c921
Please reload this pagehttps://github.com/feast-dev/feast/pull/6832/files
Please reload this pagehttps://github.com/feast-dev/feast/pull/6832/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.