cd postgresql的源代码目录/contrib/pgfincore $USE_PGXS=1 make clean $USE_PGXS=1 make
1.2 instll (by root)
1 2 3
#cd /home/postgres #source .bash_profile #USE_PGXS=1 make install
1.3 导入pgfincore.sql文件
1 2 3 4
su - postgres cd postgresql的安装目录/share/postgresql/contrib chown -R postgres:postgres/database psql mydb -f pgfincore.sql
主要函数介绍
pgsysconf –查看操作系统CACHE情况
pgmincore –查看对象(表,索引)CACHE情况
pgfadv_willneed –将数据库对象(表,索引)载入OS CACHE
pgfadv_dontneed –将数据库对象(表,索引)刷出OS CACHE
pgfadv_normal –This function set //NORMAL// flag on the current relation. ()
pgmincore_snapshot –保存对象块照情况
pgfadv_willneed_snapshot –还原对象快照情况
函数返回的列
relpath : the relation path block_size : the size of one block disk? block_disk : the total number of file system blocks of the relation block_mem : the total number of file system blocks of the relation in buffer cache. (not the shared buffers from PostgreSQL but the OS cache) group_mem : the number of groups of adjacent block_mem
[postgres@pg1](mailto:postgres@pg1) pgfincore]$ USE_PGXS=1 make clean make: Warning: File `/database/pgdata/tbs1/pg_root/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.global' has modification time 1.4e+08 s in the future rm -f pgfincore.so pgfincore.o rm -f pgfincore.sql uninstall_pgfincore.sql make: 警告:检测到时钟错误。您的创建可能是不完整的。