时间:2024-02-09 10:40作者:下载吧人气:18
摘要
关系数据库很重要的一个方面是查询速度。查询速度的好坏,直接影响一个系统的好坏。
查询速度一般需要通过查询规划来窥视执行的过程。
查询路径会选择查询代价最低的路径执行。而这个代价是怎么算出来的呢。
主要关注的参数和表
参数:来自postgresql.conf文件,可以通过show 来查看
seq_page_cost = 1.0 # measured on an arbitrary scale
random_page_cost = 4.0 # same scale as above
cpu_tuple_cost = 0.01 # same scale as above
cpu_index_tuple_cost = 0.005 # same scale as above
cpu_operator_cost = 0.0025 # same scale as above
parallel_tuple_cost = 0.1 # same scale as above
parallel_setup_cost = 1000.0 # same scale as above
网友评论