Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97cdf3a

Browse files
committed
Applied patch to cfs.sgml
1 parentd6b7d14 commit97cdf3a

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

‎doc/src/sgml/cfs.sgml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
<para>
1515
Databases are used to store larger number of text and duplicated information. This is why compression of most of databases
16-
can be quite efficient and reduce used storage size 3..5 times.Postgres performs compression of TOAST data, but small
16+
can be quite efficient and reduce used storage size 3..5 times.PostgreSQL performs compression of TOAST data, but small
1717
text fields which fits in the page are not compressed. Also not only heap pages can be compressed, indexes on text keys
1818
or indexes with larger number of duplicate values are also good candidates for compression.
1919
</para>
2020

2121
<para>
22-
Postgres is working with disk data through buffer pool which accumulates most frequently used buffers.
22+
PostgreSQL is working with disk data through buffer pool which accumulates most frequently used buffers.
2323
Interface between buffer manager and file system is the most natural place for performing compression.
24-
Buffers are stored on the disk in compressed for reducing disk usage and minimizing amount of data to be read.
24+
Buffers are stored on the disk in compressedformfor reducing disk usage and minimizing amount of data to be read.
2525
And in-memory buffer pool contains uncompressed buffers, providing access to the records at the same speed as without
2626
compression. As far as modern server have large enough size of RAM, substantial part of the database can be cached in
2727
memory and accessed without any compression overhead penalty.
@@ -37,9 +37,9 @@
3737
<term>Reducing amount of disk IO</term>
3838
<listitem>
3939
<para>
40-
Compressionhelp to reduce size of data which should be written to the disk or read from it.
40+
Compressionhelps to reduce size of data which should be written to the disk or read from it.
4141
Compression ratio 3 actually means that you need to read 3 times less data or same number of records can be fetched
42-
3 times faster
42+
3 times faster.
4343
</para>
4444
</listitem>
4545
</varlistentry>
@@ -48,8 +48,8 @@
4848
<term>Improving locality</term>
4949
<listitem>
5050
<para>
51-
When modified buffers are flushed from buffer pool to the disk,them are now written to the random locations
52-
on the disk.Postgres cache replacement algorithm makes a decision about throwing away buffer from the pool
51+
When modified buffers are flushed from buffer pool to the disk,they are written to the random locations
52+
on the disk.PostgreSQL cache replacement algorithm makes a decision about throwing away buffer from the pool
5353
based on its access frequency and ignoring its location on the disk. So two subsequently written buffers can be
5454
located in completely different parts of the disk. For HDD seek time is quite large - about 10msec, which corresponds
5555
to 100 random writes per second. And speed of sequential write can be about 100Mb/sec, which corresponds to
@@ -58,10 +58,10 @@
5858
Size of buffer in PostgreSQL is fixed (8kb by default). Size of compressed buffer depends on the content of the buffer.
5959
So updated buffer can not always fit in its old location on the disk. This is why we can not access pages directly
6060
by its address. Instead of it we have to use map which translates logical address of the page to its physical location
61-
on the disk. Definitely this extra level of indirection adds overhead.For in most cases this map canfir in memory,
61+
on the disk. Definitely this extra level of indirection adds overhead.But in most cases this map canfit in memory,
6262
so page lookup is nothing more than just accessing array element. But presence of this map also have positive effect:
6363
we can now write updated pages sequentially, just updating their map entries.
64-
Postgres is doing much to avoid "write storm" intensive flushing of data to the disk when bufferpoll space is
64+
PostgreSQL is doing much to avoid "write storm" intensive flushing of data to the disk when bufferpool space is
6565
exhausted. Compression allows to significantly reduce disk load.
6666
</para>
6767
</listitem>
@@ -72,28 +72,29 @@
7272
Another useful feature which can be combined with compression is database encryption.
7373
Encryption allows to protected you database from unintended access (if somebody stole your notebook, hard drive or make
7474
copy from it, thief will not be able to extract information from your database if it is encrypted).
75-
Postgres provide contrib module pgcrypto, allowing you to encrypt some particular types/columns.
75+
PostgreSQL provide contrib module pgcrypto, allowing you to encrypt some particular types/columns.
76+
7677
But safer and convenient way is to encrypt all data in the database. Encryption can be combined with compression.
7778
Data should be stored at disk in encrypted form and decrypted when page is loaded in buffer pool.
7879
It is essential that compression should be performed before encryption, otherwise encryption eliminates regularities in
7980
data and compression rate will be close to 1.
8081
</para>
8182

8283
<para>
83-
Why do we need to perform compression/encryption inPostgres and do not use correspondent features of underlying file
84+
Why do we need to perform compression/encryption inPostgreSQL and do not use correspondent features of underlying file
8485
systems? First answer is that there are not so much file system supporting compression and encryption for all OSes.
8586
And even if such file systems are available, it is not always possible/convenient to install such file system just
8687
to compress/protect your database. Second question is that performing compression at database level can be more efficient,
87-
because here we canhereuse knowledge about size of database page andperforms compression more efficiently.
88+
because here we can use knowledge about size of database page andcan perform compression more efficiently.
8889
</para>
8990

9091
</sect1>
9192

9293
<sect1 id="cfs-implementation">
93-
<title>How compression/encryption are integrated inPostgres</title>
94+
<title>How compression/encryption are integrated inPostgreSQL</title>
9495

9596
<para>
96-
To improve efficiency of disk IO,Postgres is working with files through buffer manager, which pins in memory
97+
To improve efficiency of disk IO,PostgreSQL is working with files through buffer manager, which pins in memory
9798
most frequently used pages. Each page is fixed size (8kb by default). But if we compress page, then
9899
its size will depend on its content. So updated page can require more (or less) space than original page.
99100
So we may not always perform in-place update of the page. Instead of it we have to locate new space for the page and somehow release
@@ -136,7 +137,7 @@
136137
</para>
137138

138139
<para>
139-
Postgres is storingrelation in set of files, size of each file is not exceeding 2Gb. Separate page map is constructed for each file.
140+
PostgreSQL storesrelation in a set of files, size of each file is not exceeding 2Gb. Separate page map is constructed for each file.
140141
Garbage collection in CFS is done by several background workers. Number of this workers and pauses in their work can be
141142
configured by database administrator. This workers are splitting work based on inode hash, so them do not conflict with each other.
142143
Each file is proceeded separately. The files is blocked for access at the time of garbage collection but complete relation is not
@@ -149,9 +150,9 @@
149150
</para>
150151

151152
<para>
152-
CFS can be build with several compression libraries:Postgres lz, zlib, lz4, snappy, lzfse...
153+
CFS can be build with several compression libraries:PostgreSQL lz, zlib, lz4, snappy, lzfse...
153154
But this is build time choice: it is not possible now to dynamically choose compression algorithm.
154-
CFS stores in tablespace information about used compression algorithm and produce error ifPostgres is build with different
155+
CFS stores in tablespace information about used compression algorithm and produce error ifPostgreSQL is build with different
155156
library.
156157
</para>
157158

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp