PostgreSQL的insert解析

编程入门 行业动态 更新时间:2024-10-11 19:23:20

<a href=https://www.elefans.com/category/jswz/34/1770967.html style=PostgreSQL的insert解析"/>

PostgreSQL的insert解析

其insert由函数heapam_tuple_insert完成。

1、首先需要从slot中取出tuple值,HeapTupleTableSlot.tuple

2、从relation中得到该记录即将插入表的OID:relation->rd_id,然后slot->tts_tableOid和tuple->t_tableOid更新为该OID

3、调用heap_insert将tuple插入heap 页中,这个过程中产生WAL日志并写入WAL BUFFER中:

  1)生成事务ID:xid

  2)调用函数heap_prepare_insert:设置tup->t_data的t_infomask和t_infomask2;tup->t_data->t_choice.t_heap.t_xmin为xid;

(tup->t_data)->t_choice.t_heap.t_field3.t_cid

更多推荐

PostgreSQL的insert解析

本文发布于:2024-03-08 11:03:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1720691.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PostgreSQL   insert

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!