René's URL Explorer Experiment


Title: Discussion: Pushing batches of data to online store: Should `conn.commit()` happen in the for loop or after? · Issue #4036 · feast-dev/feast · GitHub

Open Graph Title: Discussion: Pushing batches of data to online store: Should `conn.commit()` happen in the for loop or after? · Issue #4036 · feast-dev/feast

X Title: Discussion: Pushing batches of data to online store: Should `conn.commit()` happen in the for loop or after? · Issue #4036 · feast-dev/feast

Description: This piece of code in the online_write_batch function in the Postgres online store pushes data in batches to the online store. I was wondering whether it makes more sense to put the conn.commit() inside the for loop, or after the for loo...

Open Graph Description: This piece of code in the online_write_batch function in the Postgres online store pushes data in batches to the online store. I was wondering whether it makes more sense to put the conn.commit() i...

X Description: This piece of code in the online_write_batch function in the Postgres online store pushes data in batches to the online store. I was wondering whether it makes more sense to put the conn.commit() i...

Opengraph URL: https://github.com/feast-dev/feast/issues/4036

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Discussion: Pushing batches of data to online store: Should `conn.commit()` happen in the for loop or after?","articleBody":"[This](https://github.com/feast-dev/feast/blob/master/sdk/python/feast/infra/online_stores/contrib/postgres.py#L80-L101) piece of code in the `online_write_batch` function in the Postgres online store pushes data in batches to the online store. \r\n\r\nI was wondering whether it makes more sense to put the `conn.commit()` inside the for loop, or after the for loop. I would love to hear the different trade-offs between the two options! \r\n\r\nCopy of the code snippet here: \r\n\r\n```python\r\nbatch_size = 5000\r\nfor i in range(0, len(insert_values), batch_size):\r\n    cur_batch = insert_values[i : i + batch_size]\r\n    execute_values(\r\n        cur,\r\n        sql.SQL(\r\n            \"\"\"\r\n            INSERT INTO {}\r\n            (entity_key, feature_name, value, event_ts, created_ts)\r\n            VALUES %s\r\n            ON CONFLICT (entity_key, feature_name) DO\r\n            UPDATE SET\r\n                value = EXCLUDED.value,\r\n                event_ts = EXCLUDED.event_ts,\r\n                created_ts = EXCLUDED.created_ts;\r\n            \"\"\",\r\n        ).format(sql.Identifier(_table_id(project, table))),\r\n        cur_batch,\r\n        page_size=batch_size,\r\n    )\r\n    conn.commit() # \u003c\u003c This is the point of interest. Should this be placed in the loop or after?  \r\n```","author":{"url":"https://github.com/job-almekinders","@type":"Person","name":"job-almekinders"},"datePublished":"2024-03-23T10:55:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/4036/feast/issues/4036"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f3e5422e-c12b-4f13-063f-3572d963c169
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9662:2A680A:94B3EE:D05C8C:696FB25D
html-safe-nonce50c1135686d803eb845a931267814c7fb6a32373ebdd7257e4491760f5e75c46
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjYyOjJBNjgwQTo5NEIzRUU6RDA1QzhDOjY5NkZCMjVEIiwidmlzaXRvcl9pZCI6IjY3MjMzNDIxMzMzNDQ4NDIzMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd71be77b6aac49d747609566d7d2362edc022502c4bda8bd7871b2adb7d54136
hovercard-subject-tagissue:2203822584
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/4036/issue_layout
twitter:imagehttps://opengraph.githubassets.com/84612062ccb916f270f3217b1317ff961d7f75c3c238d032c204e0f3db6ca087/feast-dev/feast/issues/4036
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/84612062ccb916f270f3217b1317ff961d7f75c3c238d032c204e0f3db6ca087/feast-dev/feast/issues/4036
og:image:altThis piece of code in the online_write_batch function in the Postgres online store pushes data in batches to the online store. I was wondering whether it makes more sense to put the conn.commit() i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejob-almekinders
hostnamegithub.com
expected-hostnamegithub.com
Noned146dfd2c89f9048de9fd6d73ec4ffcf201cc2c89880fcf1c73ff73970d46e64
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1866f0fdabd6ce28d22bf272fe23b56a9d475be6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/feast-dev/feast/issues/4036#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F4036
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F4036
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=feast-dev%2Ffeast
Reloadhttps://github.com/feast-dev/feast/issues/4036
Reloadhttps://github.com/feast-dev/feast/issues/4036
Reloadhttps://github.com/feast-dev/feast/issues/4036
feast-dev https://github.com/feast-dev
feasthttps://github.com/feast-dev/feast
Notifications https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Fork 1.2k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Star 6.6k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Code https://github.com/feast-dev/feast
Issues 176 https://github.com/feast-dev/feast/issues
Pull requests 58 https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/feast-dev/feast/security
Please reload this pagehttps://github.com/feast-dev/feast/issues/4036
Insights https://github.com/feast-dev/feast/pulse
Code https://github.com/feast-dev/feast
Issues https://github.com/feast-dev/feast/issues
Pull requests https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security https://github.com/feast-dev/feast/security
Insights https://github.com/feast-dev/feast/pulse
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/4036
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/4036
#4303https://github.com/feast-dev/feast/pull/4303
Discussion: Pushing batches of data to online store: Should conn.commit() happen in the for loop or after?https://github.com/feast-dev/feast/issues/4036#top
#4303https://github.com/feast-dev/feast/pull/4303
kind/questionFurther information is requestedhttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fquestion%22
https://github.com/job-almekinders
https://github.com/job-almekinders
job-almekindershttps://github.com/job-almekinders
on Mar 23, 2024https://github.com/feast-dev/feast/issues/4036#issue-2203822584
Thishttps://github.com/feast-dev/feast/blob/master/sdk/python/feast/infra/online_stores/contrib/postgres.py#L80-L101
kind/questionFurther information is requestedhttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fquestion%22
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.