zoukankan      html  css  js  c++  java
  • Postgresql fillfactor

    一个表的填充因子(fillfactor)是一个介于 10 和 100 之间的百分数。100(完全填充)是默认值。如果指定了较小的填充因子,INSERT 操作仅按照填充因子指定的百分率填充表页。每个页上的剩余空间将用于在该页上更新行,这就使得 UPDATE 有机会在同一页上放置同一条记录的新版本,这比把新版本放置在其它页上更有效。对于一个从不更新的表将填充因子设为 100 是最佳选择,但是对于频繁更新的表,较小的填充因子则更加有效。

    PostgresSQL 使用Heap-Only Tuple 技术 会在旧行与新行之间建立一个链表,这样一来就不需要更新索引了,索引项仍会指向旧行,通过链表可以找到新行。因此Heap-Only Tuple 的链表不能跨数据块。

    create table t_fillfactor01(id int ,name varchar  , blog text ) WITH (fillfactor=70);
    CREATE TABLE
    new_test=# d+ t_fillfactor01
                             Table "public.t_fillfactor01"
     Column |       Type        | Modifiers | Storage  | Stats target | Description 
    --------+-------------------+-----------+----------+--------------+-------------
     id     | integer           |           | plain    |              | 
     name   | character varying |           | extended |              | 
     blog   | text              |           | extended |              | 
    Options: fillfactor=70
  • 相关阅读:
    无限维
    黎曼流形
    why we need virtual key word
    TOJ 4119 Split Equally
    TOJ 4003 Next Permutation
    TOJ 4002 Palindrome Generator
    TOJ 2749 Absent Substrings
    TOJ 2641 Gene
    TOJ 2861 Octal Fractions
    TOJ 4394 Rebuild Road
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/7550989.html
Copyright © 2011-2022 走看看