摘要: postgresql,shared_buffer,如何配置shared_buffers,shared_buffers调优 阅读全文
posted @ 2019-02-26 17:21 月图灵 阅读(5828) 评论(0) 推荐(4) 编辑
摘要: greenplum最终的方法是: delete from test where (gp_segment_id, ctid) not in (select gp_segment_id, min(ctid) from test group by x, gp_segment_id); postgresql 阅读全文
posted @ 2019-01-03 19:43 月图灵 阅读(2816) 评论(0) 推荐(0) 编辑
摘要: postgresql的排序。 https://www.cnblogs.com/flying-tiger/p/8120046.html 1.是根据排序数据量的大小来判断,如果数据量少到能够整体放到内存的话,就直接快速排序, 2.数据量较大内存放不下,但是所需要返回的元组内存可以装下或者TOP N的性能 阅读全文
posted @ 2019-01-03 19:27 月图灵 阅读(1903) 评论(0) 推荐(0) 编辑
摘要: https://blog.codinghorror.com/the-infinite-space-between-words/ 磁盘耗时时间 阅读全文
posted @ 2019-01-03 19:08 月图灵 阅读(228) 评论(0) 推荐(0) 编辑
摘要: pg_log,数据库日志表postgresqllog CREATE TABLE postgres_log ( log_time timestamp(3) with time zone, 日志生成时间 user_name text, 登陆用户名 database_name text, 数据库名 pro 阅读全文
posted @ 2019-01-03 19:07 月图灵 阅读(1316) 评论(0) 推荐(0) 编辑
摘要: 查看各个数据库表大小(不包含索引),以及表数据量 mysql: select table_name,concat(round((DATA_LENGTH/1024/1024),2),'M')as size,table_rows from information_schema.tables order 阅读全文
posted @ 2019-01-03 19:05 月图灵 阅读(4388) 评论(0) 推荐(0) 编辑
摘要: 清空os缓存,shared_buffers 1.停止数据库 pg_ctl -m fast -D /pgdata stop 2.清空高速缓存前尝试将数据刷新至磁盘 sync 3.清空缓存 echo 3 > /proc/sys/vm/drop_caches 4.启动数据库 pg_ctl -D /pgda 阅读全文
posted @ 2019-01-03 19:03 月图灵 阅读(1383) 评论(0) 推荐(0) 编辑
摘要: 在postgresql9.5的时候做过一个测试就是sum()的效率最终的测试结果是sum(int)>sum(numeric)>sum(bigint)当时比较诧异为啥sum(bigint)效率比sum(numeric)还低。sum(numeric)的效率比sum(bigint)快了10%。 在pg10 阅读全文
posted @ 2019-01-03 18:55 月图灵 阅读(5538) 评论(0) 推荐(0) 编辑
摘要: drop table tablesize create table tablesize( phone int) create table tablesize( phone text) create table tablesize( phone char(30)) create table table 阅读全文
posted @ 2019-01-03 18:50 月图灵 阅读(1174) 评论(0) 推荐(0) 编辑
摘要: mongodb pg mysql jsonb对比 http://erthalion.info/2017/12/21/advanced-json-benchmarks/ 使用禁用jsonb列的压缩 ALTER TABLE table_name ALTER COLUMN column SET STORA 阅读全文
posted @ 2019-01-03 18:49 月图灵 阅读(1596) 评论(0) 推荐(0) 编辑