PostgreSQL 9.6新增的一个patch,暂时还没有提交,这个patch主要是防止数据库中的某些long sql导致LONG snapshot导致数据库膨胀。
原理参考:
http://blog.163.com/digoal@126/blog/static/1638770402015329115636287/下载补丁和数据库源码(使用2015-10-13号master分支源码)
http://www.postgresql.org/message-id/flat/BLU437-SMTP193E7367B788D2EC2B2B81DC160@phx.gbl#BLU437-SMTP193E7367B788D2EC2B2B81DC160@phx.gbl
打补丁
[root@digoal soft_bak]# tar -zxvf postgresql-aa7f949.tar.gz[root@digoal soft_bak]# cd postgresql-aa7f949
[root@digoal postgresql-aa7f949]# patch -p1 < ../snapshot-too-old-v3.diff
patching file doc/src/sgml/config.sgml
patching file src/backend/access/brin/brin.c
patching file src/backend/access/brin/brin_revmap.c
patching file src/backend/access/gin/ginbtree.c
patching file src/backend/access/gin/gindatapage.c
patching file src/backend/access/gin/ginget.c
patching file src/backend/access/gin/gininsert.c
patching file src/backend/access/gist/gistget.c
patching file src/backend/access/hash/hash.c
patching file src/backend/access/hash/hashsearch.c
patching file src/backend/access/heap/heapam.c
patching file src/backend/access/heap/pruneheap.c
patching file src/backend/access/nbtree/nbtinsert.c
patching file src/backend/access/nbtree/nbtpage.c
patching file src/backend/access/nbtree/nbtsearch.c
patching file src/backend/access/spgist/spgscan.c
patching file src/backend/commands/vacuum.c
patching file src/backend/commands/vacuumlazy.c
patching file src/backend/storage/ipc/ipci.c
patching file src/backend/storage/ipc/procarray.c
patching file src/backend/storage/lmgr/lwlocknames.txt
patching file src/backend/utils/errcodes.txt
patching file src/backend/utils/misc/guc.c
patching file src/backend/utils/misc/postgresql.conf.sample
patching file src/backend/utils/time/snapmgr.c
patching file src/include/access/brin_revmap.h
patching file src/include/access/gin_private.h
patching file src/include/access/nbtree.h
patching file src/include/storage/bufmgr.h
patching file src/include/utils/rel.h
patching file src/include/utils/snapmgr.h
patching file src/include/utils/snapshot.h
patching file src/test/modules/Makefile
patching file src/test/modules/sto/.gitignore
patching file src/test/modules/sto/Makefile
patching file src/test/modules/sto/t/001_snapshot_too_old.pl
patching file src/test/modules/sto/t/002_snapshot_too_old_select.pl
patching file src/test/perl/TestLib.pm
安装
# ./configure --prefix=/opt/pgsql9.5devel
# gmake world -j 32
# gmake install-worldsu - pg95
vi .bash_profile
# add by digoal
export PS1="$USER@`/bin/hostname -s`-> "
export PGPORT=1931
export PGDATA=/data01/pg_root_1931
export LANG=en_US.utf8
export PGHOME=/opt/pgsql9.5devel
export LD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH
export DATE=`date +"%Y%m%d%H%M"`
export PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
export PGHOST=$PGDATA
export PGDATABASE=postgres
export PGUSER=postgres
alias rm='rm -i'
alias ll='ls -lh'
unalias vi. ~/.bash_profile
pg95@digoal-> initdb -D $PGDATA -U postgres -W -E UTF8 --locale=C为了快速测试效果,设置1分钟的snapshot,实际应用中用户可以根据实际的需要设置。
vi $PGDATA/postgresql.conf
old_snapshot_threshold = 1min
启动数据库
pg_ctl start
测试:
会话1
postgres=# create table test(id int, crt_time timestamp);
CREATE TABLE
postgres=# insert into test values (1,now()) returning *;id |          crt_time
----+----------------------------1 | 2015-11-09 14:24:26.161537
(1 row)
INSERT 0 1
会话2,开启一个RC隔离级别的事务
postgres=# begin transaction isolation level repeatable read;
BEGIN
postgres=# select *,now(),clock_timestamp() from test;id |          crt_time          |              now              |       clock_timestamp
----+----------------------------+-------------------------------+------------------------------1 | 2015-11-09 14:24:26.161537 | 2015-11-09 14:24:37.289911+08 | 2015-11-09 14:24:47.88468+08
(1 row)
会话1
postgres=# update test set crt_time=now() where id=1 returning *;id |          crt_time
----+----------------------------1 | 2015-11-09 14:25:04.101895
(1 row)
UPDATE 1
会话2
postgres=# select *,now(),clock_timestamp() from test;id |          crt_time          |              now              |        clock_timestamp
----+----------------------------+-------------------------------+-------------------------------1 | 2015-11-09 14:24:26.161537 | 2015-11-09 14:24:37.289911+08 | 2015-11-09 14:25:12.821213+08
(1 row)
......在发生snapshot old错误前,我们看到这个事务占领了一个snapshot id backend_xmin  , 数据库无法回收这之后产生的垃圾。
-[ RECORD 2 ]----+-------------------------------------------------------
datid            | 13241
datname          | postgres
pid              | 16575
usesysid         | 10
usename          | postgres
application_name | psql
client_addr      |
client_hostname  |
client_port      | -1
backend_start    | 2015-11-09 14:19:59.45462+08
xact_start       | 2015-11-09 14:24:37.289911+08
query_start      | 2015-11-09 14:25:12.820912+08
state_change     | 2015-11-09 14:25:12.821263+08
waiting          | f
state            | idle in transaction
backend_xid      |
backend_xmin     | 1769
query            | select *,now(),clock_timestamp() from test;postgres=# vacuum verbose test;
INFO:  vacuuming "public.test"
INFO:  "test": found 0 removable, 2 nonremovable row versions in 1 out of 1 pages
DETAIL:  1 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM当这个会话去访问1分钟前的快照时,报错。
postgres=# select *,now(),clock_timestamp() from test;
ERROR:  snapshot too old这个时候,可以回收之前的垃圾了,
postgres=# vacuum verbose test;
INFO:  vacuuming "public.test"
INFO:  "test": found 1 removable, 1 nonremovable row versions in 1 out of 1 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM
因为这个事务已经释放了backend_xmin     。
-[ RECORD 2 ]----+--------------------------------------------
datid            | 13241
datname          | postgres
pid              | 16575
usesysid         | 10
usename          | postgres
application_name | psql
client_addr      |
client_hostname  |
client_port      | -1
backend_start    | 2015-11-09 14:19:59.45462+08
xact_start       |
query_start      | 2015-11-09 14:26:00.545314+08
state_change     | 2015-11-09 14:26:00.545849+08
waiting          | f
state            | idle in transaction (aborted)
backend_xid      |
backend_xmin     |
query            | select *,now(),clock_timestamp() from test;再次发起请求直接报要求用户回滚事务。
postgres=# select *,now(),clock_timestamp() from test;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
年龄也可以正常的降低:
postgres=# vacuum freeze test;
VACUUM
postgres=# select age(relfrozenxid) from pg_class where relname='test';age
-----0
(1 row)测试游标(貌似snapshot too old对游标不起作用):
会话1
postgres=# insert into test select generate_series(1,100),clock_timestamp();
INSERT 0 100
会话2
postgres=# begin;
BEGIN
postgres=# declare c1 scroll cursor with hold for select * from test order by id;
DECLARE CURSOR
会话1
postgres=# update test set crt_time=now() where id=15;
UPDATE 1
postgres=# select * from test where id=15;id |          crt_time
----+----------------------------15 | 2015-11-09 14:58:19.889967
(1 row)
会话2,已超1分钟。
postgres=# select clock_timestamp();clock_timestamp
-------------------------------2015-11-09 14:59:23.534014+08
(1 row)
无法回收垃圾
postgres=# vacuum verbose test;
INFO:  vacuuming "public.test"
INFO:  "test": found 0 removable, 102 nonremovable row versions in 1 out of 1 pages
DETAIL:  1 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM
fetch前后数据一致。
postgres=# fetch 1 from c1;id |          crt_time
----+----------------------------10 | 2015-11-09 14:40:16.318757
(1 row)postgres=# fetch 1 from c1;id |         crt_time
----+---------------------------11 | 2015-11-09 14:40:16.31876
(1 row)postgres=# fetch 1 from c1;id |          crt_time
----+----------------------------12 | 2015-11-09 14:40:16.318763
(1 row)postgres=# fetch 1 from c1;id |          crt_time
----+----------------------------13 | 2015-11-09 14:40:16.318765
(1 row)postgres=# fetch 1 from c1;id |          crt_time
----+----------------------------14 | 2015-11-09 14:40:16.318767
(1 row)postgres=# fetch 1 from c1;id |          crt_time
----+----------------------------15 | 2015-11-09 14:40:16.319126
(1 row)postgres=# fetch 1 from c1;id |         crt_time
----+---------------------------16 | 2015-11-09 14:40:16.31915
(1 row)postgres=# fetch 100 from c1;id  |          crt_time
-----+----------------------------17 | 2015-11-09 14:40:16.31915318 | 2015-11-09 14:40:16.31915519 | 2015-11-09 14:40:16.31915820 | 2015-11-09 14:40:16.3191621 | 2015-11-09 14:40:16.31916322 | 2015-11-09 14:40:16.31916523 | 2015-11-09 14:40:16.31916824 | 2015-11-09 14:40:16.3191725 | 2015-11-09 14:40:16.31917326 | 2015-11-09 14:40:16.31917527 | 2015-11-09 14:40:16.31917828 | 2015-11-09 14:40:16.3191829 | 2015-11-09 14:40:16.31918330 | 2015-11-09 14:40:16.31918531 | 2015-11-09 14:40:16.31918832 | 2015-11-09 14:40:16.3191933 | 2015-11-09 14:40:16.31919334 | 2015-11-09 14:40:16.31919535 | 2015-11-09 14:40:16.31919836 | 2015-11-09 14:40:16.319237 | 2015-11-09 14:40:16.31920338 | 2015-11-09 14:40:16.31920539 | 2015-11-09 14:40:16.31920840 | 2015-11-09 14:40:16.3192141 | 2015-11-09 14:40:16.31921342 | 2015-11-09 14:40:16.31921543 | 2015-11-09 14:40:16.31921844 | 2015-11-09 14:40:16.3192245 | 2015-11-09 14:40:16.31922246 | 2015-11-09 14:40:16.31922547 | 2015-11-09 14:40:16.31922748 | 2015-11-09 14:40:16.3192349 | 2015-11-09 14:40:16.31923250 | 2015-11-09 14:40:16.31923551 | 2015-11-09 14:40:16.31923752 | 2015-11-09 14:40:16.3192453 | 2015-11-09 14:40:16.31924254 | 2015-11-09 14:40:16.31924555 | 2015-11-09 14:40:16.31924756 | 2015-11-09 14:40:16.3192557 | 2015-11-09 14:40:16.31925258 | 2015-11-09 14:40:16.31925559 | 2015-11-09 14:40:16.31925760 | 2015-11-09 14:40:16.31925961 | 2015-11-09 14:40:16.31926262 | 2015-11-09 14:40:16.31926463 | 2015-11-09 14:40:16.31926764 | 2015-11-09 14:40:16.31926965 | 2015-11-09 14:40:16.31927266 | 2015-11-09 14:40:16.31927467 | 2015-11-09 14:40:16.31927768 | 2015-11-09 14:40:16.31927969 | 2015-11-09 14:40:16.31928270 | 2015-11-09 14:40:16.31928471 | 2015-11-09 14:40:16.31928772 | 2015-11-09 14:40:16.31930373 | 2015-11-09 14:40:16.31930674 | 2015-11-09 14:40:16.31930975 | 2015-11-09 14:40:16.31931176 | 2015-11-09 14:40:16.31931477 | 2015-11-09 14:40:16.31931678 | 2015-11-09 14:40:16.31931979 | 2015-11-09 14:40:16.31932180 | 2015-11-09 14:40:16.31932481 | 2015-11-09 14:40:16.31932682 | 2015-11-09 14:40:16.31932983 | 2015-11-09 14:40:16.31933184 | 2015-11-09 14:40:16.31933485 | 2015-11-09 14:40:16.31933686 | 2015-11-09 14:40:16.31933987 | 2015-11-09 14:40:16.31934188 | 2015-11-09 14:40:16.31934389 | 2015-11-09 14:40:16.31934690 | 2015-11-09 14:40:16.31934891 | 2015-11-09 14:40:16.31935192 | 2015-11-09 14:40:16.31935393 | 2015-11-09 14:40:16.31935694 | 2015-11-09 14:40:16.31935895 | 2015-11-09 14:40:16.31936196 | 2015-11-09 14:40:16.31936397 | 2015-11-09 14:40:16.31936698 | 2015-11-09 14:40:16.31936899 | 2015-11-09 14:40:16.319371100 | 2015-11-09 14:40:16.319373
(84 rows)postgres=# fetch 100 from c1;id | crt_time
----+----------
(0 rows)postgres=# \h fetch
Command:     FETCH
Description: retrieve rows from a query using a cursor
Syntax:
FETCH [ direction [ FROM | IN ] ] cursor_namewhere direction can be empty or one of:NEXTPRIORFIRSTLASTABSOLUTE countRELATIVE countcountALLFORWARDFORWARD countFORWARD ALLBACKWARDBACKWARD countBACKWARD ALLpostgres=# fetch backward 100 from c1;id  |          crt_time
-----+----------------------------100 | 2015-11-09 14:40:16.31937399 | 2015-11-09 14:40:16.31937198 | 2015-11-09 14:40:16.31936897 | 2015-11-09 14:40:16.31936696 | 2015-11-09 14:40:16.31936395 | 2015-11-09 14:40:16.31936194 | 2015-11-09 14:40:16.31935893 | 2015-11-09 14:40:16.31935692 | 2015-11-09 14:40:16.31935391 | 2015-11-09 14:40:16.31935190 | 2015-11-09 14:40:16.31934889 | 2015-11-09 14:40:16.31934688 | 2015-11-09 14:40:16.31934387 | 2015-11-09 14:40:16.31934186 | 2015-11-09 14:40:16.31933985 | 2015-11-09 14:40:16.31933684 | 2015-11-09 14:40:16.31933483 | 2015-11-09 14:40:16.31933182 | 2015-11-09 14:40:16.31932981 | 2015-11-09 14:40:16.31932680 | 2015-11-09 14:40:16.31932479 | 2015-11-09 14:40:16.31932178 | 2015-11-09 14:40:16.31931977 | 2015-11-09 14:40:16.31931676 | 2015-11-09 14:40:16.31931475 | 2015-11-09 14:40:16.31931174 | 2015-11-09 14:40:16.31930973 | 2015-11-09 14:40:16.31930672 | 2015-11-09 14:40:16.31930371 | 2015-11-09 14:40:16.31928770 | 2015-11-09 14:40:16.31928469 | 2015-11-09 14:40:16.31928268 | 2015-11-09 14:40:16.31927967 | 2015-11-09 14:40:16.31927766 | 2015-11-09 14:40:16.31927465 | 2015-11-09 14:40:16.31927264 | 2015-11-09 14:40:16.31926963 | 2015-11-09 14:40:16.31926762 | 2015-11-09 14:40:16.31926461 | 2015-11-09 14:40:16.31926260 | 2015-11-09 14:40:16.31925959 | 2015-11-09 14:40:16.31925758 | 2015-11-09 14:40:16.31925557 | 2015-11-09 14:40:16.31925256 | 2015-11-09 14:40:16.3192555 | 2015-11-09 14:40:16.31924754 | 2015-11-09 14:40:16.31924553 | 2015-11-09 14:40:16.31924252 | 2015-11-09 14:40:16.3192451 | 2015-11-09 14:40:16.31923750 | 2015-11-09 14:40:16.31923549 | 2015-11-09 14:40:16.31923248 | 2015-11-09 14:40:16.3192347 | 2015-11-09 14:40:16.31922746 | 2015-11-09 14:40:16.31922545 | 2015-11-09 14:40:16.31922244 | 2015-11-09 14:40:16.3192243 | 2015-11-09 14:40:16.31921842 | 2015-11-09 14:40:16.31921541 | 2015-11-09 14:40:16.31921340 | 2015-11-09 14:40:16.3192139 | 2015-11-09 14:40:16.31920838 | 2015-11-09 14:40:16.31920537 | 2015-11-09 14:40:16.31920336 | 2015-11-09 14:40:16.319235 | 2015-11-09 14:40:16.31919834 | 2015-11-09 14:40:16.31919533 | 2015-11-09 14:40:16.31919332 | 2015-11-09 14:40:16.3191931 | 2015-11-09 14:40:16.31918830 | 2015-11-09 14:40:16.31918529 | 2015-11-09 14:40:16.31918328 | 2015-11-09 14:40:16.3191827 | 2015-11-09 14:40:16.31917826 | 2015-11-09 14:40:16.31917525 | 2015-11-09 14:40:16.31917324 | 2015-11-09 14:40:16.3191723 | 2015-11-09 14:40:16.31916822 | 2015-11-09 14:40:16.31916521 | 2015-11-09 14:40:16.31916320 | 2015-11-09 14:40:16.3191619 | 2015-11-09 14:40:16.31915818 | 2015-11-09 14:40:16.31915517 | 2015-11-09 14:40:16.31915316 | 2015-11-09 14:40:16.3191515 | 2015-11-09 14:40:16.31912614 | 2015-11-09 14:40:16.31876713 | 2015-11-09 14:40:16.31876512 | 2015-11-09 14:40:16.31876311 | 2015-11-09 14:40:16.3187610 | 2015-11-09 14:40:16.3187579 | 2015-11-09 14:40:16.3187558 | 2015-11-09 14:40:16.3187537 | 2015-11-09 14:40:16.318756 | 2015-11-09 14:40:16.3187485 | 2015-11-09 14:40:16.3187454 | 2015-11-09 14:40:16.3187433 | 2015-11-09 14:40:16.318742 | 2015-11-09 14:40:16.3187331 | 2015-11-09 14:40:16.318608
(100 rows)postgres=# fetch backward 100 from c1;id |          crt_time
----+----------------------------1 | 2015-11-09 14:25:04.101895
(1 row)postgres=# fetch backward 100 from c1;id | crt_time
----+----------
(0 rows)postgres=# fetch 1000 from c1;id  |          crt_time
-----+----------------------------1 | 2015-11-09 14:25:04.1018951 | 2015-11-09 14:40:16.3186082 | 2015-11-09 14:40:16.3187333 | 2015-11-09 14:40:16.318744 | 2015-11-09 14:40:16.3187435 | 2015-11-09 14:40:16.3187456 | 2015-11-09 14:40:16.3187487 | 2015-11-09 14:40:16.318758 | 2015-11-09 14:40:16.3187539 | 2015-11-09 14:40:16.31875510 | 2015-11-09 14:40:16.31875711 | 2015-11-09 14:40:16.3187612 | 2015-11-09 14:40:16.31876313 | 2015-11-09 14:40:16.31876514 | 2015-11-09 14:40:16.31876715 | 2015-11-09 14:40:16.31912616 | 2015-11-09 14:40:16.3191517 | 2015-11-09 14:40:16.31915318 | 2015-11-09 14:40:16.31915519 | 2015-11-09 14:40:16.31915820 | 2015-11-09 14:40:16.3191621 | 2015-11-09 14:40:16.31916322 | 2015-11-09 14:40:16.31916523 | 2015-11-09 14:40:16.31916824 | 2015-11-09 14:40:16.3191725 | 2015-11-09 14:40:16.31917326 | 2015-11-09 14:40:16.31917527 | 2015-11-09 14:40:16.31917828 | 2015-11-09 14:40:16.3191829 | 2015-11-09 14:40:16.31918330 | 2015-11-09 14:40:16.31918531 | 2015-11-09 14:40:16.31918832 | 2015-11-09 14:40:16.3191933 | 2015-11-09 14:40:16.31919334 | 2015-11-09 14:40:16.31919535 | 2015-11-09 14:40:16.31919836 | 2015-11-09 14:40:16.319237 | 2015-11-09 14:40:16.31920338 | 2015-11-09 14:40:16.31920539 | 2015-11-09 14:40:16.31920840 | 2015-11-09 14:40:16.3192141 | 2015-11-09 14:40:16.31921342 | 2015-11-09 14:40:16.31921543 | 2015-11-09 14:40:16.31921844 | 2015-11-09 14:40:16.3192245 | 2015-11-09 14:40:16.31922246 | 2015-11-09 14:40:16.31922547 | 2015-11-09 14:40:16.31922748 | 2015-11-09 14:40:16.3192349 | 2015-11-09 14:40:16.31923250 | 2015-11-09 14:40:16.31923551 | 2015-11-09 14:40:16.31923752 | 2015-11-09 14:40:16.3192453 | 2015-11-09 14:40:16.31924254 | 2015-11-09 14:40:16.31924555 | 2015-11-09 14:40:16.31924756 | 2015-11-09 14:40:16.3192557 | 2015-11-09 14:40:16.31925258 | 2015-11-09 14:40:16.31925559 | 2015-11-09 14:40:16.31925760 | 2015-11-09 14:40:16.31925961 | 2015-11-09 14:40:16.31926262 | 2015-11-09 14:40:16.31926463 | 2015-11-09 14:40:16.31926764 | 2015-11-09 14:40:16.31926965 | 2015-11-09 14:40:16.31927266 | 2015-11-09 14:40:16.31927467 | 2015-11-09 14:40:16.31927768 | 2015-11-09 14:40:16.31927969 | 2015-11-09 14:40:16.31928270 | 2015-11-09 14:40:16.31928471 | 2015-11-09 14:40:16.31928772 | 2015-11-09 14:40:16.31930373 | 2015-11-09 14:40:16.31930674 | 2015-11-09 14:40:16.31930975 | 2015-11-09 14:40:16.31931176 | 2015-11-09 14:40:16.31931477 | 2015-11-09 14:40:16.31931678 | 2015-11-09 14:40:16.31931979 | 2015-11-09 14:40:16.31932180 | 2015-11-09 14:40:16.31932481 | 2015-11-09 14:40:16.31932682 | 2015-11-09 14:40:16.31932983 | 2015-11-09 14:40:16.31933184 | 2015-11-09 14:40:16.31933485 | 2015-11-09 14:40:16.31933686 | 2015-11-09 14:40:16.31933987 | 2015-11-09 14:40:16.31934188 | 2015-11-09 14:40:16.31934389 | 2015-11-09 14:40:16.31934690 | 2015-11-09 14:40:16.31934891 | 2015-11-09 14:40:16.31935192 | 2015-11-09 14:40:16.31935393 | 2015-11-09 14:40:16.31935694 | 2015-11-09 14:40:16.31935895 | 2015-11-09 14:40:16.31936196 | 2015-11-09 14:40:16.31936397 | 2015-11-09 14:40:16.31936698 | 2015-11-09 14:40:16.31936899 | 2015-11-09 14:40:16.319371100 | 2015-11-09 14:40:16.319373
(101 rows)
回滚后可以正常回收垃圾。
postgres=#   rollback;
ROLLBACKpostgres=# vacuum verbose test;
INFO:  vacuuming "public.test"
INFO:  "test": found 1 removable, 101 nonremovable row versions in 1 out of 1 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM[参考]
1. http://www.postgresql.org/message-id/flat/BLU437-SMTP193E7367B788D2EC2B2B81DC160@phx.gbl#BLU437-SMTP193E7367B788D2EC2B2B81DC160@phx.gbl
2. http://git.postgresql.org/gitweb/?p=postgresql.git;a=snapshot;h=aa7f9493a02f5981c09b924323f0e7a58a32f2ed;sf=tgz
3. http://blog.163.com/digoal@126/blog/static/1638770402015329115636287/

PostgreSQL 彻底解决膨胀问题相关推荐

  1. postgresql错误解决 ERROR:current transaction is aborted

    def fieldbyname(self, namestr):try:self.env.cr.execute("SELECT "+namestr+" FROM dzjl_ ...

  2. PgSQL · 案例分享 · PostgreSQL+HybridDB解决企业TP+AP混合需求

    背景 随着IT行业在更多的传统行业渗透,我们正逐步的在进入DT时代,让数据发挥价值是企业的真正需求,否则就是一堆废的并且还持续消耗企业人力,财力的数据. 传统企业可能并不像互联网企业一样,有大量的开发 ...

  3. PostgreSQL pg_qualstats 解决索引缺失,添加索引

    商业数据库中,很多新版本都可以自动创建索引,给出索引创建的建议,并且以此作为卖点,ORACLE ,SQL SERVER 均有类似的功能,实际上通过查询语句,与全表扫描的语句,与谓词的比对,做出这样的系 ...

  4. Postgresql - 错误解决 - 9.3 - database is not accepting commands to avoid wraparound data......

    数据库日志和程序日志中都有报错 ERROR: database is not accepting commands to avoid wraparound data loss in database ...

  5. Windows10系统安装postgreSQL出错解决方法

    下载安装包后,点击安装初选error running的错误 解决方法:把路径中的中文字符改成英文的,重启以后再安装就成功了

  6. 关于PostgreSQL空间膨胀的研究

    首先,我们先启用一个数据库自带的控件方便对数据情况进行分析 create extension pgstattuple; 然后,还需要一个存储过程方便快速的制造数据 create function f1 ...

  7. PostgreSQL 的 MVCC 机制解析

    为什么80%的码农都做不了架构师?>>>    导语 PostgreSQL是通过MVCC(Multi-Version Concurrency Control)来保证事务的原子性和隔离 ...

  8. 大象起舞:用PostgreSQL解海盗分金问题

    作者简介 张泽鹏(redraiment):51信用卡信贷业务高级架构师. 资深挖坑不填党:在51先后挖过风控.信审.数据支持等多个互金信贷相关的坑 冷技术控:51内 PostgreSQL.FreeBS ...

  9. PostgreSQL重启恢复---XLOG 2.0

    XLOG 2.0 预备知识 <PostgreSQL重启恢复-XLOG 1.0> 概述 在<PostgreSQL重启恢复-XLOG>中,我们查询的XLOG的组织结构.XLOG写入 ...

最新文章

  1. tkinter button 一个按钮第二次回复_python-tkinter使用方法
  2. EasyUI权限系统
  3. 常考数据结构与算法:螺旋矩阵m*n
  4. 高通android开源代码下载
  5. jQuery框架风云榜案例
  6. NYOJ 1075 (递推 + 矩阵快速幂)
  7. linux 进程间通信-信号量(semagpore)
  8. orm2 中文文档 3.1 模型属性
  9. el表达式/jstl保留两位小数
  10. 问题:Warning: Attempt to present UINavigationController whose view is not in the window hierarchy
  11. [C语言学习]C语言程序设计基础(一)
  12. 解决idea的程序包错误:程序包XXX不存在的问题
  13. 泛微mysql密码_泛微ecology OA数据库配置信息泄露
  14. Android自定义一个播放器控件
  15. 百度富文本编辑器引入问题
  16. 实现登录注册页面详细(Servlet+jsp+java)
  17. ubuntu更换源(清华、中科大、阿里)
  18. UIKit 力学教程
  19. win10不让桌面上显示宽带连接服务器,win10系统宽带连接放在桌面的操作方法
  20. 只有在细细品读她的作品的时候,我才找到久违的宁静

热门文章

  1. 图片加水印怎么加,快速图片加水印?
  2. 计算机ram和rom的特点的是,什么是ROM和RAM?它们各有什么特点?
  3. ROM(只读存储器)
  4. 对于目标识别的一些idea-传递特征的position而不是特征或特征图
  5. HTML5中制作彩色圆环的代码,HTML5 五彩圆环Loading加载动画实现教程
  6. JavaScript奇淫技巧:按键精灵
  7. Elasticsearch教程部署使用
  8. 22计算机考研上岸个人经验近万字分享(11408初试360分)
  9. iframe标签(属性介绍(sandbox、srcdoc、scrolling)、iframe对象、onload事件、父集获取iframe内节点(同源和不同源情况)、domain修改规则和示例)
  10. const常量和基础数据类型