Note PostgreSQL OID synchronization

Source: Internet
Author: User
Tags postgresql



Previously studied PostgreSQL's notes






CREATE TABLE consumption OID


  • < Span style= "Font-family:microsoft Yahei;" > create table My_ test_table, He's going to consume a
  • < Span style= "Font-family:microsoft Yahei;" > pg_type insert two records _my_ test_table my_test_table oid
  • If the table requires Toast will generate a change in the Toast Tables and Toast Index The table consumes another two, and the viewing process is as follows:
  • CREATE TABLE my_test_table (a int, b char (8192));
  • Select OID, relname from Pg_class where relname= ' my_test_table ';
  • --oid = 16384
  • Select OID, relname from Pg_class where relname like '%16384% ';
  • Select Typname, oid from Pg_type where typname like '%my_test_table ';


OID Synchronization Process



oid synchronization reason: Span style= "color: #ff0000;" When you create objects such as tables, views, functions, and so on, objects need to be assigned a new oid oid all



Bureau only , so to get one of the largest OIDson all coordinator and datanode . Take CREATE table For example,



The specific process is as follows:



1 ) First and all dn and other than their own co establish the connection.



2 oid request, receive the requested node, put the largest oid sent to coordinator



3 ) Span lang= "en-US" > oid oid setnextassignobjectid



co node next to be assigned oid



4 ) then execute create statement, struct createstmt members tableoidinfo used to store the largest

that gets.



OID , the current Coordiator The query plan is distributed to other nodes, and the other nodes get the maximum OID Call function after



Heap_create_with_catalog , create a table on your own node



OID system tables involved in synchronization



Pg_class



Pg_namespace--create Schema



Pg_constraint



Pg_operator



Pg_ts_parser



Pg_ts_dict



Pg_ts_template



Pg_ts_config



Pg_collation



Pg_am



Pg_extension



Pg_foreign_data_wrapper



Pg_foreign_server



Pg_user_mapping



Pg_type



Pg_enum



Pg_proc



Pg_rewrite



Pg_trigger



Pg_language



Pg_conversion



Pg_cast



Pg_opfamily



Pg_opclass



Pg_tablespace



OID Synchronous Removal



There may be a problem with the current implementation when there are nodes or all nodes OID wrapping up, creating objects is very likely to fail. OID sync Removal Reference



PG-XL , send the object name in the query plan, and then go to the local OID .






Note PostgreSQL OID synchronization


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.