{"id":123245,"date":"2025-04-02T21:05:07","date_gmt":"2025-04-02T19:05:09","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql"},"modified":"2025-04-02T21:05:07","modified_gmt":"2025-04-02T19:05:09","slug":"razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql","title":{"rendered":"The developers of OrioleDB proposed improvements to the API for alternative PostgreSQL engines.","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>The developers of OrioleDB analyzed the current state of the low-level API used for extensions to access tables and indexes in PostgreSQL (Table\/Index Access Method (AM) API) and proposed ways to improve it. Since the introduction of such an API in PostgreSQL 12, developers have had the ability to create alternative data storage mechanisms. However, despite the existence of this API and the known limitations of the built-in storage mechanism, fully functional transactional storage engines implemented solely as extensions have yet to emerge.    <\/p>\n<p>The most sought-after features for alternative table engines in PostgreSQL are:  <\/p>\n<ul>\n<li class=\"l\"> Alternative MVCC implementations, such as UNDO log-based storage.\n<li class=\"l\"> Index-organized tables, where the index is not an optional supplement to the table that speeds up queries but serves as the primary data structure where table data is stored.    <\/ul>\n<p>The changes necessary in the Table\/Index AM API to support alternative MVCC implementations are examined with respect to the OrioleDB extension developed to eliminate the known shortcomings of PostgreSQL's built-in storage mechanism. The problem is that full integration of OrioleDB with PostgreSQL requires modifications to PostgreSQL's code, complicating project implementation and highlighting the need to modernize the current Table AM API.    <\/p>\n<p>The Table AM API does not directly impose a method for implementing MVCC. However, the Table AM and Index AM APIs make the following assumption: every TID (Tuple\/row Identifier) is either indexed by all indices or not indexed at all. Even if the Index AM has multiple references to one TID (for example, GIN), all these references must correspond to the same indexed value.    <center><img decoding=\"async\" alt=\"The developers of OrioleDB proposed improvements to the API for alternative PostgreSQL engines.\" src=\"\/wp-content\/uploads\/2025\/04\/a2082618f49d887e6987a73c65091c59.png\" style=\"display:block;margin: 0 auto;\" \/><\/center>      <\/p>\n<p>This principle has been criticized for increasing the number of write operations (\"write amplification\") \u2014 if one indexed attribute is updated, every index in the table must be updated. To fully leverage the benefits of the UNDO log or to build another storage method without \"write amplification\" (for example, the WARM method), this assumption needs to be violated.  <center><img decoding=\"async\" alt=\"The developers of OrioleDB proposed improvements to the API for alternative PostgreSQL engines.\" src=\"\/wp-content\/uploads\/2025\/04\/da5adbec63e0b4c139733c5775b317b9.png\" style=\"display:block;margin: 0 auto;\" \/><\/center>        <\/p>\n<p>The Table AM based on UNDO, which will not violate this assumption, resembles the existing HOT (Heap-Only Tuples) method, except that older versions of rows are stored in the UNDO log and do not need to fit on the same page. However, the authors believe this advantage is not sufficient to justify the existence of a separate Table AM.    <\/p>\n<p>Practical limitations of the existing API:    <\/p>\n<ul>\n<li class=\"l\"> During the update of a table row, the indexes are updated on an \"all or nothing\" basis.\n<li class=\"l\"> The API Index AM currently lacks the capability for point deletion of specific tuples. Currently, tuples can be deleted from indexes in bulk using the ambulkdelete and amvacuumcleanup methods. Attempting to implement point deletion via this API would lead to low efficiency, as most current implementations need to scan the entire index. Additionally, the API does not allow specifying which of the tuples referencing the same TID should be deleted. It can only remove all of them.\n<li class=\"l\"> Indexes currently reference table rows by block number (32 bits) and offset number (16 bits). Only 11 bits of the offset number can be safely passed from the table TID to all indexing access methods. Meanwhile, alternative MVCC implementations might need to store additional payload along with the TID. For instance, OrioleDB requires one or more bits to implement \"delete-marking\" indexes or full visibility information.      <\/ul>\n<p>Two approaches have been proposed to overcome the limitations in practice:  <\/p>\n<ul>\n<p>Approach 1: The API Index AM provides capabilities for alternative MVCC implementation.    <\/p>\n<p>While the Table AM continues to be responsible for all components of MVCC, the Index AM provides the necessary capabilities for alternative MVCC implementations, namely: storing user-defined payload along with TID, a point deletion method, and even a point update method (if the TID in the index cannot be changed, the user-defined payload can). Additionally, since multiple index tuples need to refer to the same TID, the API methods applied during index scanning also need to be updated.    <\/p>\n<p>Approach 2: Indexes supporting MVCC.    <\/p>\n<p>An alternative would be to allow indexes to support MVCC. That is, the \"executor\" (or possibly the Table AM) simply calls the insert() and delete() methods in the Index AM, while the Index AM provides the capability for MVCC-compliant scanning. This would significantly simplify scanning using only indexes (index-only). Even the entire Table AM could, in this case, become an intermediate layer that stores data in the index.    <\/p>\n<p>The diagram below shows an example. The index value 2 is updated by transaction 11 from the value &#171;A&#187; to the value &#171;B&#187;. Therefore, the value &#171;A&#187; is marked as xmax == 11, while the value &#171;B&#187; is marked as xmin == 11. Thus, index 2 can be scanned to retrieve only the visible tuples according to MVCC without heap checks. Garbage collection of index 2 can also be performed without using the heap.    <center><img decoding=\"async\" alt=\"The developers of OrioleDB proposed improvements to the API for alternative PostgreSQL engines.\" src=\"\/wp-content\/uploads\/2025\/04\/9103127cc51f83c824c6cdc22135b470.png\" style=\"display:block;margin: 0 auto;\" \/><\/center>  <\/p>\n<p>When implementing all the aforementioned innovations in the API of index access methods, it is unlikely that it would be possible to simultaneously revise all indexes to support all new features. It is more realistic to allow several implementations for one index access method. For instance, in addition to the standard B-tree, an extension could implement an alternative B-tree with MVCC support within the index and support for variable-length record identifiers.    <center><img decoding=\"async\" alt=\"The developers of OrioleDB proposed improvements to the API for alternative PostgreSQL engines.\" src=\"\/wp-content\/uploads\/2025\/04\/57e1c15ecdd08f7b8095f464b59523b9.png\" style=\"display:block;margin: 0 auto;\" \/><\/center>    <\/p>\n<p>Thus, it is proposed to reconsider not only the API of Table AM but also the API of Index AM, which has faithfully served the PostgreSQL community for many years. Moreover, it is proposed to split Index AM into a logical layer and an implementation layer. This reimagined architecture would enable PostgreSQL to support various storage models.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=62991\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e API, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0432 PostgreSQL (Table\/Index Access Method (AM) API), \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0443\u0442\u0438 \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f. \u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 PostgreSQL 12 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e API \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0433\u043e API \u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":123246,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-123245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e API, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0432 PostgreSQL (Table\/Index Access Method (AM) API), \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0443\u0442\u0438 \u0435\u0433\u043e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c API \u0434\u043b\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u043e\u0432 PostgreSQL | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e API, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0432 PostgreSQL (Table\/Index Access Method (AM) API), \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0443\u0442\u0438 \u0435\u0433\u043e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-04-02T19:05:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-04-02T19:05:09+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47OrioleDB developers suggested enhancing the API for alternative PostgreSQL engines | ProHoster","description":"OrioleDB developers analyzed the current state of the low-level API used for extensions to access tables and indexes in PostgreSQL (Table\/Index Access Method (AM) API) and proposed ways to improve it.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c API \u0434\u043b\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u043e\u0432 PostgreSQL | ProHoster","og:description":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OrioleDB \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e API, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0432 PostgreSQL (Table\/Index Access Method (AM) API), \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0443\u0442\u0438 \u0435\u0433\u043e.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/razrabotchiki-orioledb-predlozhili-uluchshit-api-dlya-alternativnyh-dvizhkov-postgresql","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2025-04-02T19:05:09+00:00","article:modified_time":"2025-04-02T19:05:09+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"123245","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-23 11:48:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2026-01-23 11:48:19","updated":"2026-01-23 11:48:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/123245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=123245"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/123245\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/123246"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=123245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=123245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=123245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}