使用pgstatspack分析PostgreSQL数据库性能
pgstatspack
[root@test01 soft]# wget http://pgfoundry.org/frs/download.php/3151/pgstatspack_version_2.3.1.tar.gz
--2016-06-12 21:16:11-- http://pgfoundry.org/frs/download.php/3151/pgstatspack_version_2.3.1.tar.gz
Resolving pgfoundry.org... 188.227.186.71
Connecting to pgfoundry.org|188.227.186.71|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17049 (17K) [application/binary]
Saving to: “pgstatspack_version_2.3.1.tar.gz”
100%[============================================================================================>] 17,049 3.78K/s in 4.4s
2016-06-12 21:16:19 (3.78 KB/s) - “pgstatspack_version_2.3.1.tar.gz” saved [17049/17049]
[root@test01 soft]# cd ..
[root@test01 opt]# mkdir pgstatspack
[root@test01 opt]# cp /opt/soft/pgstatspack_version_2.3.1.tar.gz ./pgstatspack/
[root@test01 opt]# cd pgstatspack/
[root@test01 pgstatspack]# tar zxvf pgstatspack_version_2.3.1.tar.gz
[root@test01 pgstatspack]# cd pgstatspack
[root@test01 pgstatspack]# ls
bin pgstatspack_sample_report.txt README sql
install_pgstats.sh pgstatspack_stat_explanation.txt remove_pgstats.sh upgrade_pgstatspack.sh
pgstatspack需要pg_stat_statements包的支持,需要预先设置
在install_pgstats.sh文件中加载pg_env.sh环境变量文件或者指定psql的路径
. /opt/PostgreSQL/9.5/pg_env.sh
pgstatspack/bin目录下
delete_snapshot.sh pgstatspack_report.sh snapshot.sh
脚本也需要指定psql的环境变量
[root@test01 pgstatspack]# ./install_pgstats.sh
Password:
Results for database template1
Password:
Password:
Installing Statistics Package for database template1
Password:
Password:
Password:
Password:
Results for database benchmarksql
Password:
Password:
Installing Statistics Package for database benchmarksql
Password:
Password:
Password:
Password:
Results for database pg_monitor
Password:
Password:
Installing Statistics Package for database pg_monitor
Password:
Password:
Password:
Password:
snapshot.sh脚本是生成统计信息快照的,可以运行多次,本示例运行两次,可以在多次snapshot之间选择两个任意两个snapshot来查看这段时间内的数据库性能报告。
创建一次snapshot
[root@test01 bin]# ./snapshot.sh
Password:
Results for database benchmarksql
Password:
pgstatspack_snap
------------------
1
(1 row)
Results for database pg_monitor
Password:
pgstatspack_snap
------------------
1
(1 row)
产生数据
-bash-4.1$ pgbench -i -F 100 -s 128 -h 127.0.0.1 -p 5432 -U postgres -d postgres
做一次压力测试
-bash-4.1$ pgbench -c 10 -j 10 -T 180 -h localhost -p 5432 -U postgres -d postgres
transaction type: TPC-B (sort of)
scaling factor: 128
query mode: simple
number of clients: 10
number of threads: 10
duration: 180 s
number of transactions actually processed: 22226
latency average: 80.986 ms
tps = 122.490072 (including connections establishing)
tps = 122.505293 (excluding connections establishing)
[root@test01 bin]# ./snapshot.sh
Password:
Results for database benchmarksql
Password:
pgstatspack_snap
------------------
2
(1 row)
Results for database pg_monitor
Password:
pgstatspack_snap
------------------
2
(1 row)
[root@test01 bin]# ./pgstatspack_report.sh
/opt/soft/pgstatspack/bin /opt/soft/pgstatspack/bin
Password for user postgres:
List of available databases:
1 . benchmarksql
2 . pg_monitor
Please select a number from the above list [ 1 - 2 ]
1
Password for user postgres:
Password for user postgres:
snapid | ts | description
--------+----------------------------+---------------------
2 | 2016-06-12 22:08:35.276569 | cron based snapshot
1 | 2016-06-12 21:54:27.891945 | cron based snapshot
(2 rows)
Enter start snapshot id : 1
Enter stop snapshot id : 2
Using file name: /tmp/pgstatreport_benchmarksql_1_2.txt
###########################################################################################################
PGStatspack version 2.3 by uwe.bartels@gmail.com
###########################################################################################################
Snapshot information
Begin snapshot :
Password for user postgres:
snapid | ts | description
--------+----------------------------+---------------------
1 | 2016-06-12 21:54:27.891945 | cron based snapshot
(1 row)
End snapshot :
Password for user postgres:
snapid | ts | description
--------+----------------------------+---------------------
2 | 2016-06-12 22:08:35.276569 | cron based snapshot
(1 row)
Seconds in snapshot: Password for user postgres:
847.384624
Database version
Password for user postgres:
version
----------------------------------------------------------------------------------------------------------
PostgreSQL 9.5.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55), 64-bit
(1 row)
Database information
Password for user postgres:
current_database | dbsize
------------------+--------
benchmarksql | 10 GB
(1 row)
Database statistics
Password for user postgres:
database | tps | hitrate | lio_ps | pio_ps | rollbk_ps
--------------+-------+---------+---------+--------+-----------
postgres | 26.36 | 50.00 | 1671.91 | 820.64 | 0.00
benchmarksql | 0.04 | 96.00 | 10.90 | 0.33 | 0.00
pg_monitor | 0.04 | 96.00 | 10.58 | 0.33 | 0.00
template1 | 0.03 | 98.00 | 1.24 | 0.02 | 0.00
template0 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00
(5 rows)
Password for user postgres:
Top 20 tables ordered by table size changes
Password for user postgres:
table | table_growth | index_growth
------------------------------------+--------------+--------------
pg_catalog.pg_transform | | 0
pg_catalog.pg_ts_config | | 0
public.pgstatspack_tables | | 8192
pg_toast.pg_toast_3596 | | 0
pg_catalog.pg_ts_dict | | 0
pg_catalog.pg_cast | | 0
pg_catalog.pg_foreign_server | | 0
pg_catalog.pg_event_trigger | | 0
public.pgstatspack_sequences | | 8192
public.pgbench_branches | | 0
pg_catalog.pg_namespace | | 0
pg_toast.pg_toast_13102 | | 0
public.pgstatspack_indexes | | 8192
pg_catalog.pg_depend | | 0
public.pgstatspack_database | | 0
public.pgbench_tellers | | 0
pg_catalog.pg_language | | 0
pg_catalog.pg_largeobject_metadata | | 0
pg_catalog.pg_authid | | 0
pg_toast.pg_toast_13097 | | 0
(20 rows)
Top 20 tables ordered by high table to index read ratio
Password for user postgres:
table | system_read_pct | table_read_pct | index_read_pct
--------------------------+-----------------+----------------+----------------
pg_catalog.pg_class | 61 | 95 | 4
pg_catalog.pg_proc | 18 | 97 | 2
public.pgstatspack_names | 7 | 84 | 15
pg_catalog.pg_index | 4 | 90 | 9
pg_catalog.pg_opclass | 2 | 0 | 100
pg_catalog.pg_attribute | 2 | 0 | 100
pg_catalog.pg_database | 1 | 56 | 43
pg_catalog.pg_am | 0 | 100 | 0
pg_catalog.pg_namespace | 0 | 38 | 61
pg_catalog.pg_language | 0 | 0 | 100
pg_catalog.pg_tablespace | 0 | 0 | 100
pg_catalog.pg_amproc | 0 | 0 | 100
pg_toast.pg_toast_2619 | 0 | 0 | 100
pg_catalog.pg_shdepend | 0 | 0 | 100
pg_catalog.pg_type | 0 | 0 | 100
pg_catalog.pg_amop | 0 | 0 | 100
pg_toast.pg_toast_2618 | 0 | 0 | 100
pg_catalog.pg_cast | 0 | 0 | 100
pg_catalog.pg_authid | 0 | 0 | 100
pg_catalog.pg_rewrite | 0 | 0 | 100
(20 rows)
Top 20 tables ordered by inserts
Password for user postgres:
table | table_inserts
------------------------------------+---------------
public.pgstatspack_names | 329
public.pgstatspack_indexes | 134
public.pgstatspack_tables | 95
public.pgstatspack_settings | 57
pg_catalog.pg_statistic | 33
public.pgstatspack_database | 5
public.pgstatspack_sequences | 2
public.pgstatspack_bgwriter | 1
public.pgstatspack_snap | 1
pg_catalog.pg_cast | 0
pg_catalog.pg_description | 0
pg_catalog.pg_namespace | 0
pg_toast.pg_toast_13102 | 0
pg_catalog.pg_depend | 0
pg_catalog.pg_ts_dict | 0
pg_catalog.pg_authid | 0
public.pgbench_branches | 0
pg_catalog.pg_largeobject_metadata | 0
information_schema.sql_parts | 0
pg_catalog.pg_db_role_setting | 0
(20 rows)
Top 20 tables ordered by updates
Password for user postgres:
table | table_updates
------------------------------------+---------------
pg_toast.pg_toast_3596 | 0
pg_catalog.pg_ts_dict | 0
pg_catalog.pg_language | 0
public.pgstatspack_names | 0
pg_toast.pg_toast_13102 | 0
pg_catalog.pg_cast | 0
pg_catalog.pg_foreign_server | 0
pg_catalog.pg_db_role_setting | 0
public.pgstatspack_sequences | 0
public.pgbench_branches | 0
pg_catalog.pg_namespace | 0
pg_catalog.pg_description | 0
public.pgstatspack_indexes | 0
pg_catalog.pg_depend | 0
public.pgstatspack_database | 0
public.pgbench_tellers | 0
information_schema.sql_parts | 0
pg_catalog.pg_largeobject_metadata | 0
pg_catalog.pg_authid | 0
pg_catalog.pg_event_trigger | 0
(20 rows)
Top 20 tables ordered by deletes
Password for user postgres:
table | table_deletes
------------------------------------+---------------
pg_toast.pg_toast_3596 | 0
pg_catalog.pg_ts_dict | 0
pg_catalog.pg_language | 0
public.pgstatspack_names | 0
pg_toast.pg_toast_13102 | 0
pg_catalog.pg_cast | 0
pg_catalog.pg_foreign_server | 0
pg_catalog.pg_db_role_setting | 0
public.pgstatspack_sequences | 0
public.pgbench_branches | 0
pg_catalog.pg_namespace | 0
pg_catalog.pg_description | 0
public.pgstatspack_indexes | 0
pg_catalog.pg_depend | 0
public.pgstatspack_database | 0
public.pgbench_tellers | 0
information_schema.sql_parts | 0
pg_catalog.pg_largeobject_metadata | 0
pg_catalog.pg_authid | 0
pg_catalog.pg_event_trigger | 0
(20 rows)
Tables ordered by percentage of tuples scanned
Password for user postgres:
table | rows_read_pct | tab_hitrate | idx_hitrate | tab_read | tab_hit | idx_read | idx_hit
--------------------------+---------------+-------------+-------------+----------+---------+----------+---------
pg_catalog.pg_class | 61 | 99 | 98 | 1 | 1601 | 7 | 781
pg_catalog.pg_proc | 18 | 73 | 91 | 72 | 198 | 20 | 221
public.pgstatspack_names | 7 | 99 | 99 | 5 | 722 | 7 | 1462
pg_catalog.pg_index | 4 | 98 | 96 | 1 | 144 | 4 | 131
pg_catalog.pg_opclass | 2 | 98 | 93 | 3 | 271 | 4 | 71
pg_catalog.pg_attribute | 2 | 94 | 99 | 18 | 342 | 5 | 721
pg_catalog.pg_database | 1 | 99 | 99 | 0 | 320 | 0 | 394
pg_catalog.pg_aggregate | 0 | 0 | 0 | 1 | 0 | 2 | 0
pg_catalog.pg_attrdef | 0 | 33 | 40 | 1 | 1 | 2 | 2
pg_toast.pg_toast_1255 | 0 | 33 | 25 | 1 | 1 | 2 | 1
pg_catalog.pg_language | 0 | 0 | 0 | 1 | 0 | 2 | 0
pg_catalog.pg_tablespace | 0 | 94 | 96 | 0 | 16 | 0 | 30
pg_catalog.pg_amproc | 0 | 94 | 95 | 1 | 36 | 3 | 86
pg_toast.pg_toast_2619 | 0 | 0 | 0 | 1 | 0 | 2 | 0
pg_catalog.pg_am | 0 | 87 | 0 | 1 | 14 | 0 | 0
pg_catalog.pg_shdepend | 0 | 60 | 50 | 1 | 3 | 2 | 3
pg_catalog.pg_type | 0 | 91 | 90 | 5 | 61 | 7 | 77
pg_catalog.pg_amop | 0 | 92 | 93 | 5 | 77 | 6 | 108
pg_toast.pg_toast_2618 | 0 | 20 | 66 | 7 | 2 | 2 | 6
pg_catalog.pg_cast | 0 | 93 | 98 | 2 | 40 | 2 | 213
pg_catalog.pg_namespace | 0 | 98 | 96 | 1 | 149 | 4 | 141
pg_catalog.pg_authid | 0 | 97 | 98 | 0 | 35 | 0 | 70
pg_catalog.pg_rewrite | 0 | 50 | 76 | 6 | 7 | 2 | 10
pg_catalog.pg_statistic | 0 | 78 | 96 | 12 | 48 | 4 | 160
pg_catalog.pg_operator | 0 | 81 | 89 | 14 | 67 | 8 | 73
(25 rows)
Indexes ordered by scans
Password for user postgres:
index | table | scans | tup_read | tup_fetch | idx_blks_read | idx_blks_hit
----------------------------------------------------+-------------------------------+-------+----------+-----------+---------------+--------------
pg_catalog.pg_class_oid_index | pg_catalog.pg_class | 697 | 1049 | 811 | 1 | 711
public.idx_pgstatspack_names_name | public.pgstatspack_names | 377 | 370 | 370 | 5 | 1132
pg_catalog.pg_attribute_relid_attnum_index | pg_catalog.pg_attribute | 354 | 842 | 842 | 5 | 721
pg_catalog.pg_db_role_setting_databaseid_rol_index | pg_catalog.pg_db_role_setting | 280 | 0 | 0 | 0 | 280
pg_catalog.pg_cast_source_target_index | pg_catalog.pg_cast | 213 | 42 | 42 | 2 | 213
pg_catalog.pg_database_oid_index | pg_catalog.pg_database | 170 | 170 | 170 | 0 | 240
pg_catalog.pg_namespace_oid_index | pg_catalog.pg_namespace | 137 | 137 | 137 | 2 | 137
pg_catalog.pg_index_indexrelid_index | pg_catalog.pg_index | 97 | 97 | 97 | 2 | 110
pg_catalog.pg_proc_oid_index | pg_catalog.pg_proc | 87 | 87 | 87 | 10 | 165
pg_catalog.pg_database_datname_index | pg_catalog.pg_database | 84 | 84 | 84 | 0 | 154
pg_catalog.pg_type_oid_index | pg_catalog.pg_type | 63 | 62 | 62 | 2 | 63
pg_catalog.pg_statistic_relid_att_inh_index | pg_catalog.pg_statistic | 48 | 11 | 11 | 4 | 160
pg_catalog.pg_opclass_oid_index | pg_catalog.pg_opclass | 42 | 42 | 42 | 2 | 55
pg_catalog.pg_amproc_fam_proc_index | pg_catalog.pg_amproc | 37 | 62 | 62 | 3 | 86
pg_catalog.pg_amop_fam_strat_index | pg_catalog.pg_amop | 37 | 37 | 37 | 3 | 73
pg_catalog.pg_class_relname_nsp_index | pg_catalog.pg_class | 37 | 25 | 25 | 5 | 70
pg_catalog.pg_proc_proname_args_nsp_index | pg_catalog.pg_proc | 32 | 47 | 47 | 10 | 56
pg_catalog.pg_authid_oid_index | pg_catalog.pg_authid | 21 | 21 | 21 | 0 | 42
pg_catalog.pg_operator_oid_index | pg_catalog.pg_operator | 21 | 21 | 21 | 3 | 41
pg_catalog.pg_index_indrelid_index | pg_catalog.pg_index | 21 | 29 | 29 | 2 | 21
pg_catalog.pg_operator_oprname_l_r_n_index | pg_catalog.pg_operator | 18 | 86 | 86 | 5 | 32
pg_catalog.pg_amop_opr_fam_index | pg_catalog.pg_amop | 18 | 45 | 45 | 3 | 35
pg_catalog.pg_opclass_am_name_nsp_index | pg_catalog.pg_opclass | 16 | 674 | 674 | 2 | 16
pg_catalog.pg_tablespace_oid_index | pg_catalog.pg_tablespace | 16 | 16 | 16 | 0 | 30
pg_catalog.pg_authid_rolname_index | pg_catalog.pg_authid | 14 | 14 | 14 | 0 | 28
pg_catalog.pg_rewrite_rel_rulename_index | pg_catalog.pg_rewrite | 11 | 13 | 13 | 2 | 10
pg_catalog.pg_type_typname_nsp_index | pg_catalog.pg_type | 9 | 4 | 4 | 5 | 14
pg_toast.pg_toast_2618_index | pg_toast.pg_toast_2618 | 7 | 20 | 20 | 2 | 6
pg_catalog.pg_namespace_nspname_index | pg_catalog.pg_namespace | 5 | 4 | 4 | 2 | 4
pg_catalog.pg_shdepend_reference_index | pg_catalog.pg_shdepend | 4 | 4 | 4 | 2 | 3
pg_catalog.pg_attrdef_adrelid_adnum_index | pg_catalog.pg_attrdef | 2 | 2 | 2 | 2 | 2
pg_toast.pg_toast_1255_index | pg_toast.pg_toast_1255 | 2 | 4 | 4 | 2 | 1
pg_catalog.pg_aggregate_fnoid_index | pg_catalog.pg_aggregate | 1 | 1 | 1 | 2 | 0
pg_toast.pg_toast_2619_index | pg_toast.pg_toast_2619 | 1 | 1 | 1 | 2 | 0
pg_catalog.pg_language_oid_index | pg_catalog.pg_language | 1 | 1 | 1 | 2 | 0
public.pgstatspack_indexes_pk | public.pgstatspack_indexes | 0 | 0 | 0 | 2 | 134
public.pgstatspack_settings_pk | public.pgstatspack_settings | 0 | 0 | 0 | 2 | 57
public.pgstatspack_sequences_pk | public.pgstatspack_sequences | 0 | 0 | 0 | 2 | 2
public.pgstatspack_names_pkey | public.pgstatspack_names | 0 | 0 | 0 | 2 | 330
pg_catalog.pg_class_tblspc_relfilenode_index | pg_catalog.pg_class | 0 | 0 | 0 | 1 | 0
public.pgstatspack_bgwriter_pk | public.pgstatspack_bgwriter | 0 | 0 | 0 | 2 | 0
public.pgstatspack_tables_pk | public.pgstatspack_tables | 0 | 0 | 0 | 2 | 95
public.pgstatspack_database_pk | public.pgstatspack_database | 0 | 0 | 0 | 2 | 5
(43 rows)
Sequences ordered by blks_read
Password for user postgres:
sequence | blks_read | blks_hit
--------------------------+-----------+----------
public.pgstatspacknameid | 1 | 328
public.pgstatspackid | 1 | 0
(2 rows)
Top 20 SQL statements ordered by total_time
Password for user postgres:
calls | total_time | total_time_percent | rows | user | query
-------+------------+--------------------+------+------+-------
(0 rows)
Top 20 user functions ordered by total_time
Password for user postgres:
funcid | function_name | calls | total_time | self_time
--------+---------------+-------+------------+-----------
(0 rows)
background writer stats
Password for user postgres:
checkpoints_timed | checkpoints_req | buffers_checkpoint | buffers_clean | maxwritten_clean | buffers_backend | buffers_alloc
-------------------+-----------------+--------------------+---------------+------------------+-----------------+---------------
3 | 0 | 11489 | 21518 | 33 | 628075 | 43004
(1 row)
background writer relative stats
Password for user postgres:
checkpoints_timed | minutes_between_checkpoint | buffers_checkpoint | buffers_clean | buffers_backend | total_writes | avg_checkpoint_write
-------------------+----------------------------+--------------------+---------------+-----------------+--------------+----------------------
100% | 5 | 1% | 3% | 95% | 6.095 MB/s | 29.000 MB
(1 row)
Parameters
Password for user postgres:
name | start_setting | stop_setting | source
------------------------------------+------------------------------------------+------------------------------------------+----------------------
max_stack_depth | 2048 | 2048 | environment variable
hba_file | /opt/PostgreSQL/9.5/data/pg_hba.conf | /opt/PostgreSQL/9.5/data/pg_hba.conf | override
lc_time | en_US.UTF-8 | en_US.UTF-8 | configuration file
log_destination | csvlog | csvlog | configuration file
auto_explain.log_analyze | on | on | configuration file
autovacuum | on | on | configuration file
ident_file | /opt/PostgreSQL/9.5/data/pg_ident.conf | /opt/PostgreSQL/9.5/data/pg_ident.conf | override
max_connections | 100 | 100 | configuration file
log_truncate_on_rotation | on | on | configuration file
TimeZone | PRC | PRC | configuration file
log_connections | on | on | configuration file
pg_stat_statements.max | 10000 | 10000 | configuration file
dynamic_shared_memory_type | posix | posix | configuration file
auto_explain.log_min_duration | 0 | 0 | configuration file
client_min_messages | notice | notice | configuration file
port | 5432 | 5432 | configuration file
application_name | psql.bin | psql.bin | client
lc_numeric | en_US.UTF-8 | en_US.UTF-8 | configuration file
wal_buffers | 512 | 512 | override
lc_ctype | en_US.UTF-8 | en_US.UTF-8 | override
log_statement | ddl | ddl | configuration file
log_lock_waits | on | on | configuration file
data_checksums | off | off | override
log_duration | on | on | configuration file
client_encoding | UTF8 | UTF8 | client
auto_explain.log_verbose | on | on | configuration file
config_file | /opt/PostgreSQL/9.5/data/postgresql.conf | /opt/PostgreSQL/9.5/data/postgresql.conf | override
transaction_deferrable | off | off | override
lc_collate | en_US.UTF-8 | en_US.UTF-8 | override
log_filename | postgresql-%Y-%m-%d_%H%M%S.log | postgresql-%Y-%m-%d_%H%M%S.log | configuration file
lc_messages | en_US.UTF-8 | en_US.UTF-8 | configuration file
transaction_isolation | read committed | read committed | override
log_replication_commands | on | on | configuration file
default_text_search_config | pg_catalog.english | pg_catalog.english | configuration file
server_encoding | UTF8 | UTF8 | override
log_directory | pg_log | pg_log | configuration file
transaction_read_only | off | off | override
auto_explain.log_timing | on | on | configuration file
pg_stat_statements.track_utility | off | off | configuration file
log_file_mode | 0600 | 0600 | configuration file
log_checkpoints | on | on | configuration file
lc_monetary | en_US.UTF-8 | en_US.UTF-8 | configuration file
log_hostname | on | on | configuration file
logging_collector | on | on | configuration file
log_line_prefix | %t%u%a%d%r%e | %t%u%a%d%r%e | configuration file
auto_explain.log_triggers | on | on | configuration file
log_disconnections | on | on | configuration file
auto_explain.log_buffers | on | on | configuration file
log_error_verbosity | verbose | verbose | configuration file
DateStyle | ISO, MDY | ISO, MDY | configuration file
listen_addresses | * | * | configuration file
auto_explain.log_nested_statements | on | on | configuration file
shared_buffers | 16384 | 16384 | configuration file
data_directory | /opt/PostgreSQL/9.5/data | /opt/PostgreSQL/9.5/data | override
log_timezone | PRC | PRC | configuration file
pg_stat_statements.track | all | all | configuration file
shared_preload_libraries | pg_stat_statements,auto_explain | pg_stat_statements,auto_explain | configuration file
(57 rows)
This report is saved as /tmp/pgstatreport_benchmarksql_1_2.txt
/opt/soft/pgstatspack/bin
[root@test01 bin]# cd /tmp/
[root@test01 tmp]# ls
bitrock_installer_25349.log hsperfdata_root postgresql_installer_cbd1bc9d85
bitrock_installer.log pgstatreport_benchmarksql_1_2.txt
使用pgstatspack分析PostgreSQL数据库性能的更多相关文章
- PostgreSQL 数据库性能调优的注意点
PostgreSQL提供了一些性能调优的功能.主要有如下几个方面.1.使用EXPLAIN EXPLAIN命令可以查看执行计划,这个方法是我们最主要的调试工具. 2.及时更新执行计划中使用的统计信息 ...
- 诊断Java代码中常见的数据库性能热点问题应该这么做!
“你的Java应用程序的性能是怎样诊断和优化的?不妨看看这两位西医的方子.如果你有更好疗效的药方,也欢迎在评论区告诉我们. 当我在帮助一些开发者或架构师分析及优化Java应用程序的性能时,关键往往不在 ...
- 0709MySQL 数据库性能优化之表结构优化
转自http://isky000.com/database/mysql-perfornamce-tuning-schema MySQL 数据库性能优化之缓存参数优化 MySQL数据库性能优化之硬件瓶颈 ...
- 对Oracle 、SQL Server、MySQL、PostgreSQL数据库优缺点分析
对Oracle .SQL Server.MySQL.PostgreSQL数据库优缺点分析 Oracle Database Oracle Database,又名Oracle RDBMS,或简称Oracl ...
- 从运维的角度分析使用阿里云数据库RDS的必要性--你不应该在阿里云上使用自建的MySQL/SQL Server/Oracle/PostgreSQL数据库
开宗明义,你不应该在阿里云上使用自建的MySQL or SQL Server数据库,对了,还有Oracle or PostgreSQL数据库. 云数据库 RDS(Relational Database ...
- 什么是分析型数据库PostgreSQL版
分析型数据库PostgreSQL版(原HybridDB for PostgreSQL)为您提供简单.快速.经济高效的 PB 级云端数据仓库解决方案.分析型数据库PostgreSQL版 兼容 Green ...
- 悠星网络基于阿里云分析型数据库PostgreSQL版的数据实践
说到“大数据”,当下这个词很火,各行各业涉及到数据的,目前都在提大数据,提数据仓库,数据挖掘或者机器学习,但同时另外一个热门的名词也很火,那就是“云”.越来越多的企业都在搭建属于自己的云平台,也有一些 ...
- 扩展我们的分析处理服务(Smartly.io):使用 Citus 对 PostgreSQL 数据库进行分片
原文:Scaling Our Analytical Processing Service: Sharding a PostgreSQL Database with Citus 在线广告商正在根据绩效数 ...
- 基于linux(CentOS7)数据库性能优化(Postgresql)
基于CentOS7数据库性能优化(Postgresql) 1. 磁盘 a) Barriers IO i. 通过查看linux是否加载libata,确定是否开 ...
随机推荐
- 【BZOJ】1124: [POI2008]枪战Maf
题意 \(n(n < 1000000)\)个人,每个人\(i\)指向一个人\(p_i\),如果轮到\(i\)了且他没死,则他会将\(p_i\)打死.求一种顺序,问死的人最少和最多的数目. 分析 ...
- Android --ToggleButton的使用
1. 效果图
- Tomcat_启动多个tomcat时,会报StandardServer.await: Invalid command '' received错误
解决方案如下:将tomcat下的server.xml文件中的端口有问题,修改规则按以下标准显示“http的端口修改为6000 to 6800之间,shutdown的端口修改为3000 to 3300之 ...
- 线上Java应用排查和诊断规范
@郑昀 整理 标准做法一:OOM触发HeadpDump 目的: OOM发生时,输出堆栈快照文件,供研发人员分析. 在JVM中,如果98%的时间是用于 GC 且可用的 Heap size 不足2%的时候 ...
- SQL常用语句总结
-------查询一个表有多少列select count(*) from sysobjects a join syscolumns bon a.id=b.idwhere a.name='XXX' -- ...
- Struts2中的Action类(解耦方式,耦合方式)
一.解耦方式 特点:对web资源进行了封装,便于单元测试. 实现:ActionContext和接口方式 1.ActionContext 特点:Action执行的上下文对象.保存了执行Action所需要 ...
- typeof操作符在javascript中运用时时页面上的操作数显示
typeof可以告诉我们它的操作数是一个字符串(string).数值(number).函数(function).布尔值(boolean)或对象(object). 1.字符串(string) alert ...
- Js中找任意对象的原型方法及改造原型
Java中有运行时类型识别,js可以很方便的模仿这个特性,因为所有js对象都有一个属性constructor(构造器),表示这个对象的构造方法,原型与构造方法同名,所以可以通过这儿知道任意对象的原型名 ...
- BizTalk开发系列(十三) Schema设计之值约束
XML Schema 的作用是定义 XML 文档的合法构建模块.在开发过程中有时需要对XML文档做精确的约束.以保证XMl数据的准确性. 今天我们以一个班级Sample来讲探讨一下如何在开发BizTa ...
- NFS服务器搭建
1. 安装nfs-kernel-server,然后编辑/etc/exports. /sambadata/nfsserver 10.0.0.0/255.255.255.0(fsid=0,all_s ...